Summary

If you want to build robust applications with minimum defects, you should test your code. Even if you are very good at coding, sometimes you may forget a validation or break a dependency and won't know about it until the final user of your application finds the bug.

As a professional developer, you should make sure that your code is always ready for production; one way to successfully do it is to run tests in your development workflow. Another benefit of testing applications is that you will gain confidence in your code, which means that you can improve your code without the fear of breaking something accidentally.

In Backbone, testing depends on the responsibility of the object that you are testing. Models, views, controllers, and facades ...

Get Mastering Backbone.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.