Any time you start something new you will always have the velocity slower
in the beginning than later on. To me, it's no different than taking a
change from a retrospective and mature it into something that is part of
the day to day operations. Training TDD is important and to get it right.
I've written unit tests since 2004, so 10 years and I've done all kinds of
bad things at the beginning.
I thought testing the things that are working would be great since now I
know it won't break. Unfortunately, those are the parts of the code that
NEVER change and therefore it wasn't important at all to test.
You then try and get to 100% code coverage, but then again you are testing
for things that never change and are probably working. Now, I'm perfectly
aware of contracts by state, federal and international agencies that demand
100% code coverage, so you need to change how you write the code so it
doesn't feel like you are fighting against testing it thoroughly. More
design patterns and follow SOLID principles.
Writing unit tests for legacy code that has strange dependencies are the
worst.
A good book for the developers to read is Working Effectively with Legacy
Code
<https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CFIQFjAA&url=http%3A%2F%2Fwww.amazon.com%2FWorking-Effectively-Legacy-Michael-Feathers%2Fdp%2F0131177052&ei=xi20U8WJIYagyATp0ID4Cg&usg=AFQjCNEq5HkN-DJbjxfJPbXQK0Bl4fbsoQ&sig2=qjr9uvazDbVxg9_H2Bt1aA&bvm=bv.70138588,d.aWw>
by Michael Feathers. It has some good ideas about how to work with changes
to existing code and how to apply test harnesses.
This will force your development team to refactor/change the code and then
make sure that the existing functionality still works. This can easily
slow down a project, but then again, you probably shouldn't have written
the code in that manner anyways.
So if it appears that your team is slow, ask several questions.
- Is it legacy code dependencies making it difficult to test?
Suggestion: Write new code with unit tests in mind and see if you can do a
swap with a new file, code assembly, or even program.
- Is it not knowing WHAT needs to be tested? Suggestion: Go back to
your requirements and make sure you have User Acceptance Testing documented
correctly. There should not be an issue in describing how it should work
between the PO, DEV and QA members. Create Design Sessions if necessary to
make sure everyone knows what is expected before ANY coding and changes are
made.
- Production Support is you bogged down. Suggestion: Various ideas for
this one. I've seen companies have a dedicated team that does nothing but
fight fires while another team fixes them. Fix the issues that are most
critical first (e.g. the system goes down often, fails to restart after a
reboot, performance slows down quickly and then stops)
In all, TDD is not something you gain experience in very quickly. It's not
like making a peanut butter sandwich for lunch. It's more like creating a
menu for an entire restaurant and making sure the delivery of each meal is
perfect each time, every day.