views:

151

answers:

7
+4  Q: 

TDD and management

My manager is starting to get pretty annoyed that I'm devoting time to designing tests (he sees testing as something you do after the software is written.). His do I convince him otherwise?

+3  A: 

You cannot win in a situation like this. Until he's taken the blue (tdd) pill) he won't know. Only thing you can do is either leave for a better job, or do it his way. And as you do the latter, explain to him how TDD is a better approach and give him examples. But his way or the highway I'd say.

Preet Sangha
You're a good man, with equally good advice; thanks.
Pierreten
+6  A: 

Tell him that you save time by writing tests now as the test and debugging phases are potentially shorter since you have already caught many of the bugs now.

Matthew Lock
Generally this needs a leap of faith from management, unless concrete examples can be found.
Preet Sangha
+1  A: 

Show him or pass him these links, which would help him understand TDD in clear way.

http://agilepainrelief.com/notesfromatooluser/2008/10/advantages-of-tdd.html

http://www.agiledata.org/essays/tdd.html#TraditionalTesting

Ravia
@Ravia: good links, but only the best sorts of managers will bother reading these - results are much better.
quamrana
@Ravia - Thanks for reading my blog :-)
Mark Levison
+1  A: 

He clearly sees that the testing has to be done. Doing it after writing the code takes just as long as doing it before writing the code. If he likes you can skip writing the test and use the time on writing bugs instead.

If he doesn't think you shpould do testing, then either change his mind or quit.

Jason Williams
+1 for `writing bugs instead`, but writing tests before the code takes less time than after, since you influence the design to be more testable.
quamrana
Perhaps I should have said "at least as long" rather than "just as long".
Jason Williams
"writing bugs instead" - nice, gets my +1
Kildareflare
+2  A: 

The key is to understand your managers point of view. You have to step back and ask what is the manager values and what his/her pain points. If you don't know ask what it is they value.

Mark Levison
A: 

A different route could be to show how doing the tests ahead of time alters the design in some way. That by building out the tests, you are questioning parts of the design and that ultimately this will be a good way to go and that he should check how long maintenance and support take since some of this is being done to improve those areas. Just don't forget to remember some principles like those in How to Win Friends and Influence People that may also be applicable here.

JB King
A: 

At clients that have been resistant to my writing lots of testing, I try to explain things in these terms: Writing tests up front costs me minutes up front but saves me hours near go-live. And at times it costs me hours up front but saves me days near go-live.

Some of the links provided in other answers are also excellent. If the boss still resists after being shown that sort of evidence and argument... I'd polish up my resume. Your ability and willingness to write code the right way should put you in a good position to pick up a less-awful job.

Jim Kiley