Relax, you'll learn to love it or maybe not...
What does your code need to accomplish?
Design is not wasted time, but writing poorly designed code is.
@Test public void testAdd() { assertEquals(5, SimpleMath.add(2, 3)); } @Test public void testSubtract() { assertEquals( 4, SimpleMath.subtract(42, 38)); }
Let the tool do the busy work for you
public class SimpleMath { public static int add( int a, int b ) { return 0; } public static int subtract( int a, int b ) { return 0; } }
public class SimpleMathTest { @Test public void testAdd() { fail("Not yet implemented"); } @Test public void testSubtract() { fail("Not yet implemented"); } }
public class SimpleMath { public static int add( int a, int b ) { return a + b; } public static int subtract( int a, int b ) { return a - b; } }
Cleanup the code
http://www.agiledata.org/essays/tdd.html http://en.wikipedia.org/wiki/Test-driven_development