Skip to main content

MSF for CMMI Process Improvement

Go Search
Home
  
MSF for CMMI Process Improvement > Wiki Pages > Activity - Refactor Database Code  

Activity - Refactor Database Code

Activity Information

Refactor Database Code

Description

To refactor database 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

ResponsibleDatabase Developer

Attributes

Element Categories[CMMI Cycle 4] Iteration, [CMMI Track 3] Build, [CMMI Level 3] TS SP 3.1
Entry Criteria
Database Unit Tests Complete:
Database unit tests are complete and the code is debugged.
Exit Criteria
Database Code Refactored:
The database codeĀ is refactored and unit tested.
Is RequiredYes

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.

Predecessors

TypeNameDependency Type
Perform a Database Unit TestFinish-Start

Successors

TypeNameDependency Type
Review Database CodeFinish-Start

Last modified at 12/19/2007 10:37 AM  by Administrator