I'm currently reading Michael Feathers book: Working Effectively With Legacy Code, and I highly recommend it. In the chapter on TDD and he gave, what I think is a great check list.
0) Yes that's right, step zero. Get the class under test.
1) Write a failing test.
2) Get it to compile.
3) Make it pass.
4) Remove duplication.
5) Repeat.
If managers are asking for estimates be sure to include time for step zero. Easier said than done I know, but you have to sell them on the concept of investing in preventative maintenance. Changing the oil and tuning your car doesn't help you get from A to B, but it will make it cheaper in the long run.
Work With Legacy Code by Michael C Feathers
0) Yes that's right, step zero. Get the class under test.
1) Write a failing test.
2) Get it to compile.
3) Make it pass.
4) Remove duplication.
5) Repeat.
If managers are asking for estimates be sure to include time for step zero. Easier said than done I know, but you have to sell them on the concept of investing in preventative maintenance. Changing the oil and tuning your car doesn't help you get from A to B, but it will make it cheaper in the long run.
Work With Legacy Code by Michael C Feathers
No comments:
Post a Comment