Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #40966 > unrolled thread

TDD can be useful even when it doesn't achieve what you want

Started byJuha Nieminen <nospam@thanks.invalid>
First post2016-02-15 21:49 +0000
Last post2016-02-18 21:30 +0000
Articles 20 on this page of 75 — 11 participants

Back to article view | Back to comp.lang.c++


Contents

  TDD can be useful even when it doesn't achieve what you want Juha Nieminen <nospam@thanks.invalid> - 2016-02-15 21:49 +0000
    Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-15 21:56 +0000
      Re: TDD can be useful even when it doesn't achieve what you want Juha Nieminen <nospam@thanks.invalid> - 2016-02-16 09:09 +0000
    Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-15 23:59 +0100
      Re: TDD can be useful even when it doesn't achieve what you want Juha Nieminen <nospam@thanks.invalid> - 2016-02-16 09:12 +0000
        Re: TDD can be useful even when it doesn't achieve what you want Öö Tiib <ootiib@hot.ee> - 2016-02-16 03:08 -0800
        Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-16 17:16 +0100
          Re: TDD can be useful even when it doesn't achieve what you want Juha Nieminen <nospam@thanks.invalid> - 2016-02-17 11:26 +0000
            Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-17 16:55 +0000
              Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 08:00 +1300
            Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-17 18:57 +0100
              Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 08:02 +1300
                Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-17 20:11 +0100
                  Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 08:23 +1300
                    Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-17 20:32 +0100
                      Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 08:54 +1300
                      Re: TDD can be useful even when it doesn't achieve what you want Cholo Lennon <chololennon@hotmail.com> - 2016-02-17 17:19 -0300
                        Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 10:28 +1300
                  Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-17 21:28 +0000
              Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-17 21:08 +0000
                Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-17 23:08 +0100
                  Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 11:19 +1300
                    Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 08:33 +0100
                      Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 20:42 +1300
                        Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 20:45 +1300
                          Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 08:58 +0100
                            Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 23:24 +1300
                        Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 08:58 +0100
                          Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 21:17 +1300
                            Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 09:22 +0100
                              Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 21:28 +1300
                                Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 09:39 +0100
                                  Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 23:22 +1300
                                    Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 11:57 +0100
                                      Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-19 09:29 +1300
                                        Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 22:00 +0100
                                          Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-19 10:10 +1300
                                            Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 23:15 +0100
                                              Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-20 11:22 +1300
                                                Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-19 22:39 +0000
                                                  Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-20 00:20 +0100
                                                    Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-20 13:16 +1300
                                                      Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-20 09:07 +0100
                                                        Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-20 21:17 +1300
                                                          Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-20 09:53 +0100
                                                            Re: TDD can be useful even when it doesn't achieve what you want Öö Tiib <ootiib@hot.ee> - 2016-02-20 04:24 -0800
                                                              Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-20 14:08 +0100
                                                        Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-21 01:19 +0000
                                                          Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-21 09:29 +0100
                                                            Re: TDD can be useful even when it doesn't achieve what you want Paul Sinnett <paul.sinnett@gmail.com> - 2016-02-21 08:08 -0800
                                                            Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-22 05:07 +0000
                                                              Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-22 19:44 +0000
                                                                Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-23 08:58 +1300
                                                                  Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-22 20:13 +0000
                                                                    Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-23 09:19 +1300
                                                                      Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-22 20:21 +0000
                                                                Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-22 21:18 +0100
                                                                  Re: TDD can be useful even when it doesn't achieve what you want Juha Nieminen <nospam@thanks.invalid> - 2016-02-23 09:14 +0000
                                                                    Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-23 22:21 +1300
                                                                      Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-23 17:33 +0000
                                                                        Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-23 19:28 +0100
                                                                        Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-24 08:43 +1300
                                                                          Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-23 20:13 +0000
                                                                            Re: TDD can be useful even when it doesn't achieve what you want Gareth Owen <gwowen@gmail.com> - 2016-02-23 20:53 +0000
                                                                              Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-24 17:12 +0000
                                                                                Re: TDD can be useful even when it doesn't achieve what you want Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2016-02-24 18:05 +0000
                                                                            Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-24 09:53 +1300
                                                                              Re: TDD can be useful even when it doesn't achieve what you want Gareth Owen <gwowen@gmail.com> - 2016-02-23 21:09 +0000
                                                                                Re: TDD can be useful even when it doesn't achieve what you want David Brown <david.brown@hesbynett.no> - 2016-02-23 22:22 +0100
                                                        Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-21 01:21 +0000
                            Re: TDD can be useful even when it doesn't achieve what you want Ian Collins <ian-news@hotmail.com> - 2016-02-18 21:24 +1300
                    Re: TDD can be useful even when it doesn't achieve what you want Vir Campestris <vir.campestris@invalid.invalid> - 2016-02-18 21:27 +0000
                  Re: TDD can be useful even when it doesn't achieve what you want legalize+jeeves@mail.xmission.com (Richard) - 2016-02-18 17:48 +0000
                    Re: TDD can be useful even when it doesn't achieve what you want Wouter van Ooijen <wouter@voti.nl> - 2016-02-18 19:04 +0100
            Re: TDD can be useful even when it doesn't achieve what you want Vir Campestris <vir.campestris@invalid.invalid> - 2016-02-18 21:30 +0000

