Home > Store > Open Source > Ajax & JavaScript

larger cover

Add To My Wish List

Test-Driven JavaScript Development

Register your product to gain access to bonus material or receive a coupon.

  • Description
  • Extras
  • Reviews
  • Sample Content

Product Author Bios

Christian Johansen works for Shortcut AS, a software company focusing on open source technology, Web, and mobile applications. Originally a student in informatics, mathematics, and digital signal processing, he has spent his professional career specializing in Web and front-end development with technologies such as JavaScript, CSS, and HTML. His clients include many of Norway’s largest financial, telecom, and healthcare companies. A frequent open source contributor, he blogs about JavaScript, Ruby, and Web development at cjohansen.no/en.

For JavaScript developers working on increasingly large and complex projects, effective automated testing is crucial to success. Test-Driven JavaScript Development is a complete, best-practice guide to agile JavaScript testing and quality assurance with the test-driven development (TDD) methodology. Leading agile JavaScript developer Christian Johansen covers all aspects of applying state-of-the-art automated testing in JavaScript environments, walking readers through the entire development lifecycle, from project launch to application deployment, and beyond.

Using real-life examples driven by unit tests, Johansen shows how to use TDD to gain greater confidence in your code base, so you can fearlessly refactor and build more robust, maintainable, and reliable JavaScript code at lower cost. Throughout, he addresses crucial issues ranging from code design to performance optimization, offering realistic solutions for developers, QA specialists, and testers.

Coverage includes
•    Understanding automated testing and TDD
•    Building effective automated testing workflows
•    Testing code for both browsers and servers (using Node.js)
•    Using TDD to build cleaner APIs, better modularized code, and more robust software
•    Writing testable code
•    Using test stubs and mocks to test units in isolation
•    Continuously improving code through refactoring
•    Walking through the construction and automated testing of fully functional software

The accompanying Web site, tddjs.com, contains all of the book’s code listings and additional resources.

Author's Site

Please visit the following companion pages:

tddjs.com
cjohansen.no/en

Customer Reviews

13 of 13 people found the following review helpful
5.0 out of 5 stars A great source for modern Javascript practices, March 9, 2011
By 
P. Hodgson (Santa Cruz, CA United States) - See all my reviews
(REAL NAME)   
This review is from: Test-Driven JavaScript Development (Developer's Library) (Paperback)
I initially picked this up hoping to learn some stuff about the mechanics of unit-testing in javascript, and maybe some stuff about how to organize your javascript in a testable way. I was very pleasantly surprised to find a book which covers way more.

You'll learn about the fundamentals of modern functional javascript. You'll discover that it's not class-based OO and that functions, closures and object literals are your building blocks.

You'll see some neat, slightly mind-bending way of implementing things. A tiny example - why not keep track of whether a stub function has been called by just setting a bool on the stub function itself!

Most of all, you'll see that it's very feasible to develop real grown-up software using a true test-driven-DESIGN approach using javascript. You'll also get the benefit of being walked through a load of deep, hands-on practical examples covering both server-side JS, client-side DOM-based JS. This material can be pretty... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


15 of 17 people found the following review helpful
4.0 out of 5 stars So far so good, November 25, 2010
This review is from: Test-Driven JavaScript Development (Developer's Library) (Paperback)
Unlike the first reviewer I've actually begun reading this book. Based on the first 2.5 chapters I can tell you without reservation that this author is quite knowledgeable about both Javascript and Test-driven development (TDD). Not only is the book technically excellent in this regard, but the author is also not afraid to state his opinion and challenge conventional wisdom, for instance when addressing the oft-misunderstood issue of temporarily hard-coding data to make tests pass. Furthermore, if you have comments or questions about the book in other online forums such as a blog, the author is very quick to respond. Addendum: having pretty much completed the entire book I will add, there is much excellent introductory material regarding Ecmascript 5 included.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


8 of 8 people found the following review helpful
4.0 out of 5 stars Good JavaScript Book, December 3, 2010
This review is from: Test-Driven JavaScript Development (Developer's Library) (Paperback)
I'm a Django web developer, and like most of us, the unit test coverage for my projects ends where the client-side code begins. I found this book to be extremely useful in teaching how to create tests for JavaScript. The book uses JsTestDriver, which I had never heard of before the book, but is an amazing cross-browser test runner.

The book is written in three parts. The first is an overview of TDD, the second covers JavaScript as a programming language, and third talks about how to integrate JavaScript testing into a project. The first part is short, and the third is, naturally, the meat of the book. The second part, which introduces JavaScript, seems superfluous given the intended audience. It's a good refresher, but the third part builds upon the second one, so part two can't be skipped. It would have been great if the second and third parts would have been more decoupled.

Besides that, is there any web developer that wouldn't benefit from learning how to... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 18 customer reviews...

Online Sample Chapter

Test-Driven JavaScript Development: Tools of the Trade

Table of Contents

Preface

 

Part I: Test-Driven Development

Chapter 1: Automated Testing

Chapter 2: The Test Driven Development Process

Chapter 3: Tools of the Trade

Chapter 4: Test to Learn

 

Part II: JavaScript for Programmers

Chapter 5: Functions

Chapter 6: Applied Functions and Closures

Chapter 7: Objects and Prototypal Inheritance

Chapter 8: ECMAScript 5th Edition

Chapter 9: Unobtrusive JavaScript

Chapter 10: Feature Detection

 

Part III: Real-World Test Driven Development in JavaScript

Chapter 11: The Observer Pattern

Chapter 12: Abstracting Browser Differences: Ajax

Chapter 13: Streaming Data With Ajax and Comet

Chapter 14: Server-Side JavaScript With Node.js

Chapter 15: TDD and DOM Manipulation: The Chat Client

 

Part IV: Testing Patterns

Chapter 16: Mocking and Stubbing

Chapter 17: Writing Good Unit Tests

 

Index

Sample Pages

Download the sample pages (includes Chapter 3 and Index)

 
Best Value

Book + eBook Bundle  $98.98  $59.39

Book Price: $43.99
eBook Price: $15.40

Buy

This book includes free shipping!

Buy

Book  $54.99  $43.99

Usually ships in 24 hours.

This book includes free shipping!

Buy

eBook (Watermarked)  $43.99  $35.19

About Watermarked eBooks

This PDF will be accessible from your Account page after purchase and requires the free Adobe® Reader® software to read it.

The eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.

Watermarked eBook FAQ

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.