Understanding unit and integration tests
Testing is an essential part of software development since it verifies both that the software is bug-free and that it conforms to the agreed specification. Delaying application testing until immediately after most of the application’s functionalities have been implemented in their entirety must be avoided for the following reasons:
- If a class or module has been incorrectly designed or implemented, it might have already influenced the way other modules were implemented. Therefore, at this point, fixing the problem might have a very high cost.
- The possible combination of input that is needed to test all possible paths that execution can take grows exponentially with the number of modules or classes that are tested together. Thus, for instance, if the execution of a class method
A
can take three different paths, while the execution of another methodB
can take four paths, then testingA
andB
together would require 3 x...