¿ªÔÆÌåÓý

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

Re: How to learn good design using TDD ?

 

On the subject of learning a language via TDD: of related interest is that for many languages you can find "<Language name> Koans", where someone has already written a suite of failing unit tests of language features, complete with helpful error messages that allow you to get the tests passing. I first learned of it via??which I believe to be the original, but it's easy enough to Google e.g. "Java Koans" and find something like?.

Returning to the OP, I think it's worth pointing out that?improving the design of your code is one motivation for TDD. So it should be possible to study the two in parallel.?Moreover, the fact that in TDD your tests serve a dual purpose- acting as API design as well as regression safety- in some cases causes a tension between these competing requirements. The "London" (or "outside-in"/"top-down") approach to TDD differs from the "Chicago" ("inside-out"/ "bottom-up") approach largely due to the role played by test doubles, which are introduced to aid design at the cost of increasing the risk of false positives/negatives in tests for the correctness of your code. (?is a good free resource to read more about this stuff.)?

Cheers,
Rob


Re: How to learn good design using TDD ?

 

¿ªÔÆÌåÓý

Currently, I am learning Java 11

Mit freundlichen Gr¨¹?e / Kind regards
?
Ahmet Murati
Email/Skype:?ahmet.murati@...;?amurati
E-Mail/Hangouts :?ahmetmurati@...
De-Email :?ahmet.murati.1@...
Cellphone/Handy:?+49 1512 3015776


From: [email protected] <[email protected]> on behalf of Jeff Langr <jeff@...>
Sent: Friday, August 7, 2020 6:55:27 PM
To: [email protected] <[email protected]>
Subject: Re: [testdrivendevelopment] How to learn good design using TDD ?
?
Thanks Matteo,

It's still how I prefer to learn about a new language, or new language feature--each test is an exploration. As far as also using such "language characterization tests" to also explore simple design rules, I'd be curious to see some examples of that, Gregory.

I will at times test-drive a small behavioral concept, then see how many different ways I can achieve that using different language constructs--primarily to find the one that seems most expressive.

BTW if I ever get my head above water: I've been considering a new version of Agile Java for years (I still get regular requests for that). I wrote it only at the point where I thought Java had made a significant leap in expressiveness with v5. As much as I'd prefer to work in other languages, I keep getting pulled back into Java, and it has also gotten to a decent point (though it's still way too much work in many cases) that it'd be worth another update. I'd probably be seeking a co-writer, hint. Maybe in 2021?

Cheers,
Jeff

Jeff Langr / Langr Software Solutions, Inc.?????
?+1-719-287-4335


Matteo Regazzi wrote on 8/6/20 8:25 AM:
@Gregory Salvam, Since I read the "Agile Java" book by Jeff Langr, I thought that using TDD to learn a programming language was very useful and I used it both for myself and for teaching. However, I had not thought of applying this concept in the way you expressed it, that is, using the 4 rules of simple design (by Beck :-) even if I better understood them reading Corey Haines) to test the assertions contained in the language manual. It seems to me a very interesting approach that I will try to apply as soon as I have the opportunity/need. Thank you!


Re: How to learn good design using TDD ?

 

¿ªÔÆÌåÓý

Thanks Matteo,

It's still how I prefer to learn about a new language, or new language feature--each test is an exploration. As far as also using such "language characterization tests" to also explore simple design rules, I'd be curious to see some examples of that, Gregory.

I will at times test-drive a small behavioral concept, then see how many different ways I can achieve that using different language constructs--primarily to find the one that seems most expressive.

BTW if I ever get my head above water: I've been considering a new version of Agile Java for years (I still get regular requests for that). I wrote it only at the point where I thought Java had made a significant leap in expressiveness with v5. As much as I'd prefer to work in other languages, I keep getting pulled back into Java, and it has also gotten to a decent point (though it's still way too much work in many cases) that it'd be worth another update. I'd probably be seeking a co-writer, hint. Maybe in 2021?

Cheers,
Jeff

Jeff Langr / Langr Software Solutions, Inc.?????
?+1-719-287-4335


Matteo Regazzi wrote on 8/6/20 8:25 AM:

@Gregory Salvam, Since I read the "Agile Java" book by Jeff Langr, I thought that using TDD to learn a programming language was very useful and I used it both for myself and for teaching. However, I had not thought of applying this concept in the way you expressed it, that is, using the 4 rules of simple design (by Beck :-) even if I better understood them reading Corey Haines) to test the assertions contained in the language manual. It seems to me a very interesting approach that I will try to apply as soon as I have the opportunity/need. Thank you!
_._,_._,_