Page 3 of 4 — ← Prev page 1 2 [3] 4  Next page →


#41054

FromWouter van Ooijen <wouter@voti.nl>
Date2016-02-20 00:20 +0100
Message-ID<56c7a325$0$3976$e4fe514c@newszilla.xs4all.nl>
In reply to#41053
Op 19-Feb-16 om 11:39 PM schreef Richard:
> [Please do not mail me a copy of your followup]
>
> Ian Collins <ian-news@hotmail.com> spake the secret code
> <dipisvFj7j6U1@mid.individual.net> thusly:
>
>> The "rules" laid down by the well known agile evangelists should be
>> interpreted as guidelines rather than strict process steps (like those
>> mandated by RUP).
>
> Instead of generalizing, I'm going to say that for Uncle Bob's rules
> of TDD you should *literally* do them when learning TDD.  You should
> obey those rules literally and without deviation.  Doing so is crucial
> to learning TDD and actually "getting it" IMO.
>
> You'll know you're in a good TDD workshop when the instructor reviews
> the code of students and tells them to delete everything they've done
> and start over when they've violated the rules.
>
> In martial arts, this is known as "shuhari".  When you are beginning
> to learn TDD you aren't yet masterful enough to know *when* you can
> bend or break the rules, so you must follow them rigidly.  (You are
> "shu".)  As you achieve mastery, you advance to "ha" where you can
> start to bend the rules or even break them completely.  When you
> become a true master, you advance to "ri" and the rules are no longer
> necessary because you've internalized them as habit and you can be
> more expressive and freeform or even make up your own competing
> system.
> <https://en.wikipedia.org/wiki/Shuhari>
>
> Many of the people I've seen struggle with TDD are programmers with
> many years of experience outside of TDD that feel uncomfortable being
> placed into a position where they have to rigidly follow the rules
> because they haven't achieved mastery.
>
> This is somewhat akin to saying:
> "What's so hard about programming?  It's just typing!"
>
>  From what I can tell, Ian has been doing this a while and he has a
> good intuition for when he can bend the rules without getting himself
> into trouble.  For an absolute beginner, it is my opinion that they
> follow the rules literally.  Otherwise, they will miss the crucial
> insight that TDD brings because they will keep doing things the old
> way.
>
> I describe TDD as turning your normal pyramid of development upside
> down.  It is a significantly different way of thinking about the code
> development process.

I think I am a rather good programmer / system designer (don't we all 
think we are?) and I decide for myself what I find usefull. There are 
lots of development processes available, and I can't 'walk' them all, so 
I'll have to choose, upfront, based on what I see, waht is worth trying. 
You (Richard) and Ian present two rather different views of what you 
think TDD is (or should be). Based on what you say, and a few Uncle Bob 
talks, I reject the Bob/Richard path as rediculous, but the 
Ian/Kent-Beck path might be interesting. I'll watch a few Kent Beck 
talks before I decide.

Wouter van Ooijen

[toc] | [prev] | [next] | [standalone]


#41056

FromIan Collins <ian-news@hotmail.com>
Date2016-02-20 13:16 +1300
Message-ID<dippi2Fj7j6U2@mid.individual.net>
In reply to#41054
Wouter van Ooijen wrote:
> Op 19-Feb-16 om 11:39 PM schreef Richard:
>> [Please do not mail me a copy of your followup]
>>
>> Ian Collins <ian-news@hotmail.com> spake the secret code
>> <dipisvFj7j6U1@mid.individual.net> thusly:
>>
>>> The "rules" laid down by the well known agile evangelists should be
>>> interpreted as guidelines rather than strict process steps (like those
>>> mandated by RUP).
>>
>> Instead of generalizing, I'm going to say that for Uncle Bob's rules
>> of TDD you should *literally* do them when learning TDD.  You should
>> obey those rules literally and without deviation.  Doing so is crucial
>> to learning TDD and actually "getting it" IMO.
>>

<snip>

> I think I am a rather good programmer / system designer (don't we all
> think we are?) and I decide for myself what I find usefull. There are
> lots of development processes available, and I can't 'walk' them all, so
> I'll have to choose, upfront, based on what I see, waht is worth trying.
> You (Richard) and Ian present two rather different views of what you
> think TDD is (or should be).

I don't think there is as big a difference as you make out.  I agree 
with Richard that strict adherence to the rules is important in a 
teaching environment, whether they be learning a process or anything else.

Things were a little different for us when we starting down the XP path. 
  There weren't any coaches or formal training here at the time, we were 
