Task Descriptor: Implement Developer Tests
Implement one or more tests that enable the validation of the individual software components through execution.
Based on Method Task:  Implement Developer Tests
Relationships
RolesMain: Additional: Assisting:
InputsMandatory: Optional: External:
  • None
Outputs
Steps
Refine scope and identify the test(s)

Select the increment of work to be tested and identify test(s) to verify that the code being developed for it behaves correctly.  It is best to do this at a small scale, much smaller than the complete code base to be authored by a developer over the course of an iteration.  This can be done for one operation, one field added to a user interface, one stored procedure, etc.

Write the test setup

Describe the setup that must be done before running each test.

To successfully run a test, the system must be in a known state. 

Write the test logic
Write the steps that performs the test(s).  For the sake of repeatability and support for regression testing, it is highly desirable that the test steps be automated code.
Define the expected results

Define the expected results of each test so that it can be verified.

After a test runs, you need to be able to compare the results of running the test against what was expected to happen.  The test is successful when the actual results match the expected results.  As with other facets of developer tests, this verification of results is best automated.

Define the test response
Define the information the test(s) must produce to successfully indicate failure.  Consider if a response of True or False sufficient, or if a detailed message should be logged as well.
Write clean-up code
Identify, and then implement, the steps to be followed in order to restore the environment to the original state.  The goal is to ensure that there are no side effects from running the test(s).
Test the test

Verify that each test works correctly.

Check the setup.   Run the test, observe its behavior, and fix any defects. In particular, ensure that the expected results are defined properly and that they're being checked correctly.  Check the clean-up. 

If a test framework is being used to manage a suite of unit tests, ensure the unit test works within the framework.

Properties
Predecessor
Multiple Occurrences
Event-Driven
Ongoing
Optional
Planned
Repeatable