Thursday, July 22, 2010

Test Driven Development


Five key principle questions must be asked all time:
  1. What Do I Want to Accomplish?
  2. Does It Do What I Want?
  3. Does It Do What I Want All of the Time?
  4. Can I Depend On It?
  5. Does It Document My Intent?
TDD Process Itinerary
  1. Obtains Project Specification Documents to identify specification needs, usually the action from the UML CASE diagram. (What needs to be done?)
  2. Write the test procedures and test methods (Unit Test) to enforce it achieve the specification needs as how it was documented in Project Specification Document. (Does it do what I want?)
  3. Write the code just to pass the test.
  4. Ensure and maintain the tests from never fail at all times. (Does it do what I want at all time and Can I depend on it?)
  5. Re-factor the code for readability and maintainability, while ensure the tests remain intact to the specification. (Does it document my intent?)

Few ways to achieve unit testing: -
  • Dummy
  • Fakes
  • Mocks
  • Stubs
To be continue...

No comments:

Post a Comment