Testable JavaScript Front Cover

Testable JavaScript

  • Length: 274 pages
  • Edition: 1
  • Publisher:
  • Publication Date: 2013-01-31
  • ISBN-10: 1449323391
  • ISBN-13: 9781449323394
  • Sales Rank: #914813 (See Top 100 Books)
Description

One skill that’s essential for any professional JavaScript developer is the ability to write testable code. This book shows you what writing and maintaining testable JavaScript for the client- or server-side actually entails, whether you’re creating a new application or rewriting legacy code.

From methods to reduce code complexity to unit testing, code coverage, debugging, and automation, you’ll learn a holistic approach for writing JavaScript code that you and your colleagues can easily fix and maintain going forward. Testing JavaScript code is complicated. This book helps you simply the process considerably.

  • Get an overview of Agile, test-driven development, and behavior-driven development
  • Use patterns from static languages and standards-based JavaScript to reduce code complexity
  • Learn the advantages of event-based architectures, including modularity, loose coupling, and reusability
  • Explore tools for writing and running unit tests at the functional and application level
  • Generate code coverage to measure the scope and effectiveness of your tests
  • Conduct integration, performance, and load testing, using Selenium or CasperJS
  • Use tools for in-browser, Node.js, mobile, and production debugging
  • Understand what, when, and how to automate your development processes

Q&A with Mark Ethan Trostler, author of “Testable JavaScript”

Mark Ethan Trostler

Q. Why is your book timely– what makes it important right now?

A. The rise of mobile is well documented. The only thing that all of these mobile devices have in common, not only with themselves but also their bigger desktop brethren, is a browser. The only language available in all of those environments is JavaScript. Now, with the rise of server-side JavaScript, it may well be the only language that developers need for their increasingly complex applications.

From the deepest darkest recesses of the server to the bright light of day on a mobile device, laptop, or desktop– JavaScript is ubiquitous. Yet JavaScript is also a relative newcomer, especially on the server side. The toolchain-available ability to write, test, and deploy enterprise-scale (or any-scale) JavaScript-based applications is still in its infancy. In this fast-moving, constantly changing landscape it is more important than ever to understand the best practices surrounding how to structure, code, test, and deploy your JavaScript applications.

“Testable JavaScript” is at the forefront of this movement demonstrating how to craft, test, and deploy testable and maintainable JavaScript running on the complete stack from server to client (and back).

Q. What information do you hope that readers of your book will walk away with?

A. Readers will recognize that the lessons they have learned from previous experiences with other language translate well to JavaScript– albeit with several twists and turns.

<p<>After gaining a better appreciation for the myriad of environments within which JavaScript must run, and then having wrapped their heads around code complexity as it relates to JavaScript specifically, readers will see concrete examples of how their JavaScript can get into trouble, followed by tips and honest advice how to extricate their code from those pitfalls.

Readers will see not only how to write code that is testable but also how exactly to test it– from unit tests to integration tests to performance testing and beyond. Readers will get a first-hand look at how to generate code coverage for all of their JavaScript tests, both at the unit and integration test levels.

Finally, readers will learn how to make all of the above automatic in several different environments, whether running tests on the command line, in a headless browser, or in a real

Q. What’s the most exciting/important thing happening in your space?

A. The rise of server-side JavaScript via NodeJS and Rhino is the most exciting development in the JavaScript world. Allowing developers to code their entire app in a single language is a giant boon for productivity. JavaScript is a “hot” language right now, not only is there tons of work being done on the server-side– the number of open source third-party modules is growing exponentially– but client-side JavaScript frameworks are also proliferating like weeds. There are a huge number of “framework” libraries available that are very actively being developed, not to mention that the language itself is also under heavy development.

Finally, browser vendors are far from standing still; there are a huge number of newly standardized and almost-standardized features being rolled out constantly in all major browsers for JavaScript developers to start taking advantage of.

There has never been a better time to be a JavaScript developer.

To access the link, solve the captcha.