[LRUG] TDD (was: Ruby Contracting)

Mark Coleman mark at breakthrough-workshop.com
Thu Feb 19 07:15:12 PST 2009


I don't know what your job description is, or any details about your  
work environment, so I'll steer clear of that and talk about my own  
experience only:
For 95% of my work as a software developer, I'd say that if I thought  
my job was just to write code, I'd be doing it wrong. Generally what I  
should be doing is delivering a system that meets specific  
requirements that are either in my own head or have been more formally  
described by a business owner.
Writing the code has always been quite a small part of that process.
The ideas behind TDD/BDD have been around for a long time. 20 years  
ago people were writing pre- and post- conditions for code in an  
attempt to both more formally specify what the code was supposed to  
do, and test whether it was doing it right.
Most of the changes in the past couple of years have been more about  
getting people to think about the concepts in a more rigourous way,  
and formalising a process of specification driven development. If your  
tests are also your specifications, then you can better ensure that  
you have met them.
In a lot of small projects you can get away with starting with a blank  
page and coding until it 'feels right', but I'd argue that it really  
doesn't take long before more rigourously defining what you are trying  
to achieve before you start is going to be beneficial.

Just my 2p's worth on the discussion. I'm replying to this particular  
message because it seemed like a good kick off point, but if it seems  
that I'm putting words in your month, I'm probably just talking in  
generalities :)

Except for this:
> Usually it doesn't need testing as it attempts to be clear and  
> concise which Ruby
> is good at (I like code that fits on one sheet of paper).
This I disagree with completely! Code can look nice, can be short, can  
look nice and be short, and still be wrong. It does need testing!


On 19 Feb 2009, at 11:01, Romek wrote:

> I write code. I write code that needs testing (not tests). Usually it
> doesn't need testing as it attempts to be clear and concise which Ruby
> is good at (I like code that fits on one sheet of paper).
>
> Why should I write tests that need code? Seems absurd to me. I have
> and still don't get this TDD and am glad that I have nothing to do
> with it.
>
> To me writing tests for code is like having a chicken and trying to
> design an egg that fits. To me this is just constricting the code to
> do exactly what the tests require. This is very good for formal
> specifications when everything is correct and doesn't change. I prefer
> designing the egg to fit the chicken when you can have all the glory
> of discovering what strange breeds you can evolve from letting the egg
> just hatch.
>
> Romek



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20090219/19f79f3d/attachment-0003.html>


More information about the Chat mailing list