Re: How to learn good design using TDD ?

 

I feel I must again point out that "expresses intent" has too low a bar when judged?by the author.? Each additional set of eyes making that judgment improves that standard significantly.


On Thu, Aug 6, 2020 at 9:36 AM Ron Jeffries <ronjeffriesacm@...> wrote:
please note that although Corey has written a nice little book about them, the four rules were originated by Kent Beck.

r

sent from iPad, probably via Mars. Errors, if any, are not mine.
ronjeffries@... is a better address for me, maybe.

On Aug 6, 2020, at 10:25 AM, Matteo Regazzi <mregazzi@...> wrote:

?@Gregory Salvam, Since I read the "Agile Java" book by Jeff Langr, I thought that using TDD to learn a programming language was very useful and I used it both for myself and for teaching. However, I had not thought of applying this concept in the way you expressed it, that is, using the 4 rules of simple design (by Beck :-) even if I better understood them reading Corey Haines) to test the assertions contained in the language manual. It seems to me a very interesting approach that I will try to apply as soon as I have the opportunity/need. Thank you!


Re: How to learn good design using TDD ?

 

¿ªÔÆÌåÓý

please note that although Corey has written a nice little book about them, the four rules were originated by Kent Beck.

r

sent from iPad, probably via Mars. Errors, if any, are not mine.
ronjeffries@... is a better address for me, maybe.

On Aug 6, 2020, at 10:25 AM, Matteo Regazzi <mregazzi@...> wrote:

?@Gregory Salvam, Since I read the "Agile Java" book by Jeff Langr, I thought that using TDD to learn a programming language was very useful and I used it both for myself and for teaching. However, I had not thought of applying this concept in the way you expressed it, that is, using the 4 rules of simple design (by Beck :-) even if I better understood them reading Corey Haines) to test the assertions contained in the language manual. It seems to me a very interesting approach that I will try to apply as soon as I have the opportunity/need. Thank you!


Re: How to learn good design using TDD ?

 

@Gregory Salvam, Since I read the "Agile Java" book by Jeff Langr, I thought that using TDD to learn a programming language was very useful and I used it both for myself and for teaching. However, I had not thought of applying this concept in the way you expressed it, that is, using the 4 rules of simple design (by Beck :-) even if I better understood them reading Corey Haines) to test the assertions contained in the language manual. It seems to me a very interesting approach that I will try to apply as soon as I have the opportunity/need. Thank you!


Re: How to learn good design using TDD ?

 

First the 4 rules of simple design by Corey Haines:

1. Tests Pass
2. Expresses Intent
3. No Duplication (DRY)
4. Small

I think it's a good starting point when you talk about design.

Then to try to answer your question: how we can recover ?

I may have a lead in the way we learn programming languages, to take some good habits. If you see a PL as a product, when you read the documentation/book on a it, you'll see a lot of assertions about the language features.

The way I learn/teach a language is by testing these features, and I think it's a good seed to move to TDD/BDD.

ex. Assertions: The language X is a static | dynamic strong | weak typed language.

Just with this sentence you have a dozen of tests, you'll experience:

- how to write a test and make it pass
- how to express intent by cuting a sentence in small tests

- duplication or redundancy in the documentation which may emphasize some code smell
- small: each test should contain a single assertion, so you may take the habit to reduce features size in something testable and small

You'll learn with this precise exemple the differents types of the language and their behaviour while converted to others types, some intrisic characterisitics of the PL...

?

