Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When writing code and developing software, one of the most important aspects to keep in mind is, "How am I going to test this?" The testability of software (another way of saying how easily the software can be tested), is an important consideration that most software developers forget. If testability is considered from the first line of code, then the testing efficiency and the quality of the software are greatly increased.
To achieve a testable application, you need to be in the mindset of thinking about testing when it comes to writing the code. Whether the code is about new functionality or fixing a bug, you should always be writing tests to reflect the changes. When in this mindset, the process of writing a test and writing code becomes a natural combination of activities. This mindset sometimes requires that you take a step back from your code and consider the effect that the change will have on your code and its overall structure and testability.