Activity Information Write or Update a Unit Test for Bug Fix
DescriptionUnit tests verify the proper implementation of a unit of code. Writing and performing unit tests identifies bugs before testing begins and therefore helps reduce the cost of quality control. Developers must write unit tests for all code that will be written as part of implementing a development task, or implementing a bug fix. StepsIdentify the Unit Test Scope:
Identify the types of unit tests to be written. Positive unit tests exercise the code as intended and check for the right result. Negative unit tests intentionally misuse the code and check for robustness and appropriate error handling. Fault injection unit tests expose error-handling anomalies. Write or Update the Unit Test:
Write unit tests for the development task covering as much of the functionality as possible.
Use scaffolding and mock objects to maximize the code surface area tested.
If the code has already been written, generate unit tests from the working code. Validate the Unit Test:
Perform a run on the test, making sure the test fails for any element not completed and passes if the element is working as expected.
Correct the portions of the unit test that yield incorrect or ambiguous results.
Inputs and Outputs| WorkProduct | Input | Output | Allowable States |
|---|
| Unit Test |  |  | (none) |
|
Last modified at 12/19/2007 10:37 AM by Administrator
|
|