1 - Some may think that we're testing implementation. It may be true the border is thin, that's why I would focus on the PL as a product that fill your needs as a user and would prefer given/when/then or rspec (describe/context...) semantic when available (and eventually expressing your needs with user stories if it's not clear).

2 - Some may reproach it's testing after, and it's true, I don't consider it's TDD/BDD of course but just a mean to acquire knowledge about a PL and habits to eventually practice TDD/BDD later. I see similarities with writing documentation (test are documentation).

?

I don't think it's bullet proof to learn good design, and it should be completed by dojo/exercises (ex. object calisthenics), pair and ensemble programming, conference talks, books reading and social sharing... essentially conversations.

What do you think ?

?


Re: How to learn good design using TDD ?

 

Yes, good design is subjective and conditional.?An analogy to a wise saying would be the observation that the enemy of good design is perfect design.

It is very hard to question your own ideas.? Pair programming accelerates questioning and learning for both parties.? My best advice is to find a similarly motivated development partner.

On Fri, Jul 31, 2020 at 8:40 AM Matteo Vaccari <vaccari@...> wrote:
I think that repeating katas is very good but it's not enough.? The prerequisite is a desire to learn and a dissatisfaction with our current level of knowledge and skill.? If we have these, then there are many additional resources: instructional videos, both free and for-pay, mailing lists such as this one, communities, meetups.
?
I think that learning about "good design" is challenging, because there's no single good, operative definition. There's so much opinion and so little established?facts; even the best books (such as the GoF) are not really based on uncontroversial evidence: the burden of understanding when and why a pattern or a principle is useful stays with the reader.? But I think that by reading, questioning, thinking, discussing and experimenting we can improve quite a lot.
?
I think that we have to live with the fact that all we have about design is principles and heuristics.? In the end the proof of the goodness of a design is in looking at the result: is it easy to change?? Is it easy to understand?? Observation of the quality of the end result trumps any design theory or principle.
?


Re: How to learn good design using TDD ?

 

I think that repeating katas is very good but it's not enough.? The prerequisite is a desire to learn and a dissatisfaction with our current level of knowledge and skill.? If we have these, then there are many additional resources: instructional videos, both free and for-pay, mailing lists such as this one, communities, meetups.
?
I think that learning about "good design" is challenging, because there's no single good, operative definition. There's so much opinion and so little established?facts; even the best books (such as the GoF) are not really based on uncontroversial evidence: the burden of understanding when and why a pattern or a principle is useful stays with the reader.? But I think that by reading, questioning, thinking, discussing and experimenting we can improve quite a lot.
?
I think that we have to live with the fact that all we have about design is principles and heuristics.? In the end the proof of the goodness of a design is in looking at the result: is it easy to change?? Is it easy to understand?? Observation of the quality of the end result trumps any design theory or principle.
?


Re: How to learn good design using TDD ?

 

I find a common issue with learning TDD and design is that things which used to feel fast now feel much slower, especially as you confront your ignorance. When you are already trying to use a new language, everything feels slower, and you are constantly confronting your ignorance anyways,?so TDD didn't feel like a hurdle.

brought to you by the letters A, V, and I
and the number 47


On Fri, Jul 31, 2020 at 4:33 PM Matteo Regazzi <mregazzi@...> wrote:

[Edited Message Follows]

@Avi Kessner Interesting point I think,, what do you mean with you were learning language (I think you are referring to C#) and lower psychological barriers ?


Re: How to learn good design using TDD ?

 
Edited

@Avi Kessner Interesting point I think,, what do you mean with you were learning language (I think you are referring to C#) and lower psychological barriers ?


Re: How to learn good design using TDD ?

 

could I learn TDD and good design at the same time? Is it enough to repeat kata? The expert guide would always be desirable, but if it were not there?

Yes, the authors of those books we read didn't have those books.?

I started coding without email and the internet. I wasted a lot of time pursuing the objects model things misunderstanding after what I thought was getting on the OOP bandwagon. Up until early this year, I worked alone and didn't attend many events or conferences so I read books and poked around online but only when I had a problem to solve or something new I needed to learn.?

I came to see a problem with my long lived projects eventually becoming difficult and dangerous to change. Most of my projects had a small group of in-house users so they were willing to put up with a lot but as I began writing production code that shipped to customers with machinery, this became a problem.?

I recognized this as a design problem. It took way too long for me to gain an understanding of objects modeling behaviors and not things. I credit Bob Martin's Agile Principles, Patterns, and Practices in C# book for this.?

That led to me finally reading the Refactoring book which led me first understanding the purpose and value of Automated Testing which led to me wanting to learn TDD.

Over time I started going to events, reading even more, and hiring consultants for personal training... I highly recommend J.B. Rainsberger :-)

Since I hired somebody for the first time this year, I started that person off with introducing them to these resources and allowing time for learning and showing that I value continuous improvement in myself and in them.?

All of this was driven by a problem I needed to solve and looking for answers slowly until I learned how to identify and work with quality mentors.?


Re: How to learn good design using TDD ?

 

¿ªÔÆÌåÓý

I have started coding back in September 1994, at that time we had no Internet connection in my home country so we could not download and install anything via internet as it is nowadays. So, I have started coding with QBasic, at that time there was no TDD, BDD anything else. So, far I have worked only with JUnit especially with Spring Framework, Spring Boot Applications.

?

Mit freundlichen Gr¨¹?e / Kind regards

?

Ahmet Murati

Email/Skype: ahmet.murati@...; amurati

E-Mail/Hangouts?: ahmetmurati@...

De-Email?: ahmet.murati.1@...

Cellphone/Handy: +49 1512 3015776

?

From: [email protected] <[email protected]> On Behalf Of Avi Kessner
Sent: Friday, 31 July 2020 12:22
To: [email protected]
Subject: Re: [testdrivendevelopment] How to learn good design using TDD ?

?

It's really going to depend on what ecosystem you are working in and what tools you'll have available.

?

I worked for one year in C# on the windows phone. The only thing I was able to take from that year was some lessons in Microsoft sponsorships and a huge leap in what I expect tools to be able to do. I used resharper and typemocks and it allowed me to practice TDD. I was also learning the language, so the psychological barriers were lower.??

After having that experience I was in a better place to judge and improve the tools I use in other ecosystems.

?

So yes, there is hope, but it's going to take more than just awareness and self study.?

?

Before working on the windows phone I was working with ActionScript and Flash, and while the culture was supportive, and there were even some tools trying to help, it just wasn't a very good TDD experience. After the windows phone I did work in Unity, and despite being C#, the tools weren't available.

?

And sometimes, even if the ecosystem exists, it's locked behind a relatively high paywall.

?

On Fri, 31 Jul 2020, 11:39 Matteo Regazzi, <mregazzi@...> wrote:

This week there have been two interesting TDD webinars about why after 20 years it doesn't dominate the software development scene. To tell the truth, in some situations, it is even an unknown technique and therefore not adopted not by choice but out of ignorance.

My personal feeling (I have been in the software development field since 1995 and met extreme programming in 2001) is that in the last 20 years, starting from the rise of agile methodologies, there has been a clear bifurcation: on the one hand, craftmanship, extreme programming, people who apply to their profession that continuous improvement we preach. On the other hand, people who have learned from their predecessors (someone like me, possible), perhaps losing something, as if the transition between anticipatory and evolutionary design had been missing. We missed the design at all. Now my question is: how can we recover? It looks like a chicken egg problem. In the past a programmer learned design principles and techniques and then applied them (with all the disadvantages we know) but the process was clear and straightforward. Today if I started from scratch, under expert guidance, I would probably learn to program and design using TDD. But if I am already a programmer, maybe for 10 years (iterating the same bad year ten times), who knows almost nothing about good design (or at least is not aware of it), could I learn TDD and good design at the same time? Is it enough to repeat kata? The expert guide would always be desirable, but if it were not there?


Re: How to learn good design using TDD ?

 

It's really going to depend on what ecosystem you are working in and what tools you'll have available.

I worked for one year in C# on the windows phone. The only thing I was able to take from that year was some lessons in Microsoft sponsorships and a huge leap in what I expect tools to be able to do. I used resharper and typemocks and it allowed me to practice TDD. I was also learning the language, so the psychological barriers were lower.??
After having that experience I was in a better place to judge and improve the tools I use in other ecosystems.

So yes, there is hope, but it's going to take more than just awareness and self study.?

Before working on the windows phone I was working with ActionScript and Flash, and while the culture was supportive, and there were even some tools trying to help, it just wasn't a very good TDD experience. After the windows phone I did work in Unity, and despite being C#, the tools weren't available.

And sometimes, even if the ecosystem exists, it's locked behind a relatively high paywall.

On Fri, 31 Jul 2020, 11:39 Matteo Regazzi, <mregazzi@...> wrote:
This week there have been two interesting TDD webinars about why after 20 years it doesn't dominate the software development scene. To tell the truth, in some situations, it is even an unknown technique and therefore not adopted not by choice but out of ignorance.

My personal feeling (I have been in the software development field since 1995 and met extreme programming in 2001) is that in the last 20 years, starting from the rise of agile methodologies, there has been a clear bifurcation: on the one hand, craftmanship, extreme programming, people who apply to their profession that continuous improvement we preach. On the other hand, people who have learned from their predecessors (someone like me, possible), perhaps losing something, as if the transition between anticipatory and evolutionary design had been missing. We missed the design at all. Now my question is: how can we recover? It looks like a chicken egg problem. In the past a programmer learned design principles and techniques and then applied them (with all the disadvantages we know) but the process was clear and straightforward. Today if I started from scratch, under expert guidance, I would probably learn to program and design using TDD. But if I am already a programmer, maybe for 10 years (iterating the same bad year ten times), who knows almost nothing about good design (or at least is not aware of it), could I learn TDD and good design at the same time? Is it enough to repeat kata? The expert guide would always be desirable, but if it were not there?


Re: How to learn good design using TDD ?

 

Can someone learn TDD and good design without on-hands expert guidance?

Yes, that is the route I followed. I had been a programmer for 15 years before I became interested in TDD and good design. I learned mostly from reading books, doing kata's, and applying it in practice where I could.

-RW


Op 31 juli 2020 om 10:25 schreef Matteo Regazzi <mregazzi@...>:

This week there have been two interesting TDD webinars about why after 20 years it doesn't dominate the software development scene. To tell the truth, in some situations, it is even an unknown technique and therefore not adopted not by choice but out of ignorance.

My personal feeling (I have been in the software development field since 1995 and met extreme programming in 2001) is that in the last 20 years, starting from the rise of agile methodologies, there has been a clear bifurcation: on the one hand, craftmanship, extreme programming, people who apply to their profession that continuous improvement we preach. On the other hand, people who have learned from their predecessors (someone like me, possible), perhaps losing something, as if the transition between anticipatory and evolutionary design had been missing. We missed the design at all. Now my question is: how can we recover? It looks like a chicken egg problem. In the past a programmer learned design principles and techniques and then applied them (with all the disadvantages we know) but the process was clear and straightforward. Today if I started from scratch, under expert guidance, I would probably learn to program and design using TDD. But if I am already a programmer, maybe for 10 years (iterating the same bad year ten times), who knows almost nothing about good design (or at least is not aware of it), could I learn TDD and good design at the same time? Is it enough to repeat kata? The expert guide would always be desirable, but if it were not there?


How to learn good design using TDD ?

 

This week there have been two interesting TDD webinars about why after 20 years it doesn't dominate the software development scene. To tell the truth, in some situations, it is even an unknown technique and therefore not adopted not by choice but out of ignorance.

My personal feeling (I have been in the software development field since 1995 and met extreme programming in 2001) is that in the last 20 years, starting from the rise of agile methodologies, there has been a clear bifurcation: on the one hand, craftmanship, extreme programming, people who apply to their profession that continuous improvement we preach. On the other hand, people who have learned from their predecessors (someone like me, possible), perhaps losing something, as if the transition between anticipatory and evolutionary design had been missing. We missed the design at all. Now my question is: how can we recover? It looks like a chicken egg problem. In the past a programmer learned design principles and techniques and then applied them (with all the disadvantages we know) but the process was clear and straightforward. Today if I started from scratch, under expert guidance, I would probably learn to program and design using TDD. But if I am already a programmer, maybe for 10 years (iterating the same bad year ten times), who knows almost nothing about good design (or at least is not aware of it), could I learn TDD and good design at the same time? Is it enough to repeat kata? The expert guide would always be desirable, but if it were not there?


Re: Event Modeling and TDD... somewhat

 

In his last meetup, Adam mentioned a lot of interest in his TDD comments and wondered if he should've chosen his words better.


Re: Event Modeling and TDD... somewhat

 

> In 30+ years of practice, the only times I have not encountered miscommunications, misunderstandings or misconceptions about what users wanted and needed were in the development of formal systems like compilers.

As someone who has built compilers and spent nearly a decade on the ANSI C++ Standards Committee, I can say that even the field of compilers has plenty of opportunities for "miscommunications, misunderstandings or misconceptions" (like asking Bjarne how a particular aspect of namespaces was supposed to work and getting the answer "I don't know, I didn't implement that part...").

On Thu, May 21, 2020 at 5:48 PM Steve Gordon <sgordonphd@...> wrote:
I agree with Ron.

If only we actually knew everything about what the software?would have to do to work in the user's reality before we built the software, then designing it right in the first place would work?beautifully.? Is that flawed assumption not the essence of why waterfall fails as a general approach to software development???

In 30+ years of practice, the only times I have not encountered miscommunications, misunderstandings or misconceptions about what users wanted and needed were in the development of formal systems like compilers.? This is why we need feedback on working software to discover misunderstandings and the flexibility to rapidly adapt to those discoveries. Being tied to a formal model radically increases the cost of change.? If the code is the model, I have found no better way than TDD to iteratively deliver slices of working software, get concrete feedback, and adapt the code to address that feedback.

On Thu, May 21, 2020 at 5:28 PM Ron Jeffries <ronjeffriesacm@...> wrote:
It seems to me unlikely that event modeling, even if it were applicable everywhere TDD is applicable, was able to find and correct all the problems that TDD finds and corrects.

I think the style of that posting is indeed unfortunate, ell-advised, and likely misleading and quite possibly wrong.

Aside from that it didn't have much content.

:)

R

On May 21, 2020, at 7:57 PM, J. B. Rainsberger <jbrains762@...> wrote:

Hi, folks.

Adam Dymitruk wrote this on LinkedIn.


I don't like that he framed this as "Don't do TDD; model events, instead", but I otherwise trust him, so I'd like to know whether you folks have any experience mixing event modeling with TDD.

I don't, but I can see how I'd do it, and I imagine people who practise TDD will eventually (eventually!) see the benefits of event modeling as a shortcut. Adam and I have made vague plans to discuss this in some detail, but if you folks have anything to say on the topic, I'd enjoy reading it.
--
J. B. (Joe) Rainsberger :: :: ::



Ron Jeffries
Everything that needs to be said has already been said.
But since no one was listening, everything must be said again. -- Andre Gide



--
Sean A Corfield -- (904) 302-SEAN
An Architect's View --
World Singles Networks, LLC. --

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)


