Unit testing is a method by which individual pieces of source code are tested to verify that the design and implementation for that unit have been correctly implemented. There are four phases executed in sequence in a unit test case are the following:
- Setup: The test case initializes the test fixture, that is the before picture required for the SUT to exhibit the expected behavior.
- Exercise: The test case interacts with the SUT, getting some outcome from it as a result. The SUT usually queries another component, named the Depended-On Component (DOC).
- Verify: The test case determines whether the expected outcome has been obtained using assertions (also known as predicates).
- Teardown: The test case tears down the test fixture ...