Task: Code and Unit testing
Purpose
  • To specify the design of the system in a way which is precise enough to allow computers to generate efficient processes automatically and clear enough for people to understand during ongoing work and maintenance.
Relationships
RolesPrimary Performer: Additional Performers:
InputsMandatory:
  • None
Optional:
    Outputs
      Steps
      Write Failing Test Case

      When looking at an Engineering Task, you should consider how to add the capability to the system. Does the system require new classes? Are there classes that would be useful? Regardless of how these decisions come out, the addition of functionality requires the creation of a test case. You write the test case to demonstrate that a portion of the functionality you need isn't in the system. This test case should fail.

      Write Code to Make Tests Pass

      When you have a failing test case, you then write only the code that is necessary to satisfy the test case. Test cases should have a very narrow focus. A failing test case may trigger the creation of a new class or method named in the test case, or it may simply require you to add more code to existing classes and methods.

      Illustrations
      More Information