early adopters so we had to find our own way on a real project.  We 
probably took way longer than if we had had outside support, but we were 
happy with the end result.  I think we would have failed if we had tried 
to do things by the book because we wouldn't have had a good enough 
understanding of it!  I would probably have had a revolt on my hands...

The martial arts analogy is a good one, although I prefer to think of a 
development team as a herd of elephants and a good coach as the 
matriarch.  We didn't have a matriarch, so we blundered around a bit. 
But we found the water in the end...

> Based on what you say, and a few Uncle Bob
> talks, I reject the Bob/Richard path as rediculous, but the
> Ian/Kent-Beck path might be interesting. I'll watch a few Kent Beck
> talks before I decide.

Do, the more perspectives you hear, the mode chance there is of hearing 
one that fits your way of working.

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#41057

FromWouter van Ooijen <wouter@voti.nl>
Date2016-02-20 09:07 +0100
Message-ID<56c81ec1$0$4200$e4fe514c@newszilla.xs4all.nl>
In reply to#41056
Op 20-Feb-16 om 1:16 AM schreef Ian Collins:
> Wouter van Ooijen wrote:
>> Op 19-Feb-16 om 11:39 PM schreef Richard:
>>> [Please do not mail me a copy of your followup]
>>>
>>> Ian Collins <ian-news@hotmail.com> spake the secret code
>>> <dipisvFj7j6U1@mid.individual.net> thusly:
>>>
>>>> The "rules" laid down by the well known agile evangelists should be
>>>> interpreted as guidelines rather than strict process steps (like those
>>>> mandated by RUP).
>>>
>>> Instead of generalizing, I'm going to say that for Uncle Bob's rules
>>> of TDD you should *literally* do them when learning TDD.  You should
>>> obey those rules literally and without deviation.  Doing so is crucial
>>> to learning TDD and actually "getting it" IMO.
>>>
>
> <snip>
>
>> I think I am a rather good programmer / system designer (don't we all
>> think we are?) and I decide for myself what I find usefull. There are
>> lots of development processes available, and I can't 'walk' them all, so
>> I'll have to choose, upfront, based on what I see, waht is worth trying.
>> You (Richard) and Ian present two rather different views of what you
>> think TDD is (or should be).
>
> I don't think there is as big a difference as you make out.  I agree
> with Richard that strict adherence to the rules is important in a
> teaching environment, whether they be learning a process or anything else.

But, as I understand (both of you, correct me if I am wrong) the rules 
that Richard wants to be followed strictly *exclude* refactoring, while 
Ians rules *include* it. For me that's the difference between night and day.

I don't believe in doing it differently while learning than while doing 
actual work. That is OK for muscle work (wax on, wax off), or for 
accosciative creativity (which is almost muscle work), but not for 
thinking processes. For me, any method that, while in the learning 
phase, can't or doesn't want to explain and defend the steps (or absense 
of steps!) in terms of the end goal is out. I am not a child, and 
neither are my students.

Richard, the same UART case for you: I must write a UART baudrate 
initialization. The method accepts a run-time specified baudrate. Strict 
3-rule TDD keeps me in the cycle

- write test case (for a specific baudrate)
- adapt code to pass that case

This leads to code that has a list of if's or equivalent. It passes all 
the tests, but it is crappy code. Now Ian says: refactor! You seem to 
say: no, don't do that. So how does your process lead me to good code?

Wouter van Ooijen

[toc] | [prev] | [next] | [standalone]


#41058

FromIan Collins <ian-news@hotmail.com>
Date2016-02-20 21:17 +1300
Message-ID<diqlojFj7j6U3@mid.individual.net>
In reply to#41057
Wouter van Ooijen wrote:
> Op 20-Feb-16 om 1:16 AM schreef Ian Collins:
>> Wouter van Ooijen wrote:
>>
>>> I think I am a rather good programmer / system designer (don't we all
>>> think we are?) and I decide for myself what I find usefull. There are
>>> lots of development processes available, and I can't 'walk' them all, so
>>> I'll have to choose, upfront, based on what I see, waht is worth trying.
>>> You (Richard) and Ian present two rather different views of what you
>>> think TDD is (or should be).
>>
>> I don't think there is as big a difference as you make out.  I agree
>> with Richard that strict adherence to the rules is important in a
>> teaching environment, whether they be learning a process or anything else.
>
> But, as I understand (both of you, correct me if I am wrong) the rules
> that Richard wants to be followed strictly *exclude* refactoring, while
> Ians rules *include* it. For me that's the difference between night and day.

Someone must be misinterpreting something here, TDD without refactoring 
is like a burger without a bun: messy!

> I don't believe in doing it differently while learning than while doing
> actual work.

When learning (especially without a wise head to guide you) how do you 
know what is safe to leave out?  If you were learning to fly from a 
book, would you disregard sections you don't like?

