concept testable code in category angular

appears as: Testable code
AngularJS in Action

This is an excerpt from Manning's book AngularJS in Action.

Testable code makes it easier to sleep at night

Testable code isn’t going to win any awards for being the most exciting feature of a framework, but it’s the unsung hero of any mature framework. AngularJS was written from the ground up to be testable, and likely this feature, along with the design decisions that came from this commitment, has played a huge role in the adoption of AngularJS. How do you actually know if your application works? The fact that it hasn’t broken yet is a flimsy answer, as it’s only a matter of time before that black swan shows up at your door.

You can never entirely mitigate against bugs, but you can truly eliminate certain possibilities through rigorous testing. A framework that is conducive to writing testable code is a framework that you’re going to write tests in. And when you write tests, you’ll spend less time looking over your shoulder wondering when everything is going to come crashing down. You’ll be able to go to bed at night and not have to worry about a 2 a.m. call from DevOps that something has gone awry and you need to fix it immediately.