MSF for CMMI Process Improvement Visual Studio Team System logo

Activity:

Write or Update a Unit Test (CMMI Level 3 : VER 1.3 )

Participating Roles

Responsible:

Developer

Overview

Entry Criteria

  • The bug work item is marked <TBD: state and reason upon exit from previous activity>.
  • The task work item is marked <TBD: state and reason values>.

Sub-Activities

1

Identify 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.

2

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.

3

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.

Exit Criteria

The unit test is written and validated.

(C) 2005 Microsoft Corporation. All rights reserved.

MSF for CMMI Process Improvement: Build 050707