¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Which comes first: design skill or TDD?


 

Hi Mauricio,

You make an interesting point, saying that the JUnit 5 extensibility model "was clearly created by someone
who profoundly understands object-oriented design principles and how to build elegant and flexible APIs.
A non-expert in OOD, even with TDD, wouldn't be able to do it no matter how perfect their TDD sessions were."

So, are you suggesting that TDD __ought__ to do that? Or possibly that some TDD practitioners / apostles
have said it will do that? I'd be interested to know why that point comes up for you.

For myself, I have believed since my first experiences with TDD (ca. 2001) that I never believed TDD could
allow me to do things I don't already know how to do. Possibly more important, the folks I learned from (Jeffries,
Beck, Cunningham) never downplayed the need for deep understanding in developing truly elegant and flexible
software. The point (at least as I learned it) is that TDD comes very close(*) to guaranteeing __working__ software.

Of course, back in the day, I worked in a context where other folks were already developing elegant designs...
but the software didn't necessarily work. :-) I wonder if that still happens?

Charlie

* I think we all know that TDD, taken in isolation, doesn't guarantee that the software works the way the client
wants it to work. Other practices are needed for that.


On Tue, Jul 4, 2023 at 11:36?AM Mauricio Aniche <mauricioaniche@...> wrote:
Hi, JB! Thanks for starting such an interesting thread.

I'm a strong believer in a slight variation of what you said. If you
want to get the best out of TDD, you need to deeply know about
software design.

IMHO, TDD doesn't magically guide you to good design. Sure, in
information systems, where many of the design decisions are related to
object creation and encapsulation, TDD is a great way to quickly
validate if you are going in a good direction. Maybe in such cases you
don't really need a deep background in OOD to listen to your tests
saying that your class is hard to be instantiated or that you aren't
encapsulating things properly, and so, TDD pays off handsomely even to
those that still haven't mastered OOD.

However, if you are building highly flexible applications / libraries
/ frameworks, I hardly think that TDD is enough. As an example of a
library I was diving into the code today: the extensibility model of
JUnit 5. It was clearly created by someone who profoundly understands
object-oriented design principles and how to build elegant and
flexible APIs. A non-expert in OOD, even with TDD, wouldn't be able to
do it no matter how perfect their TDD sessions were.

Cheers,

--
Maur¨ªcio Aniche
Author of Effective Software Testing: A Developer's Guide


On Tue, Jul 4, 2023 at 6:55?PM Russell Gold <russ@...> wrote:
>
> Refactoring to simplify code leads to cleaner designs. If nothing else, you should get a better feel for what makes a clean design. On the other hand, if by ¡°design¡± you¡¯re thinking mainly systems-level, I don¡¯t really see TDD as helping.
>
>
>
>
> On Jul 4, 2023, at 10:05 AM, Kevin Rutherford <kevin@...> wrote:
>
> JB,
> I'm quite surprised by your second claim, that "One can learn design
> skill by practising TDD".
> Can you support that?
>
> K
>
> On Tue, Jul 4, 2023 at 2:43?PM J. B. Rainsberger <me@...> wrote:
>
>
> I am surprised to encounter so many people who claim something like this:
>
> "You must understand how to design before you can practise TDD well."
>
> I say the following in response:
>
> - Practising TDD "poorly" still helps many programmers
> - One can learn design skill by practising TDD, and I consider this a kind of pracitisng TDD "well"
> - Your claim, framed that way, needlessly scares programmers away from TDD who need it
>
> Practising TDD well and improving design skill forms an amplifying feedback loop, don't you think?
> --
> J. B. (Joe) Rainsberger :: tdd.training :: ::
>
>
> Replies from this account routinely take a few days, which allows me to reply thoughtfully. I reply more quickly to messages that clearly require answers urgently. If you need something from me and are on a deadline, then let me know how soon you need a reply so that I can better help you to get what you need. Thank you for your consideration.
>
> --
> J. B. (Joe) Rainsberger :: :: ::
> Teaching evolutionary design and TDD since 2002
>
>
> -----------------
> Author, HttpUnit <> and SimpleStub <>
> Now blogging at <>
>
> Have you listened to Edict Zero <>? If not, you don¡¯t know what you¡¯re missing!
>
>





Join [email protected] to automatically receive all group messages.