14. junit test case
import junit.framework.TestCase;
public class TestMath extends TestCase
{
public void testSquare() {
assertEquals(16, Math.square(4));
}
}
19. forces better design
separate presentation from business logic
from data access!
“mock” out what your not testing
fake data access class when testing
business logic
43. key steps to start
1) unit test
on all new code
●
when you find a bug in existing code
●
work towards 100% branch coverage
●
2) automate your build, test every commit
44. est finis
slides at jhcore.com
write at least 1 unit test next time you code
get your test on!