Unit testing
The software developer’s adage of “test, test, and test again” still applies to modern systems but in a more refined way. Instead of testing our systems as a whole, we focus on small components of our code to ensure that they perform efficiently and as expected. These components are referred to as units. When we isolate units of code, we can more easily detect bugs and improve the overall quality of our code. This approach is referred to as unit testing and is the focus of this section.
Unit testing
Unit testing is an approach to software testing that involves testing the smallest sections of a system’s code to ensure that it performs correctly and efficiently in isolation.
The primary benefits of unit testing include the following:
- Bug detection: Unit testing enables us to detect bugs early, before the code is published as part of the larger system.
- Code quality: This testing approach, with its finite focus, results in...