Types of unit tests
Unit tests may be automated or manual. Automated approaches are far more common as they are faster and more accurate, but some developers prefer a manual approach.
- White box testing, in which the functional behavior of the code is tested by developers who have written it or are familiar with the code. The purpose of white box testing is to validate execution.
- Black box testing, in which testers who are not privy to the internal functionality of the code test the user interface, inputs, and outputs.
- Gray box testing, a combination of white and black box approaches where testers are partially aware of the functionality of the code.
Unit tests typically have three stages:
- Preparing and reviewing the unit of code
- Making test cases and scripts
- Testing the code