[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] CONTRIBUTE - writing tests for understanding internals

From: Andreas Röhler
Subject: Re: [PATCH] CONTRIBUTE - writing tests for understanding internals
Date: Thu, 12 Nov 2015 21:40:49 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100915 Thunderbird/3.1.4

 On 12.11.2015 21:03, Stephen Leake wrote:
Eli Zaretskii<address@hidden>  writes:

Date: Thu, 12 Nov 2015 08:16:47 +0100
From: Andreas Röhler<address@hidden>
CC: Eli Zaretskii<address@hidden>

   On 11.11.2015 16:40, Eli Zaretskii wrote:
[ ... ]
written by someone who is not the implementor.  I'm sure you are
familiar with the TDD methodology, whose strong point is precisely
that you write tests before implementing anything.
Hmm, looks for me like TDD established a kind of religion too.
How to write tests without knowing the types?
The API should be defined when you write the tests, but the
implementation doesn't yet exist.
I use this style of development myself.

In reality, after you get started, the tests evolve along with the code.
But for every change, you change the tests first.

Often, after a change is implemented, it affects other tests that you
did not change. Then you have to decide whether that is ok, and fix the
tests to match, or if the code needs to be changed more to preserve the
previous behavior.

I have lots of commits of tests in my NASA code that say "match code


After all, might it be more effective to do everything with tests in mind, but be carefully, kind of lazy, when investing into?

Well, there is still another thing with TDD: it's irrational by its definition. Tests drive nothing, whilst their results come from behind.
Tests luck direction and decision, which must precede them.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]