Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Paying Money for Quality (and software testing)

telford@xxxxxxxxxxx wrote:

> Hash: SHA1
> With regards to last night's Slug meeting and using automated testing,
> I think everyone agrees that writing (and using) test cases produces
> higher quality code with less bugs. My point is that higher quality 
> output doesn't come for free,

The position that Robert, Peter Miller and I were standing behind was 
that for a given input of time and effort, writing and maintaining tests 
in conjunction with the code will produce more code and less bugs than
coding without tests. In other words, test driven development, is an
investment. A small amount of effort to add tests pays back that
investment almost immediately and goes on paying dividends a long time
after the initial cost has been paid back.

Your argument is along the lines of "I'll save a whole bunch of money
by living in rented houses for the rest of my life instead of buying 
one". It ignores the fact that tax free capital gains on a house you 
live in and own will put you in a far better economic position in the 
long term.

I will admit that your cheapo no-testing approach might work for 
one-off knockups in Perl that get thrown away 2 weeks after they 
are written. However most code has a useful life that is 
significantly more than 2 weeks. In addition a lot of code that 
starts off as something that is designed to be used for 2 weeks 
and then thrown away doesn't get thrown away and is often being 
used (and bug fixed and extended) years after the initial intended 
throw away date.

Once code is being used beyond 2 weeks and has more than one user
that code will generate bug reports and feature requests. Fixing
bugs is difficult without an existing test suite. Adding features
without a test suite can often break existing working code (this
has a name, regression). Breaking existing working code causes 
more debugging.

Its also interesting that you hold a contrary view to people like
Peter and Rob. Rob has worked on Squid, Cygwin, GNU Arch, Baz, 
Bzr and probably a whole bunch of other stuff. As for Peter, this 
article published in 2000 has Peter Miller as being listed as the 
10th highest contributor of Free Software in the world at the 


Peter will be the first to say that this is slightly skewed because 
code assigned to the FSF was not attributed to the individual authors 
(the "written by" practice arose after this article was published) but
its still a damn impressive achievement.

However, Peter would also say that the only reason he has been able
to write so much code is because he used test driven development.
In other words, disregarding quality, there is a positive correlation 
between testing and quantity of code produced. I would also posit 
that there is a positive correlation between quantity of code and
the cost of producing that code (more code costs more money). 
Connecting the dots here and we have "test driven development costs
less money in the long term".

My contributions are obviously nowhere near Peter or Rob's, but I've
been doing test driven development for at least 7 years. I started
before XP became fashionable. I do it because it makes my life easier 
and my coding time more productive.

So Rob, Peter and I are saying that based on our experience test 
driven development produces more code with less bugs than development 
done in the absence of repeatable, automated testing.

It should also be easy to prove by now that either Rob or Peter
has written more code than you, or anyone you can name that swears
off test driven developement. We say that (as long as you ignore 
genuine knockoffs with only one user) based on our experience, with 
all other things being equal, test driven development costs less.

Don't you think we may be right?


PS : Was this a troll?
  Erik de Castro Lopo
C++ : an octopus made by nailing extra legs onto a dog.