What is unit testing?
Unit testing is a type of software testing where individual units of code are tested to validate whether they are working as they were designed. Unit testing is the first level of software testing, the others being integration testing, system testing, and acceptance testing. A discussion of these types of testing is beyond the scope of this book. Unit testing is typically performed by software developers.
Performing unit testing has important benefits:
- It helps to identify and fix bugs earlier in the development cycle, thereby helping to save time and money.
- It helps developers to better understand the code and allows them to make quick changes to the code base.
- It helps with code reuse by requiring it to be more modular to test it better.
- It can act as project documentation.
- It helps to speed up development because the effort of identifying bugs using various methods of manual testing done by developers is greater than the time spent...