Task: Implement the Solution |
Produce an implementation for part of the design (such as a class, scenario, or database entity), or fix a defect. Perform basic testing on the new code. The result is new or modified source code and data files.
Disciplines: Development
Purpose
To transform a small piece of the existing design into a tested implementation that's ready to be integrated into the system.
Relationships
Roles | Primary Performer: Developer | Additional Performers:
Inputs | Mandatory: Code Analysis Guidelines [Technical Implementation] Code Analysis Guidelines Developer Test Implementation | Optional: None
Outputs | Developer Test Implementation Test Log
Steps
Understand the task or problem
Be clear on the scope, as specified in work assignments, requirements, and change requests. An implementation task can be focused on achieving some specific functionality (such as implementing a scenario or fixing a defect) that involves implementing several design elements that contribute to that functionality. Alternatively, an implementation task can be focused on adding an incremental amount of functionality (such as a new parameter or an extension to a method) to a particular design element such as a class or subsystem.
Prepare the development workspace
Ensure the development workspace is correctly configured so the right element versions are available. This includes the elements to be updated and any dependent or supporting elements required for compilation and unit testing. Be aware of the project's configuration and change management procedures and how code is delivered for integration. See Concept: Development and Integration Workspaces for more information.
Identify opportunities for reuse
Identify existing code or other implementation elements that can be reused in the portion of the implementation that you are creating or changing. A comprehensive understanding of the overall design is helpful, because it is best to leverage reuse opportunities when you have a thorough understanding of the proposed solution.
Transform design to implementation
If you are using sophisticated modeling tools, you should be able to generate a portion of the required source code from the model. Programming is commonly required to complete the implementation after the design model has been transformed into code. Even without tools, there is typically some amount of code that can be created by rote by examining the design and developer tests See Guideline: Mapping from Design to Code for information on how to create the implementation from the design.
Write source code
Write the source code to make the implementation conform to the design and expected behavior. You should strive to reuse and/or generate code wherever possible, but you will still need to do some programming. To do so, consider the following: Examine the technical requirements. Because some requirement information does not translate directly into your design you should examine the requirement(s) to ensure that they are fully realized in the implementation. Refactor your code to improve its design. Refactoring is a technique where you improve the quality of your code via small, safe changes. Tune the results of the existing implementation by improving performance, the user interface, security, and other nonfunctional areas. Add missing details, such as completing the logic of operations or adding supporting classes and data structures Handle boundary conditions. Deal with unusual circumstances or error states. Restrict behavior (preventing users or client code from executing illegal flows, scenarios, or combinations of options). Add critical sections for multi-threaded or re-entrant code.
Test new code
Write small tests to verify the new code. This white-box testing is performed while implementing the code and prior to unit testing (black-box). Define the expected results and write the test logic. Put the system in a known state, run the tests, and check the test log to verify you've received the expected results. Fix the code until the test runs successfully. An automated testing environment or regression testing tool is the best way to quickly create and run these tests. In addition, these tests can be re-used during unit testing. See Concept: Developer Testing for more information.
Complete the implementation
Tune the code to perfect the implementation by improving performance, refining the user interface, etc. Apply refactoring techniques to make the code more understandable, reusable, and maintainable. See Concept: Refactoring and Guideline: Refactoring for more information. The white-box tests must be re-run after tuning and refactoring to assure the new code still works. Fix any errors introduced by tuning and refactoring.
Evaluate the implementation
Verify that the implementation is fit for its purpose. Examine the code for its suitability to perform its intended function. This is a quality assurance step that you perform in addition to testing which is described in other tasks. See Guideline: Verify the Implementation for some strategies. Improve the implementation based on the results of these evaluations.
Communicate significant decisions
Communicate the impact of unexpected changes to the design and requirements. The issues and constraints that you uncover when you implement the system must be communicated to the team. The impact of issues discovered during implementation must be incorporated into future decisions. If appropriate, update requirements to reflect ambiguities that you identified and resolved in the implementation so they can be tested and you can manage stakeholder expectations appropriately. Similarly, update the design to reflect new constraints and issues uncovered during implementation to be sure that the new information is communicated to other developers. Usually, there is no need for a change request if the required change is small and the same person is designing and implementing the code element. That individual can make the design change directly. If the required change has a broad impact, it may be necessary to communicate that change to the other team members through a change request.
Key Considerations
Implement incrementally. Take a small piece of the task to be performed, such as a new parameter or a small piece of a method, and implement it. When all tests run successfully, move on to the next small piece of the task. This is a low-risk approach that reduces the number of regression errors introduced into the code. The [Project Work] is implicitly used in implementation tasks to manage which requirements or change requests are being realized in the code. The developer must be aware of and follow the code analysis guidelines while creating the implementation. This includes programming guidelines and language specific guidelines. See Artifact: Code Analysis Guidelines.
More Information
Concepts | Coding Standard Developer Testing Development and Integration Workspaces Refactoring Stubs
Guidelines | Developer Testing Mapping from Design to Code Refactoring Verify the Implementation Writing White-box Tests
© Copyright IBM Corp. 1987, 2009. All Rights Reserved.