Activity Information Refactor Database Code
DescriptionTo 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. StepsIdentify 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. 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. Build Database Project: Build the database project.
Review and fix any build errors identified. Deploy Database Project to Sandbox Server: Deploy database project to sandbox server.
Ensure deployment is successful by browsing deployed database. 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| WorkProduct | Input | Output | Allowable States |
|---|
| Code | /Wiki%20Pages/images/Input.gif) | /Wiki%20Pages/images/Output.gif) | (none) |
|
Last modified at 1/17/2008 11:18 PM by Administrator
|
|