Pragmatic eBook 介绍 :Test-Driving JavaScript Applications

JavaScript应用程式的TDD-快速、自信,可维护的程式码


这本书要来打破大家对JavaScript「可测试性」的误解。不论你是用Node.js、Express、MongoDB、jQuery、AngularJS,或是直接操作DOM,都可以透过测试导向来开发JavaScript。在这本书中会介绍Karma、Mocha、Chai,透过这些工具学习如何写出有意义、有效果的自动化测试。测试非同步的JavaScript;解耦合、适当的运用模拟来隔离相依性;衡量程式码覆盖率;让你不论在Server端或Client端都能拿出更优良的模组设计。你在测试上面的投资,会大幅回馈到你的代码,除了让你写出可预期的优良程式码之外,也能能够更有效的面对需求变动。


关于这本书
透过自动化测试来设计JavaScript应用程式。写出有意义的测试,是一项需要经过学习以及大量练习的技能,有时候甚至要强迫自己抛弃以往的习惯;在这本书中,你将磨练这项技能。打开编辑器,跟着书中的练习开始动手做,学习如何有效率的测试,并且设计出好维护、模组化的程序。


一开始先学习何时,以及为什麽要进行测试,不论是手动或是自动。聚焦在测试重要的关键部分,像是前置条件、变数、复杂的逻辑,以及一些边际情境。然后开始透过自动化测试来设计非同步函式。小心的隔离复杂的相依性,并且模拟这些外部资源,例如DOM、GPS的API、档案、数据库存取,甚至是远端服务器的Ajax呼叫。


接着一步一步测试各种平台上的代码,例如Node.js、Express、MongoDB、jQuery、AngularJS。瞭解何时以及如何使用各种测试工具,诸如Chai、Istanbul、Karma、Mocha、Protractor、Sinon等等。透过最少的负担来建立测试案例,并且快速执行这些独立的单元测试,不需要登入服务器,或透过HTML网页在浏览器上执行。最后透过点对点的整合测试来确保所有元件都适当的连结,并且运作顺畅。


不要只是透过想像来创造可测试的代码,动手写出来!


读书前的准备
你只需要:一台电脑,装上文字编辑器,配合你最常用的浏览器,这本书会提供完整的指引,引导你安装建立自动化测试的必要工具


资源

內容
电子书格式有 Mobi, ePub, PDF

本书为英文原文书. 目前是Beta版, 6月将有正式版. 电子书可免费更新版本. 
故一定要到Pragprog.com 注册帐号, 以方便新版更新, 或换新的阅读器时可以重新下载. 

更多Pragmatic Bookshelf 團購中電子書

歡迎參加!  




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"Test-Driving JavaScript Applications: Rapid, Confident, Maintainable Code" English | ISBN: 1680501747 | 2016 | Debunk the myth that JavaScript is not easily testable. Whether you use Node.js, Express, MongoDB, jQuery, AngularJS, or directly manipulate the DOM, you can test-drive JavaScript. Learn the craft of writing meaningful, deterministic automated tests with Karma, Mocha, and Chai. Test asynchronous JavaScript, decouple and properly mock out dependencies, measure code coverage, and create lightweight modular designs of both server-side and client-side code. Your investment in writing tests will pay high dividends as you create code that's predictable and cost-effective to change. Design and code JavaScript applications with automated tests. Writing meaningful tests is a skill that takes learning, some unlearning, and a lot of practice, and with this book, you'll hone that skill. Fire up the editor and get hands-on through practical exercises for effective automated testing and designing maintainable, modular code. Start by learning when and why to do manual testing vs. automated verification. Focus tests on the important things, like the pre-conditions, the invariants, complex logic, and gnarly edge cases. Then begin to design asynchronous functions using automated tests. Carefully decouple and mock out intricate dependencies such as the DOM, geolocation API, file and database access, and Ajax calls to remote servers. Step by step, test code that uses Node.js, Express, MongoDB, jQuery, and AngularJS. Know when and how to use tools such as Chai, Istanbul, Karma, Mocha, Protractor, and Sinon. Create tests with minimum effort and run them fast without having to spin up web servers or manually edit HTML pages to run in browsers. Then explore end-to-end testing to ensure all parts are wired and working well together. Don't just imagine creating testable code, write it. What You Need: A computer with a text editor and your favorite browser. The book provides
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值