<Dl> <Dt> 1 . Add a test </Dt> </Dl> <Dt> 1 . Add a test </Dt> <P> In test - driven development, each new feature begins with writing a test . Write a test that defines a function or improvements of a function, which should be very succinct . To write a test, the developer must clearly understand the feature's specification and requirements . The developer can accomplish this through use cases and user stories to cover the requirements and exception conditions, and can write the test in whatever testing framework is appropriate to the software environment . It could be a modified version of an existing test . This is a differentiating feature of test - driven development versus writing unit tests after the code is written: it makes the developer focus on the requirements before writing the code, a subtle but important difference . </P> <Dl> <Dt> 2 . Run all tests and see if the new test fails </Dt> </Dl>

When should the developer test cases be written