MSF for Agile Software Development Visual Studio 2005 Team System logo

Activity:

Perform a Database Unit Test

Participating Roles

Responsible:

Database Developer

Overview

Entry Criteria

  • The code for the database development task is complete.

Sub-Activities

1

Identify Database Unit Test Scope

  • Identify the types of database 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.
  • Select the number and types of database unit tests needed to appropriately exercise the new or existing schema objects that are being added or modified.

2

Create or Update Associated Data Generation Plan

  • Add a new data generation plan to the project if it does not exist.
  • Ensure the data generation plan is configured to generate data for the tables associated with the development task.
  • Appropriately configure generators for any table columns newly included in the data generation plan.
  • Update existing table column generator assignments and properties if the schema has changed.

3

Write or Update a Database Unit Test

  • Write new database unit tests to exercise the associated schema objects under test.
  • Update existing database unit test for behavior changes implemented as part of this development task.

4

Perform the Database Unit Test

  • Ensure the database unit test execution is configured appropriately.
  • Execute the appropriate database unit tests.

5

Analyze Test Results

  • If the test fails because the test was written incorrectly, fix the unit test and run the test on the element under test.
  • If the test fails because the code under test was written incorrectly, fix the code and rerun the test. Do not open a new bug.

6

Debug Code

  • Correct problems introduced when writing code for the task.

7

Perform Application Unit Tests

  • Optional
  • It is often appropriate to run your application unit tests alongside your database unit tests when performing iterative database development tasks. Because the applications will often do significant data access, changes to the database may adversely affect the application tier if not appropriately accounted for. Running your application tests alongside your database tests ensures these issues are found early and often.
  • Execute application unit test suite.
  • Analyze test results. Assign bugs to application code owners, if appropriate.
  • Debug code on test failure.

Exit Criteria

Database unit tests are complete and the code is debugged.

© 2006 Microsoft Corporation. All rights reserved.

Version 4.1.0