> That is OK for muscle work (wax on, wax off), or for
> accosciative creativity (which is almost muscle work), but not for
> thinking processes. For me, any method that, while in the learning
> phase, can't or doesn't want to explain and defend the steps (or absense
> of steps!) in terms of the end goal is out. I am not a child, and
> neither are my students.

I don't think any one was suggesting that and I think it stresses my 
earlier point - hire a coach.

> Richard, the same UART case for you: I must write a UART baudrate
> initialization. The method accepts a run-time specified baudrate. Strict
> 3-rule TDD keeps me in the cycle
>
> - write test case (for a specific baudrate)
> - adapt code to pass that case
>
> This leads to code that has a list of if's or equivalent. It passes all
> the tests, but it is crappy code. Now Ian says: refactor! You seem to
> say: no, don't do that. So how does your process lead me to good code?

I say refactor after each commit and I would be most surprised if 
Richard disagreed.

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#41059

FromWouter van Ooijen <wouter@voti.nl>
Date2016-02-20 09:53 +0100
Message-ID<56c8296a$0$4296$e4fe514c@newszilla.xs4all.nl>
In reply to#41058
Op 20-Feb-16 om 9:17 AM schreef Ian Collins:
> Wouter van Ooijen wrote:
>> Op 20-Feb-16 om 1:16 AM schreef Ian Collins:
>>> Wouter van Ooijen wrote:
>>>
>>>> I think I am a rather good programmer / system designer (don't we all
>>>> think we are?) and I decide for myself what I find usefull. There are
>>>> lots of development processes available, and I can't 'walk' them
>>>> all, so
>>>> I'll have to choose, upfront, based on what I see, waht is worth
>>>> trying.
>>>> You (Richard) and Ian present two rather different views of what you
>>>> think TDD is (or should be).
>>>
>>> I don't think there is as big a difference as you make out.  I agree
>>> with Richard that strict adherence to the rules is important in a
>>> teaching environment, whether they be learning a process or anything
>>> else.
>>
>> But, as I understand (both of you, correct me if I am wrong) the rules
>> that Richard wants to be followed strictly *exclude* refactoring, while
>> Ians rules *include* it. For me that's the difference between night
>> and day.
>
> Someone must be misinterpreting something here, TDD without refactoring
> is like a burger without a bun: messy!
>
>> I don't believe in doing it differently while learning than while doing
>> actual work.
>
> When learning (especially without a wise head to guide you) how do you
> know what is safe to leave out?  If you were learning to fly from a
> book, would you disregard sections you don't like?

Yes. A better comparison would be learning to fly a simulator, because 
doing something wrong writing (my own) software will not kill me. If I 
get killed in the simulated fligts I will reconsider my opinion of the 
sections I disregarded.

>> That is OK for muscle work (wax on, wax off), or for
>> accosciative creativity (which is almost muscle work), but not for
>> thinking processes. For me, any method that, while in the learning
>> phase, can't or doesn't want to explain and defend the steps (or absense
>> of steps!) in terms of the end goal is out. I am not a child, and
>> neither are my students.
>
> I don't think any one was suggesting that and I think it stresses my
> earlier point - hire a coach.

Sorry, I won't. IMO an intellectual process that can't be explained in a 
book, talk or article is not worth considering.

>
>> Richard, the same UART case for you: I must write a UART baudrate
>> initialization. The method accepts a run-time specified baudrate. Strict
>> 3-rule TDD keeps me in the cycle
>>
>> - write test case (for a specific baudrate)
>> - adapt code to pass that case
>>
>> This leads to code that has a list of if's or equivalent. It passes all
>> the tests, but it is crappy code. Now Ian says: refactor! You seem to
>> say: no, don't do that. So how does your process lead me to good code?
>
> I say refactor after each commit and I would be most surprised if
> Richard disagreed.

To quote Richard: "Instead of generalizing, I'm going to say that for 
Uncle Bob's rules of TDD you should *literally* do them when learning TDD."

Maybe the difference is in "when learning", but that leads me to ask how 
I would learn anything (except how to write bad code) when refactoring 
is not allowed.

Wouter van Ooijen

[toc] | [prev] | [next] | [standalone]


#41060

FromÖö Tiib <ootiib@hot.ee>
Date2016-02-20 04:24 -0800
Message-ID<a397ad3e-4751-4d3a-9c2e-b04bc8e77392@googlegroups.com>
In reply to#41059
On Saturday, 20 February 2016 10:53:09 UTC+2, Wouter van Ooijen  wrote:
> Op 20-Feb-16 om 9:17 AM schreef Ian Collins:
> > Wouter van Ooijen wrote:
> >> That is OK for muscle work (wax on, wax off), or for
> >> accosciative creativity (which is almost muscle work), but not for
> >> thinking processes. For me, any method that, while in the learning
> >> phase, can't or doesn't want to explain and defend the steps (or absense
> >> of steps!) in terms of the end goal is out. I am not a child, and
> >> neither are my students.
> >
> > I don't think any one was suggesting that and I think it stresses my
> > earlier point - hire a coach.
> 
> Sorry, I won't. IMO an intellectual process that can't be explained in a 
> book, talk or article is not worth considering.

