Unit testing
Unit testing assumes that a program is logically divided into the smallest testable parts (units). The main purpose here is to check that each unit of an application works as it was designed. In object-oriented programming, a unit may be a method that belongs to a public interface of a class.
This approach increases the developer's confidence with regards to the fact that the code works in the right way while the codebase is changing. If unit tests are written correctly and we execute them every time code is changed, we are able to detect a defect. Unit testing also forces us to write reusable code because it can be modular to be tested. Another benefit of this approach is that a tester isn't needed in order to test code.
The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access