Techniques and Good Practices: Testing
Learn about good testing practices, their advantages, and supporting tools.
We'll cover the following...
It requires discipline to turn good practices into habits. The better these habits are understood, the easier it will be to make any required changes to the system. The more often project members experience the benefits of these practices, the less discipline they will require because the project members will start to naturally follow them. Again, it is very important to have rapid feedback on techniques.
Let’s discuss some good practices and techniques for testing, refactoring, and establishing standards in a project.
Testing
Regardless of a team’s size, it will always benefit from having tests available early on. The most obvious benefit is that the tests, especially the unit tests, provide direct feedback on the design and code.
Advantages
The testing shows immediately if the design and the code work as expected. However, they offer even more advantages:
- The tests are the safety net for every further action. It doesn’t matter if the requirements change, if regular maintenance is required, or if refactoring is necessary, the tests always ensure that the system is still working the way it used to.
- The tests document the code as well as the design. They describe explicitly the interfaces and their different components. The intention of each of the methods is clearly expressed by a corresponding test.
- The tests show how the code should be used and show an example application of each module.