I am also unsure about Uncle Bob so I ordered "Clean Code: A Handbook of
Agile Software Craftsmanship" of his. He is likely worth reading even
if I disagree with him.

> 
> >
> >> Richard, the same UART case for you: I must write a UART baudrate
> >> initialization. The method accepts a run-time specified baudrate. Strict
> >> 3-rule TDD keeps me in the cycle
> >>
> >> - write test case (for a specific baudrate)
> >> - adapt code to pass that case
> >>
> >> This leads to code that has a list of if's or equivalent. It passes all
> >> the tests, but it is crappy code. Now Ian says: refactor! You seem to
> >> say: no, don't do that. So how does your process lead me to good code?
> >
> > I say refactor after each commit and I would be most surprised if
> > Richard disagreed.
> 
> To quote Richard: "Instead of generalizing, I'm going to say that for 
> Uncle Bob's rules of TDD you should *literally* do them when learning TDD."
> 
> Maybe the difference is in "when learning", but that leads me to ask how 
> I would learn anything (except how to write bad code) when refactoring 
> is not allowed.

For me one major point pro unit testing (when I started) was refactoring.
Refactoring during maintenance does result with major regressions without
unit tests. It likely is some misunderstanding here since Uncle Bob does 
do it like all do (https://www.youtube.com/watch?v=y4_SJzNJnXU) and
from video it is hopefully clear how unit tests help there. 
It is perhaps unfortunate that his TDD rules forget to mention it.

[toc] | [prev] | [next] | [standalone]


#41062

FromWouter van Ooijen <wouter@voti.nl>
Date2016-02-20 14:08 +0100
Message-ID<56c86548$0$4361$e4fe514c@newszilla.xs4all.nl>
In reply to#41060
Op 20-Feb-16 om 1:24 PM schreef Öö Tiib:
> On Saturday, 20 February 2016 10:53:09 UTC+2, Wouter van Ooijen  wrote:
>> Op 20-Feb-16 om 9:17 AM schreef Ian Collins:
>>> Wouter van Ooijen wrote:
>>>> That is OK for muscle work (wax on, wax off), or for
>>>> accosciative creativity (which is almost muscle work), but not for
>>>> thinking processes. For me, any method that, while in the learning
>>>> phase, can't or doesn't want to explain and defend the steps (or absense
>>>> of steps!) in terms of the end goal is out. I am not a child, and
>>>> neither are my students.
>>>
>>> I don't think any one was suggesting that and I think it stresses my
>>> earlier point - hire a coach.
>>
>> Sorry, I won't. IMO an intellectual process that can't be explained in a
>> book, talk or article is not worth considering.
>
> I am also unsure about Uncle Bob so I ordered "Clean Code: A Handbook of
> Agile Software Craftsmanship" of his. He is likely worth reading even
> if I disagree with him.

 From the tone of his talk I would not consider him worth reading, too 
dogmatic for my tase, and his favorite talking style is 'proof by 
indoctrination'. I'll stick to Kent Beck, who seems (from a few 
youtubes) to be much more pragmatic and to prefer giving arguments.

>
>>
>>>
>>>> Richard, the same UART case for you: I must write a UART baudrate
>>>> initialization. The method accepts a run-time specified baudrate. Strict
>>>> 3-rule TDD keeps me in the cycle
>>>>
>>>> - write test case (for a specific baudrate)
>>>> - adapt code to pass that case
>>>>
>>>> This leads to code that has a list of if's or equivalent. It passes all
>>>> the tests, but it is crappy code. Now Ian says: refactor! You seem to
>>>> say: no, don't do that. So how does your process lead me to good code?
>>>
>>> I say refactor after each commit and I would be most surprised if
>>> Richard disagreed.
>>
>> To quote Richard: "Instead of generalizing, I'm going to say that for
>> Uncle Bob's rules of TDD you should *literally* do them when learning TDD."
>>
>> Maybe the difference is in "when learning", but that leads me to ask how
>> I would learn anything (except how to write bad code) when refactoring
>> is not allowed.
>
> For me one major point pro unit testing (when I started) was refactoring.
> Refactoring during maintenance does result with major regressions without
> unit tests. It likely is some misunderstanding here since Uncle Bob does
> do it like all do (https://www.youtube.com/watch?v=y4_SJzNJnXU) and
> from video it is hopefully clear how unit tests help there.
> It is perhaps unfortunate that his TDD rules forget to mention it.

That is why I am pressing along about what the prponents really mean by 
TDD. If it is the three rules and just those I think it is stupid, if it 
includes refractoring it is surely worth considering.

It is of course totally obvious that having set of (regression) tests 
that is cheap to run is almost a prerequisite to refactoring. But that 
doesn't automatically require TDD.

Wouter van Ooijen

[toc] | [prev] | [next] | [standalone]


#41074

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2016-02-21 01:19 +0000
Message-ID<nab3bl$71n$1@news.xmission.com>
In reply to#41057
[Please do not mail me a copy of your followup]

Wouter van Ooijen <wouter@voti.nl> spake the secret code
<56c81ec1$0$4200$e4fe514c@newszilla.xs4all.nl> thusly:

>But, as I understand (both of you, correct me if I am wrong) the rules 
>that Richard wants to be followed strictly *exclude* refactoring, while 
>Ians rules *include* it. For me that's the difference between night and day.

The cycle is red, green, refactor.  The refactor step is essential.
Uncle Bob's rules prevent you from writing anything more than the
minimal code necessary to pass the test.  Minimal means you can't
extract new functions/methods to eliminate the duplication until the
tests are passing.  That's why the refactoring stage is essential.

The refactoring stage is also essential in making design an activity
that you do every few minutes all day long instead of a phase that you
do before you implement.  The only way to become a good designer of
code structures is to practice.  The best way to practice designing is
to do it all the time and TDD does that in quick cycles with feedback.
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://computergraphicsmuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

[toc] | [prev] | [next] | [standalone]


#41076

FromWouter van Ooijen <wouter@voti.nl>
Date2016-02-21 09:29 +0100
Message-ID<56c97575$0$4316$e4fe514c@newszilla.xs4all.nl>
In reply to#41074
Op 21-Feb-16 om 2:19 AM schreef Richard:
> [Please do not mail me a copy of your followup]
>
> Wouter van Ooijen <wouter@voti.nl> spake the secret code
> <56c81ec1$0$4200$e4fe514c@newszilla.xs4all.nl> thusly:
>
>> But, as I understand (both of you, correct me if I am wrong) the rules
>> that Richard wants to be followed strictly *exclude* refactoring, while
>> Ians rules *include* it. For me that's the difference between night and day.
>
> The cycle is red, green, refactor.  The refactor step is essential.

Ah, we are all on the same page now.

But that doesn't seem to be this page 
http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd , or did I 
somehow misread that page?

Wouter van Ooijen

[toc] | [prev] | [next] | [standalone]


#41082

FromPaul Sinnett <paul.sinnett@gmail.com>
Date2016-02-21 08:08 -0800
Message-ID<bcf862e1-8bc6-4cec-802e-c486711f78a3@googlegroups.com>
In reply to#41076
> Ah, we are all on the same page now.
> 
> But that doesn't seem to be this page 
> http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd , or did I 
> somehow misread that page?
> 
> Wouter van Ooijen

Try this one, it's newer, but also by Bob and explicitly includes the red/green/refactor cycle: http://blog.cleancoder.com/uncle-bob/2014/12/17/TheCyclesOfTDD.html

[toc] | [prev] | [next] | [standalone]


#41101

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2016-02-22 05:07 +0000
Message-ID<nae51p$9ab$1@news.xmission.com>
In reply to#41076
[Please do not mail me a copy of your followup]

Wouter van Ooijen <wouter@voti.nl> spake the secret code
<56c97575$0$4316$e4fe514c@newszilla.xs4all.nl> thusly:

>Op 21-Feb-16 om 2:19 AM schreef Richard:
>> [Please do not mail me a copy of your followup]
>>
>> Wouter van Ooijen <wouter@voti.nl> spake the secret code
>> <56c81ec1$0$4200$e4fe514c@newszilla.xs4all.nl> thusly:
>>
>>> But, as I understand (both of you, correct me if I am wrong) the rules
>>> that Richard wants to be followed strictly *exclude* refactoring, while
>>> Ians rules *include* it. For me that's the difference between night and day.
>>
>> The cycle is red, green, refactor.  The refactor step is essential.
>
>Ah, we are all on the same page now.
>
>But that doesn't seem to be this page 
>http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd , or did I 
>somehow misread that page?

I looked at that page after your post.  I don't know why he doesn't
mention refactoring on there.  My guess is that he's focused on when
and how you can introduce new functionality under strict TDD rules
because this is the part that most people get wrong when they try TDD.
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://computergraphicsmuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

[toc] | [prev] | [next] | [standalone]


#41115

FromMr Flibble <flibbleREMOVETHISBIT@i42.co.uk>
Date2016-02-22 19:44 +0000
Message-ID<HsudncNGuMFn-VbLnZ2dnUU7-QednZ2d@giganews.com>
In reply to#41101
On 22/02/2016 05:07, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> Wouter van Ooijen <wouter@voti.nl> spake the secret code
> <56c97575$0$4316$e4fe514c@newszilla.xs4all.nl> thusly:
>
>> Op 21-Feb-16 om 2:19 AM schreef Richard:
>>> [Please do not mail me a copy of your followup]
>>>
>>> Wouter van Ooijen <wouter@voti.nl> spake the secret code
>>> <56c81ec1$0$4200$e4fe514c@newszilla.xs4all.nl> thusly:
>>>
>>>> But, as I understand (both of you, correct me if I am wrong) the rules
>>>> that Richard wants to be followed strictly *exclude* refactoring, while
>>>> Ians rules *include* it. For me that's the difference between night and day.
>>>
>>> The cycle is red, green, refactor.  The refactor step is essential.
>>
>> Ah, we are all on the same page now.
>>
>> But that doesn't seem to be this page
>> http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd , or did I
>> somehow misread that page?
>
> I looked at that page after your post.  I don't know why he doesn't
> mention refactoring on there.  My guess is that he's focused on when
> and how you can introduce new functionality under strict TDD rules
> because this is the part that most people get wrong when they try TDD.

TDD and classic refactoring are in conflict. TDD is bollocks pure and 
simple.

/Flibble

[toc] | [prev] | [next] | [standalone]


#41117

FromIan Collins <ian-news@hotmail.com>
Date2016-02-23 08:58 +1300
Message-ID<dj17jaFj7j6U9@mid.individual.net>
In reply to#41115
Mr Flibble wrote:
>
> TDD and classic refactoring are in conflict. TDD is bollocks pure and
> simple.

How is your considered critique coming along?

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#41119

FromMr Flibble <flibbleREMOVETHISBIT@i42.co.uk>
Date2016-02-22 20:13 +0000
Message-ID<MKKdnT3TTvki9lbLnZ2dnUU7-LWdnZ2d@giganews.com>
In reply to#41117
On 22/02/2016 19:58, Ian Collins wrote:
> Mr Flibble wrote:
>>
>> TDD and classic refactoring are in conflict. TDD is bollocks pure and
>> simple.
>
> How is your considered critique coming along?

I do hope you are writing that whilst saying it out loud in Stewie 
Griffin's voice.

/Flibble

[toc] | [prev] | [next] | [standalone]


#41123

FromIan Collins <ian-news@hotmail.com>
Date2016-02-23 09:19 +1300
Message-ID<dj18reFj7j6U11@mid.individual.net>
In reply to#41119
Mr Flibble wrote:
> On 22/02/2016 19:58, Ian Collins wrote:
>> Mr Flibble wrote:
>>>
>>> TDD and classic refactoring are in conflict. TDD is bollocks pure and
>>> simple.
>>
>> How is your considered critique coming along?
>
> I do hope you are writing that whilst saying it out loud in Stewie
> Griffin's voice.

Who?

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#41124

FromMr Flibble <flibbleREMOVETHISBIT@i42.co.uk>
Date2016-02-22 20:21 +0000
Message-ID<M9adnWUuwslW8FbLnZ2dnUU7-YvOydjZ@giganews.com>
In reply to#41123
On 22/02/2016 20:19, Ian Collins wrote:
> Mr Flibble wrote:
>> On 22/02/2016 19:58, Ian Collins wrote:
>>> Mr Flibble wrote:
>>>>
>>>> TDD and classic refactoring are in conflict. TDD is bollocks pure and
>>>> simple.
>>>
>>> How is your considered critique coming along?
>>
>> I do hope you are writing that whilst saying it out loud in Stewie
>> Griffin's voice.
>
> Who?

https://www.youtube.com/watch?v=NTSGp4UdEvQ

/Flibble

[toc] | [prev] | [next] | [standalone]


#41122

FromWouter van Ooijen <wouter@voti.nl>
Date2016-02-22 21:18 +0100
Message-ID<56cb6d08$0$4029$e4fe514c@newszilla.xs4all.nl>
In reply to#41115
Op 22-Feb-16 om 8:44 PM schreef Mr Flibble:
> On 22/02/2016 05:07, Richard wrote:
>> [Please do not mail me a copy of your followup]
>>
>> Wouter van Ooijen <wouter@voti.nl> spake the secret code
>> <56c97575$0$4316$e4fe514c@newszilla.xs4all.nl> thusly:
>>
>>> Op 21-Feb-16 om 2:19 AM schreef Richard:
>>>> [Please do not mail me a copy of your followup]
>>>>
>>>> Wouter van Ooijen <wouter@voti.nl> spake the secret code
>>>> <56c81ec1$0$4200$e4fe514c@newszilla.xs4all.nl> thusly:
>>>>
>>>>> But, as I understand (both of you, correct me if I am wrong) the rules
>>>>> that Richard wants to be followed strictly *exclude* refactoring,
>>>>> while
>>>>> Ians rules *include* it. For me that's the difference between night
>>>>> and day.
>>>>
>>>> The cycle is red, green, refactor.  The refactor step is essential.
>>>
>>> Ah, we are all on the same page now.
>>>
>>> But that doesn't seem to be this page
>>> http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd , or did I
>>> somehow misread that page?
>>
>> I looked at that page after your post.  I don't know why he doesn't
>> mention refactoring on there.  My guess is that he's focused on when
>> and how you can introduce new functionality under strict TDD rules
>> because this is the part that most people get wrong when they try TDD.
>
> TDD and classic refactoring are in conflict.

Explaining the conflict would be more usefull than just asserting that 
there is a conflict.

And why the 'classic'? You see to imply that TDD is not in conflict with 
some other type of refactoring?

 > TDD is bollocks pure and simple.

Again, providing details is more usefull than a simple assertion. And as 
a lengthy discussion has shown me, it is usefull to state what you think 
TDD is exactly. I would agree with you when TDD == (the three rules 
without refactoring), but that seems to be a strawman.

Wouter van Ooijen

[toc] | [prev] | [next] | [standalone]


#41157

FromJuha Nieminen <nospam@thanks.invalid>
Date2016-02-23 09:14 +0000
Message-ID<nah7ta$47g$1@adenine.netfront.net>
In reply to#41122
Wouter van Ooijen <wouter@voti.nl> wrote:
> Op 22-Feb-16 om 8:44 PM schreef Mr Flibble:
>> TDD and classic refactoring are in conflict.
> 
> Explaining the conflict would be more usefull than just asserting that 
> there is a conflict.

I can't even begin to imagine how there is a conflict. Seems pretty
straightforward to me: If you need to change something in the code
(from TDD's point of view usually something that affects a public
interface), you first change the test, then you change the code.
I honestly cannot see what the "conflict" is...

Refactoring that's internal to a class/module (ie. does not affect
external behavior) often doesn't even need changing the tests.

Especially in the latter case it sounds more to me that TDD aids
in refactoring because you immediately have a basic set of tests
to make sure that your changes didn't break anything. (Sure, TDD
doesn't test it 100%, but even the basic tests help quite a lot.)

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#41159

FromIan Collins <ian-news@hotmail.com>
Date2016-02-23 22:21 +1300
Message-ID<dj2ml0Fj7j6U12@mid.individual.net>
In reply to#41157
Juha Nieminen wrote:
> Wouter van Ooijen <wouter@voti.nl> wrote:
>> Op 22-Feb-16 om 8:44 PM schreef Mr Flibble:
>>> TDD and classic refactoring are in conflict.
>>
>> Explaining the conflict would be more usefull than just asserting that
>> there is a conflict.
>
> I can't even begin to imagine how there is a conflict. Seems pretty
> straightforward to me: If you need to change something in the code
> (from TDD's point of view usually something that affects a public
> interface), you first change the test, then you change the code.
> I honestly cannot see what the "conflict" is...
>
> Refactoring that's internal to a class/module (ie. does not affect
> external behavior) often doesn't even need changing the tests.
>
> Especially in the latter case it sounds more to me that TDD aids
> in refactoring because you immediately have a basic set of tests
> to make sure that your changes didn't break anything. (Sure, TDD
> doesn't test it 100%, but even the basic tests help quite a lot.)

