Test-Driven JavaScript Development
暫譯: 測試驅動的 JavaScript 開發
Ravi Kumar Gupta, Hetal Prajapati, Harmeet Singh
- 出版商: Packt Publishing
- 出版日期: 2015-12-21
- 售價: $1,840
- 貴賓價: 9.5 折 $1,748
- 語言: 英文
- 頁數: 240
- 裝訂: Paperback
- ISBN: 1782174923
- ISBN-13: 9781782174929
-
相關分類:
JavaScript、TDD 測試導向開發
海外代購書籍(需單獨結帳)
商品描述
Learn JavaScript test-driven development using popular frameworks and tools
About This Book
- Learn the life cycle of TDD and its importance in real-world application
- Gain knowledge about popular tools and analyze features, syntax, and how they help in JavaScript testing
- Implement test-driven programming exercises using the practical code examples
Who This Book Is For
If you have an intermediate knowledge of HTML, CSS, and JavaScript and want to learn how and why the test-driven development approach is better for your assignments, then this book is for you.
What You Will Learn
- Basic TDD fundamentals, life cycle, and benefits
- Become acquainted with the concepts and elements of unit testing and writing basic unit tests for JavaScript
- Understand the way JsUnit, Qunit, Karma and DalekJs work
- Use the Jasmine framework
- Interpret feature detection and devise tests specific to cross-browser compatibility
- Integrate jsTestDriver with Eclipse and run tests with jsTestDriver
- Explore re-factoring, adding and notifying observers
- Understand test-driven development in case of server-side JS
In Detail
Initially, all processing used to happen on the server-side and simple output was the response to web browsers. Nowadays, there are so many JavaScript frameworks and libraries created that help readers to create charts, animations, simulations, and so on. By the time a project finishes or reaches a stable state, so much JavaScript code has already been written that changing and maintaining it further is tedious. Here comes the importance of automated testing and more specifically, developing all that code in a test-driven environment. Test-driven development is a methodology that makes testing the central part of the design process – before writing code developers decide upon the conditions that code must meet to pass a test. The end goal is to help the readers understand the importance and process of using TDD as a part of development.
This book starts with the details about test-driven development, its importance, need, and benefits. Later the book introduces popular tools and frameworks like YUI, Karma, QUnit, DalekJS, JsUnit and goes on to utilize Jasmine, Mocha, Karma for advanced concepts like feature detection, server-side testing, and patterns. We are going to understand, write, and run tests, and further debug our programs. The book concludes with best practices in JavaScript testing. By the end of the book, the readers will know why they should test, how to do it most efficiently, and will have a number of versatile tests (and methods for devising new tests) to get to work immediately.
Style and approach
Easy-to-follow guide with suitable examples for developing JavaScript code in the test-Driven environment, with popular tools and frameworks. User experience and statements are also included to help readers make a better choice of tool for real-world projects.
商品描述(中文翻譯)
學習使用流行框架和工具進行 JavaScript 測試驅動開發
本書介紹
- 了解 TDD 的生命週期及其在實際應用中的重要性
- 獲取有關流行工具的知識,分析其特性、語法以及如何幫助 JavaScript 測試
- 使用實用的程式碼範例實作測試驅動編程練習
本書適合誰閱讀
如果您對 HTML、CSS 和 JavaScript 具有中級知識,並希望了解為什麼測試驅動開發方法對您的作業更有利,那麼這本書適合您。
您將學到什麼
- 基本的 TDD 基礎知識、生命週期和好處
- 熟悉單元測試的概念和要素,並為 JavaScript 編寫基本的單元測試
- 了解 JsUnit、Qunit、Karma 和 DalekJs 的運作方式
- 使用 Jasmine 框架
- 解釋特徵檢測並設計特定於跨瀏覽器相容性的測試
- 將 jsTestDriver 與 Eclipse 整合,並使用 jsTestDriver 執行測試
- 探索重構、添加和通知觀察者
- 了解伺服器端 JavaScript 的測試驅動開發
詳細內容
最初,所有處理都發生在伺服器端,簡單的輸出是對網頁瀏覽器的回應。如今,已經創建了許多 JavaScript 框架和庫,幫助讀者創建圖表、動畫、模擬等。當一個項目完成或達到穩定狀態時,已經編寫了大量的 JavaScript 代碼,進一步更改和維護變得繁瑣。這就是自動化測試的重要性,尤其是在測試驅動環境中開發所有代碼。測試驅動開發是一種方法論,使測試成為設計過程的核心部分——在編寫代碼之前,開發人員決定代碼必須滿足的條件以通過測試。最終目標是幫助讀者理解使用 TDD 作為開發一部分的重要性和過程。
本書從測試驅動開發的詳細信息開始,介紹其重要性、需求和好處。隨後,本書介紹了流行的工具和框架,如 YUI、Karma、QUnit、DalekJS、JsUnit,並進一步利用 Jasmine、Mocha、Karma 來探討特徵檢測、伺服器端測試和模式等進階概念。我們將理解、編寫和運行測試,並進一步調試我們的程序。本書以 JavaScript 測試的最佳實踐作結。到本書結束時,讀者將知道為什麼應該進行測試,如何以最有效的方式進行測試,並擁有多種多樣的測試(以及設計新測試的方法)以立即開始工作。
風格與方法
易於跟隨的指南,提供適合在測試驅動環境中開發 JavaScript 代碼的範例,並使用流行的工具和框架。還包括用戶體驗和聲明,以幫助讀者為實際項目做出更好的工具選擇。