Skip to main content

Enterprise MSF Agile (with CobiT)

Go Search
Home
  
Enterprise MSF Agile (with CobiT) > Wiki Pages > Activity - Refactor Database Code (Create a Quality of Service Requirement)  

Activity - Refactor Database Code (Create a Quality of Service Requirement)

Activity Information

Refactor Database Code

Description

To refactor code, complete one change at a time and perform unit tests afterward. This approach minimizes potential code breakage. Use automated refactoring whenever possible as the automated processes are less likely to cause functionality to break. Refactoring is a continuous activity that keeps the code base open to change.

Roles

PerformerDatabase Developer

Steps

  1. Identify Complexity:
    When functionality is added, look for areas of code that increase architectural complexity.

    Identify the appropriate refactoring to reduce the complexity while keeping the semantics of the code the same.

    Identify and run the database unit tests for the area to be refactored.

  2. Apply Refactoring:
    Apply the refactoring, one at a time. Change the code and all the references to the changed area as necessary.

    If methods (stored procedures, functions, triggers) are too complex, it may be necessary to break up a method into a set of new methods.

  3. Build Database Project:
    Build the database project.

    Review and fix any build errors identified.

  4. Deploy Database Project to Sandbox Server:
    Deploy database project to sandbox server.

    Ensure deployment is successful by browsing deployed database.

  5. Perform Database Unit Tests:
    Perform unit tests so the area remains semantically equivalent after the refactoring.


    Fix any nonworking unit tests that have not been correctly updated or refactored.

Inputs and Outputs

WorkProductInputOutputAllowable States
Code(none)

Predecessors

TypeNameDependency Type
Perform a Database Unit TestFinish-Start

Successors

TypeNameDependency Type
Review Database CodeFinish-Start

Last modified at 1/17/2008 11:18 PM  by Administrator