It certainly does aid in refactoring.  I don't know from where he 
conjures up his nonsense, some odd fortune cookies maybe?

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#41170

FromMr Flibble <flibbleREMOVETHISBIT@i42.co.uk>
Date2016-02-23 17:33 +0000
Message-ID<d8SdnWjvbKV5ClHLnZ2dnUU7-fudnZ2d@giganews.com>
In reply to#41159
On 23/02/2016 09:21, Ian Collins wrote:
> Juha Nieminen wrote:
>> Wouter van Ooijen <wouter@voti.nl> wrote:
>>> Op 22-Feb-16 om 8:44 PM schreef Mr Flibble:
>>>> TDD and classic refactoring are in conflict.
>>>
>>> Explaining the conflict would be more usefull than just asserting that
>>> there is a conflict.
>>
>> I can't even begin to imagine how there is a conflict. Seems pretty
>> straightforward to me: If you need to change something in the code
>> (from TDD's point of view usually something that affects a public
>> interface), you first change the test, then you change the code.
>> I honestly cannot see what the "conflict" is...
>>
>> Refactoring that's internal to a class/module (ie. does not affect
>> external behavior) often doesn't even need changing the tests.
>>
>> Especially in the latter case it sounds more to me that TDD aids
>> in refactoring because you immediately have a basic set of tests
>> to make sure that your changes didn't break anything. (Sure, TDD
>> doesn't test it 100%, but even the basic tests help quite a lot.)
>
> It certainly does aid in refactoring.  I don't know from where he
> conjures up his nonsense, some odd fortune cookies maybe?

Nonsense? It is self evident that it is TDD that is nonsense; not only 
does it hinder designing things properly it also prevents you 
refactoring a design to make it even better. TDD is considered harmful.

/Flibble

[toc] | [prev] | [next] | [standalone]


Page 3 of 4 — ← Prev page 1 2 [3] 4  Next page →

Back to top | Article view | comp.lang.c++


csiph-web