Ant /
- Decide what methods will be in your class, then write them as stubs — for example,
- public void doSomething() { }
- public boolean testSomething() { return false; }
- public Object getSomething() { return null; }
- Use your IDE to create the test class, complete with stubs for each test method
- Repeat:
- Write one simple test
- Run it, and check that it fails
- Write just enough code to make it succeed
- Write a harder test, or go on to the next test method
- until all the code is written and tested