Write Code

(Activity) for Tier: Sprint

PURPOSE

Writing code enables the project team to create new code solutions, or make changes to existing solutions, necessary to implement agreed upon specifications. The guidance within this activity helps ensure the necessary steps are taken to advance our software solutions and meet our customer’s needs.

WHEN

Once development tasks have been assigned for action.

PARTICIPATING ROLES

ENTRY CRITERIA

  • Active development tasks describing the work to be done have been assigned to a Developer.
  • A requirement to be implemented and/or a bug to be fixed has been designated for work.
  • Project engineering guidelines have been defined.

SUB-ACTIVITIES

  1. Get Code

    • Retrieve a relevant code set, usually the latest, and run existing tests to ensure a stable starting point. An earlier code set may be necessary to reproduce bugs.
  2. Write Unit & Automated Tests

    • Write or update unit tests that cover the code written for the development tasks. Unit tests must be included, or justification given for the code review to pass. Unit tests target the smallest testable part of the software, using test doubles as code dependencies to produce tests that run-in seconds or fractions of a second.
    • Create additional automated tests as designated by the solution architecture and engineering guidelines.
    • For bugs, write an automated test to reproduce the bug. The tests will initially fail. When the tests pass, the functionality is implemented.
    • It may be desirable to brainstorm and define test operations for a given group of related functionalities but to implement them one at a time.
    • All external interfaces must have development test coverage. The team may determine the appropriate level of test coverage within their Engineering Guidelines for non-external interfaces.

    Note

    Automated Tests can be written before functionality as done in Test Driven Development (TDD) or after code is written but must be included in the Code Review.

  3. Implement or Correct Functionality

    • Write code in accordance with the team’s Engineering Guidelines to implement the functionality and pass the previously designed test(s).
    • When working with bugs, address the root cause to ensure the bug doesn’t re-occur and the functionality meets the intent of the requirement.
  4. Refactor Code

    • Refactor the code to improve its design, testing along the way.
    • Ensure the test(s) pass after each refactoring.
    • Continue until the code meets the project’s engineering guidelines.
  5. Database Development Considerations

    • Database development is a subset of writing code. Writing automated unit tests is encouraged for SQL database development work. Database work products must be versioned in source control. The default unit of work for developers is the User Story and database development work should be isolated and aligned to the user story. (User story being a general term and not a type of work item template in any specific application.) Database architecture should support each developer running a local copy of the database for database or application development work. Database work should follow Engineering Guidelines.

EXIT CRITERIA

  • Code ready for review
  • Unit Tests coverage includes changed code
  • All Automated Tests pass

NEXT ACTIVITY

Review Code

SEE ALSO

Process Guidance Version: 10.4