WikiLens Envelope/Quill IntroducingTestUpFront

- Last edited August 8, 2001
For an existing code base: with Junit, its easy to add a test for every bug fix or enhancement you make. Pretty soon you'll have all the test support classes you need.

For an existing team, introducing test up-front can be fun. So someone in your team has written some classes without auto unit tests. What to do?

1. PaulS suggests pairing with them to write all the missing tests, take one method at a time and find a test to write. Resist the temptation to refactor or change any code (see FearFactor).

2. When your partner is comfortable all the tests cover all the paths through the code, version the lot. Then why not try deleting something you spot - remove an untested try-catch block, or "b" in "if a or b" where only "a" is tested! Run the tests - you may need to add a test or two!


This is brought to you by the PaulSimmonsSchoolOfXPStealth
I teach my customers how to dance the "Pelrine Two-Step". Take one step up, and two steps back. For each new bit of functionality you write, do the test first. Since each new bit of functioinality normally touches (at least) 2 existing functions, write tests for these too. This way, you sort of roll 'em up from behind. JosephP
- Last edited August 8, 2001

https://casino-brain.com/