Skip to Content
JAVASCRIPT網頁應用程式設計
book

JAVASCRIPT網頁應用程式設計

by Alex MacCaw
January 2013
Intermediate to advanced
332 pages
5h 23m
Chinese
GoTop Information, Inc.
Content preview from JAVASCRIPT網頁應用程式設計
測試與除錯
|
133
IE 89
Firefox 3.6
Safari 5
Chrome 11
即使手邊沒有任何統計數據可看出網站使用者中,瀏覽器的使用率分布情形,也可以依
據個人對網站鎖定族群的了解和經驗,先做些大膽的假設。確認好需要支援的瀏覽器之
後,就可以開始撰寫自動化的測試程式,確保這些該支援的瀏覽器,都能順利通過測試
程式的測試。
單元測試(Unit Testing
人工的測試比較算是整合性測試(integration testing),因為它主要是從功能面來確認程
式是否都能正常運作。相較之下,單元測試會從較底層的角度來對程式進行測試。它是
要確認某一段特定的程式碼,是否能跑出我們所預期的結果。進行單元測試時,多半都
會測出一些跨瀏覽器的問題,但在單元測試的階段,要修正這些問題相對容易得多,因
為需要檢查的程式碼不會太多。
單元測試的好處之一,就是能為自動化測試預先做好準備。本章稍後會針對自動化測試
有更深入的介紹,不過基本上只要有準備好單元測試,就可以架設一台隨時讓程式設計
師更新程式的伺服器(簡稱持續整合伺服器,continuous integration server),只要有人
更新程式到伺服器上,就立即自動執行所有的單元測試程式。這種做法會比人工測試所
有的系統功能有效率得多,而且可以確保某段程式碼的修改,不會引發其他副作用。
目前可用來開發單元測試程式的 JavaScript 函式庫非常多,都各有優缺點。雖然本章僅
會針對幾種較常見的函式庫進行說明,不過大部分的基本原則,應該可以一體適用於所 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

Ethan Brown, 武舎 広幸, 武舎 るみ
PHP编程:第4版

PHP编程:第4版

Kevin Tatroe, Peter MacIntyre
Strange Code

Strange Code

Ronald T. Kneusel
Perfecting Your Thinking Skills

Perfecting Your Thinking Skills

MIT Sloan Management Review

Publisher Resources

ISBN: 9789862766811