Generally speaking, a unit is the smallest testable part of an application. Therefore, unit testing involves testing each of these units individually. Commonly automated, unit testing’s objective is to validate the correct functionality of each unit under isolation. Sometimes, these types of tests can reveal dependencies that are unnecessary and can be eliminated for more efficient code.
This stage of testing lends itself well to quickly finding the root cause of a defect. For example, if you test an application when 5 units are working together and you find a defect, it will take you some time to figure out which unit is the source of the defect. However, if you test each unit while it’s isolated from the rest of the code, the defects found will only be in that unit and are much easier to identify and fix. Unit tests can also help to ensure the performance of code so that slowness doesn’t inadvertently creep in over time.
Defects found in this early stage of development cost nearly nothing to fix, which makes unit testing a great boon for development teams. Additionally, unit tests can be reused over and over, and as such they facilitate inexpensive, continuous software testing. Generally, these tests are run by the developers themselves, but the task can be outsourced. QA Mentor can assist development teams during their validation/verification phase. Our Architecture Inspection Service coincides with unit testing coverage.