Re: Event Modeling and TDD... somewhat

 

Hi J.B.,

I'm a fan of Event Modeling as a way of explaining and discussing a system with others (especially non-technical). I see a lot of value in that. I never found that I liked UML for discussing systems because people needed to know too much about it from my experience. With Event Modeling I can more easily explain myself to other stakeholders and get input from them.?

His take on it putting an end to Agile and TDD don't make sense to me and I don't pay much attention to those strong opinions of his.

I have no doubt though that in the projects he's working on he's finding tremendous benefits. I don't work on projects like those and I can't imagine how Event Modeling would replace the benefits I'm seeing from Agile principles and methodologies and TDD.

--John?


Re: Event Modeling and TDD... somewhat

 

Reading through the comments of the post I see the main issue here is a disconnect.

A no true scottsman sort of deal.?

He says that "small design up front" is only a suggestion and never followed and that TDD claims it alone can design everything.

I don't find that to be the case but maybe I'm in the minority.

On Fri, May 22, 2020, 02:57 J. B. Rainsberger <jbrains762@...> wrote:
Hi, folks.

Adam Dymitruk wrote this on LinkedIn.


I don't like that he framed this as "Don't do TDD; model events, instead", but I otherwise trust him, so I'd like to know whether you folks have any experience mixing event modeling with TDD.

I don't, but I can see how I'd do it, and I imagine people who practise TDD will eventually (eventually!) see the benefits of event modeling as a shortcut. Adam and I have made vague plans to discuss this in some detail, but if you folks have anything to say on the topic, I'd enjoy reading it.
--
J. B. (Joe) Rainsberger :: :: ::