[Pharo-project] Good reference on time on unit testing?

laurent laffont laurent.laffont at gmail.com
Sun Feb 27 18:03:09 CET 2011


On Sun, Feb 27, 2011 at 5:35 PM, Schwab,Wilhelm K <bschwab at anest.ufl.edu>wrote:

> Laurent,
>
> *I* get it - my audience does not.
>


:)

What I've learned:
- people think it will take time to write tests because they don't know what
is testing, they don't know what is TDD, because it's hard (yes, it's
hard).
- showing them your fully tested project, 100% test coverage, happy customer
is not enough (but can help to bring confidence)
- showing statistics rarely works (may be for your boss, but not developers)
- buying them good books can help, but for example here in France it's hard:
developers rarely read, even less when the book is technical, even less if
it's for their work,  even less if written in english (and only one book
about TDD in French :)

What have worked for me:
- the best (by far) is pair programming: but hard to convince people to do
pair-programming - except when you are the manager of your team. So you can
pair-program with every member and do TDD with them.
- regular internal coding-dojo (randori mode is better): easy acceptance.
But that doesn't mean people will test when alone. So it have to be often
(every week).
- reading group (as described in Pragmatic Thinking and Learning - Andrew
Hunt): take a book, a copy for each developer. Each week (or more often if
possible) meet for 1 hour and do the summary of last read chapter, discuss,
see how it can be applied.

It seems that to spread an idea / practice, we have to help and do things
together (see Your brain at work - David Rock)

Hope it can help.

Laurent.




>
> Bill
>
>
>
>
> ________________________________________
> From: laurent laffont [laurent.laffont at gmail.com]
> Sent: Sunday, February 27, 2011 10:19 AM
> To: Pharo-project at lists.gforge.inria.fr
> Cc: Schwab,Wilhelm K
> Subject: Re: [Pharo-project] Good reference on time on unit testing?
>
> On Sun, Feb 27, 2011 at 2:12 PM, Schwab,Wilhelm K <bschwab at anest.ufl.edu
> <mailto:bschwab at anest.ufl.edu>> wrote:
> Understood.  But, doing it correctly, how much of your time do you spend on
> the test writing/maintenance side?
>
> None. Seriously none. I never pause and say "OK now it's time to write
> tests and maintain existing ones". It's part of the TDD cycle: write a test,
> make it green, refactor. write a test, make it green, refactor. The cycle
> can go from 1mn to 10mn, rarely more.  And if you use the Pomodoro
> technique, you feel it even better. Test writing/maintenance is part of
> programming.
>
> Sometimes you can say "OK before implementing this new story, I would like
> to refactor here and here (tests + code) because I don't like it". We also
> do this stuff on legacy code when tests are not here. But it's far easier
>  when we have good test coverage.
>
>
> I found some blog posts, but I was hoping for some peer-reviewed papers
> that go on the record.
>
> I am trying to make the point you are making, and it will go over better if
> I can point to literature and some numbers that I suspect will be seen as
> sobering.  Tests ARE being "written after" in this case, but assuming they
> change to a proper process, they still need to understand that tests take
> thought and work.
>
>
> When tests are written after, it's another kind of story. Then "how much
> time we should spend writing test" is valid. I don't have any answer.
>
> TDD is not easy. Learning to write good tests takes time (years),
> investment. If someone in your team have good experience with it, he should
> pair program continuously with other programmers.  Participating in
> coding-dojo , code retreats with experienced developers is great too.
>
> Laurent.
>
>
>
>
>
> ________________________________________
> From: pharo-project-bounces at lists.gforge.inria.fr<mailto:
> pharo-project-bounces at lists.gforge.inria.fr> [
> pharo-project-bounces at lists.gforge.inria.fr<mailto:
> pharo-project-bounces at lists.gforge.inria.fr>] On Behalf Of Peter
> Hugosson-Miller [oldmanlink at gmail.com<mailto:oldmanlink at gmail.com>]
> Sent: Sunday, February 27, 2011 2:58 AM
> To: Pharo-project at lists.gforge.inria.fr<mailto:
> Pharo-project at lists.gforge.inria.fr>
> Subject: Re: [Pharo-project] Good reference on time on unit testing?
>
> +100
>
> Couldn't have said it better myself!
>
> --
> Cheers,
> Peter.
>
> On 27 feb 2011, at 08:27, laurent laffont <laurent.laffont at gmail.com
> <mailto:laurent.laffont at gmail.com><mailto:laurent.laffont at gmail.com
> <mailto:laurent.laffont at gmail.com>>> wrote:
>
> On Sun, Feb 27, 2011 at 4:52 AM, Schwab,Wilhelm K <<mailto:
> bschwab at anest.ufl.edu<mailto:bschwab at anest.ufl.edu>>bschwab at anest.ufl.edu
> <mailto:bschwab at anest.ufl.edu><mailto:bschwab at anest.ufl.edu<mailto:
> bschwab at anest.ufl.edu>>> wrote:
> Hello all,
>
> Can anyone recommend a good reference on the amount of time one should
> expect to spend writing tests?  I will have to be the messenger (will be
> wearing running shoes just in case...), but I want the message to come from
> a solid source.
>
> If you develop the TDD way (which I always do at work) then I would say
> this question is not valid. Your production code will be there because of
> tests. In legacy system, new and refactored code will be there because of
> tests.
>
> IMHO the questions "how much time should I spend writing tests?" or "how
> many tests should I write ?" are raised when tests are written after. And
> sadly tests often become a burden in this case and doesn't support the
> pressure of releases / last minute changes / ...  (I've done it this way
> almost 10 years ago, not good :)
>
> In TDD the question is "which stories / scenarios do we have to implement
> ?". It's more a Product owner / customer point of view.
>
> The best book on TDD I've read is Dave Astels TDD: a practical guide
> (Indeed, this one has really changed my mind on how testing should be done,
> and other books I've read since don't).
>
> Laurent
>
>
>
> Bill
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110227/76adffb6/attachment.htm>


More information about the Pharo-project mailing list