Five key principle questions must be asked all time:
- What Do I Want to Accomplish?
- Does It Do What I Want?
- Does It Do What I Want All of the Time?
- Can I Depend On It?
- Does It Document My Intent?
- Obtains Project Specification Documents to identify specification needs, usually the action from the UML CASE diagram. (What needs to be done?)
- 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?)
- Write the code just to pass the test.
- 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?)
- 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
No comments:
Post a Comment