Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #40966 > unrolled thread
| Started by | Juha Nieminen <nospam@thanks.invalid> |
|---|---|
| First post | 2016-02-15 21:49 +0000 |
| Last post | 2016-02-18 21:30 +0000 |
| Articles | 15 on this page of 75 — 11 participants |
Back to article view | Back to comp.lang.c++
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 4 of 4 — ← Prev page 1 2 3 [4]
| From | Wouter van Ooijen <wouter@voti.nl> |
|---|---|
| Date | 2016-02-23 19:28 +0100 |
| Message-ID | <56cca4e6$0$4352$e4fe514c@newszilla.xs4all.nl> |
| In reply to | #41170 |
Op 23-Feb-16 om 6:33 PM schreef Mr Flibble: > 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 You might be right, but you will only be listened to when you explain. > it also prevents you > refactoring a design to make it even better. Again, explain how. > TDD is considered harmful. If that is true, only the force of your *arguments* will stop it. So far, a few TDD proponents gave me arguments (in favour, of course). As yet, you gave none. Do you want me (and other readers) to make up my mind just based on the arguments of the proponents? (That would put you on their side!) Wouter
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2016-02-24 08:43 +1300 |
| Message-ID | <dj3r3pFj7j6U13@mid.individual.net> |
| In reply to | #41170 |
Mr Flibble wrote: > 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? Yes 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. Where is your evidence and analysis? How can a process which incorporates refactoring prevent it? I assume you don't post any evidence because you don't have any and can't provide a coherent analysis of your own. So you just keep repeating "the sky is green" hoping it is. Repetition isn't argument. > TDD is considered harmful. By whom? References please. -- Ian Collins
[toc] | [prev] | [next] | [standalone]
| From | Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> |
|---|---|
| Date | 2016-02-23 20:13 +0000 |
| Message-ID | <eaKdnQpRtrXnIFHLnZ2dnUU7-VOdnZ2d@giganews.com> |
| In reply to | #41181 |
On 23/02/2016 19:43, Ian Collins wrote: > Mr Flibble wrote: >> 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? > > Yes 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. > > Where is your evidence and analysis? How can a process which > incorporates refactoring prevent it? > > I assume you don't post any evidence because you don't have any and > can't provide a coherent analysis of your own. So you just keep > repeating "the sky is green" hoping it is. Repetition isn't argument. > >> TDD is considered harmful. > > By whom? References please. The fundamental problem here is your sense of dread at the amount of time you have invested into TDD and your unwillingness to lose face if you back out of it now. You have to justify the contents of your CV right? I am sorry you have put so much effort into TDD mate but you have been and still are doing it wrong. Unit testing is great; TDD isn't. TDD is considered harmful. /Flibble
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2016-02-23 20:53 +0000 |
| Message-ID | <87a8mrgnd2.fsf@gmail.com> |
| In reply to | #41183 |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> writes: > The fundamental problem here is your sense of dread at the amount of > time you have invested into TDD and your unwillingness to lose face if > you back out of it now I believe this is known as "projection"
[toc] | [prev] | [next] | [standalone]
| From | legalize+jeeves@mail.xmission.com (Richard) |
|---|---|
| Date | 2016-02-24 17:12 +0000 |
| Message-ID | <nako9t$6q5$1@news.xmission.com> |
| In reply to | #41185 |
[Please do not mail me a copy of your followup]
Gareth Owen <gwowen@gmail.com> spake the secret code
<87a8mrgnd2.fsf@gmail.com> thusly:
>Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> writes:
>
>> The fundamental problem here is your sense of dread at the amount of
>> time you have invested into TDD and your unwillingness to lose face if
>> you back out of it now
>
>I believe this is known as "projection"
This really did make me laugh out loud.
I have been programming for a really long time (decades) and been doing
TDD since roughly 2007. During that time I have always sought to learn
new ways of programming to improve my productivity and/or the quality
of the code I produce. I value quality, so I am willing to sacrifice
some productivity in order to obtain better quality. TDD was the
first thing that felt like I didn't have to give up productivity in
order to obtain quality, provided we look at the total time spent
developing a feature and not just the time it took to type in the
code and make it compile.
In practical terms, this means that I am willing to write automated tests
around my code in order to prove that my code works now and continues
to work properly in the future. Clearly that could be a net productivity
loss in the short-term because I spent the time to write the automated
tests. When you're the first person on the team to write some
automated tests, you also have to introduce the infrastructure to
support such tests into the code base.
I say short-term productivity cost because the time spent writing tests
and finding stupid mistakes early is offset by time spent later in the
debugger finding the cause of strange bugs reported by other developers
on my team, the testing team or customers. I am very proficient in a
debugger so most of the time I am able to quickly identify the root
cause of a bug with the debugger. However, I find the same stupid
mistakes more efficiently when I write automated tests around my code.
I haven't really noticed a significant decline in my error rate over
time, but the tools I use are more adept at finding my mistakes so the
total time between creation, discovery and correction of mistakes has
been made shorter over time. TDD doesn't reduce my error rate but it
does reduce the total time spent identifying and correcting errors.
In earlier posts I have described the benefit of changing design from
a phase to a daily activity that I have found when practicing TDD.
As a result I get better designs from my code and the code I produce
is consistent with the advice from leaders in the field of
programming, both specific to C++ and more generally.
The design benefits and the quality benefits are why TDD works for me.
If you are more productive doing something else, then great for you.
My case for TDD is purely based on the pragmatic benefits I've seen
in my personal experience. That personal experience is echoed across
enough developers that it's not just a fluke that happens to work for me.
The experience is pretty consistent across languages and personality types
and so-on and this is why Uncle Bob says it is simply unprofessional if
you don't do something like TDD when you write code for a living. He
is intentionally making a provocative statement when he says that. He
is also making the argument from a pragmatic perspective; he does not
say TDD is a silver bullet, he says it is the best thing he has found
so far. If you have something better, please show it to him.
Am I ideologically invested in TDD? No.
Am I pragmatically invested in TDD? Yes.
Show me something better and I'll do that. Simply saying TDD sucks or
whatever isn't enough to convince me to give up the pragmatic benefits
that I have found by practicing TDD. Particularly when the thing I'm
being told to do is the thing I was already doing proficiently for decades
before I came to practice TDD. In essence, the argument is regressive
and telling me to give up the benefits I've gained from 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]
| From | Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> |
|---|---|
| Date | 2016-02-24 18:05 +0000 |
| Message-ID | <poednUWsOIKZbFDLnZ2dnUU7-U-dnZ2d@giganews.com> |
| In reply to | #41223 |
On 24/02/2016 17:12, Richard wrote: > In earlier posts I have described the benefit of changing design from > a phase to a daily activity that I have found when practicing TDD. > As a result I get better designs from my code and the code I produce > is consistent with the advice from leaders in the field of > programming, both specific to C++ and more generally. I doubt that very much. Designing software by fixing failing tests is not software design at all and for this reason I suspect the quality of your TDD driven designs is very poor. *Good* software design is: 1) Thinking about system architecture; 2) Based on 1) designing the software architecture; 3) Thinking about abstractions; 4) Based on 2) and 3) designing interfaces; 5) Based on 3) and 4) designing class hierarchies and concrete classes; 6) Designing object hierarchies, and object lifetime envelopes. *Good* software design is not: 1) Make a failing test pass. Obviously requirements gathering and analysis is a given. /Flibble
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2016-02-24 09:53 +1300 |
| Message-ID | <dj3v72Fj7j3U1@mid.individual.net> |
| In reply to | #41183 |
Mr Flibble wrote: > > The fundamental problem here is your sense of dread at the amount of > time you have invested into TDD and your unwillingness to lose face if > you back out of it now. No, the fundamental problem here is you keep repeating the same bollocks without any evidence to back it up. Present some or admit you don't have any. > You have to justify the contents of your CV > right? Nope, the evidence speaks for its self. > Unit testing is great; TDD isn't. TDD is considered harmful. The sky is green. -- Ian Collins
[toc] | [prev] | [next] | [standalone]
| From | Gareth Owen <gwowen@gmail.com> |
|---|---|
| Date | 2016-02-23 21:09 +0000 |
| Message-ID | <878u2b9lsf.fsf@gmail.com> |
| In reply to | #41186 |
Ian Collins <ian-news@hotmail.com> writes: > The sky is green. I think you'll find the sky is *considered* green.
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2016-02-23 22:22 +0100 |
| Message-ID | <naiid0$i9c$1@dont-email.me> |
| In reply to | #41187 |
On 23/02/16 22:09, Gareth Owen wrote: > Ian Collins <ian-news@hotmail.com> writes: > >> The sky is green. > > I think you'll find the sky is *considered* green. > Apparently* the ancient Greeks considered it to be a sort of bronze colour, because they didn't have a word for "blue". Maybe Mr. Flibble considers TDD to be harmful because he doesn't have a word for "useful". * According to the infallible QI elves. What more evidence could one ask for?
[toc] | [prev] | [next] | [standalone]
| From | legalize+jeeves@mail.xmission.com (Richard) |
|---|---|
| Date | 2016-02-21 01:21 +0000 |
| Message-ID | <nab3fk$71n$2@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.
I've given a workshop at C++ Now 2014 on TDD in C++. You should look at
the slides and associated code to understand how I present TDD:
<https://github.com/boostcon/cppnow_presentations_2014/tree/master/files/test_driven>
--
"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]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2016-02-18 21:24 +1300 |
| Message-ID | <dilddeFo6vkU4@mid.individual.net> |
| In reply to | #41023 |
Ian Collins wrote:
> Wouter van Ooijen wrote:
>> Op 18-Feb-16 om 8:42 AM schreef Ian Collins:
>>> Wouter van Ooijen wrote:
>>>> Op 17-Feb-16 om 11:19 PM schreef Ian Collins:
>>>>>
>>>>> Let me ask you why you wouldn't obey the rules for say a device driver?
>>>>> I certainly do and for such low level fiddly code I find TDD to be an
>>>>> ideal tool. I like to step through, almost bit by bit, tasks such as
>>>>> setting up device registers. The steps, both conceptually and in code,
>>>>> are small and ideally suited to an incremental test/code/refactor cycle
>>>>> such as TDD. Being close to a pure coding exercise, any objections to
>>>>> TDD and design are irrelevant at this level.
>>>>
>>>> Let's say I write code for a UART to transmit data at a (run-time)
>>>> specified baudrate. What would your (first) test be?
>>>
>>> It wouldn't be the first test (there would be more generic configuration
>>> to test first),
>>
>> such as?
>
> That depends on the device, if the UART is stand alone, there might not
> be any but if it is part of a processor, there will probably
> configuration registers that have to be setup before the UART can be used.
>
>>> but the last test for the requirement would be that the
>>> drive sits the correct bits in the the appropriate configuration
>>> register(s).
>>
>> But how do you determine what is the correct setting (or: how do you
>> make sure that the settings you have determined have the desired effect)?
>
> The device specification!
>
> I actually wrote tests for a UART driver on an ARM STM32 processor last
> year. To verify the settings I had a block of mapped memory at the
> appropriate address for the device registers and simply tested for the
> correct values getting written.
An example:
void
TestUART::testConstructDeviceOneAssignsCorrectBaudRateDivider()
{
const auto baudRate = 100;
const auto clockFrequency = 1000;
test::STM32F3xxuPClockDriver_GetClock::willReturn(clockFrequency);
STM32F3xxUARTDriver( STM32F3xxUARTDriver::USARTPort1, nullptr, 0,
baudRate );
TS_ASSERT_EQUALS( clockFrequency/baudRate, usart1->BRR );
}
test::STM32F3xxuPClockDriver_GetClock is a mock for another interface,
usart1 is an address defined in one of the headers.
--
Ian Collins
[toc] | [prev] | [next] | [standalone]
| From | Vir Campestris <vir.campestris@invalid.invalid> |
|---|---|
| Date | 2016-02-18 21:27 +0000 |
| Message-ID | <Se-dnayrfrilqlvLnZ2dnUU78LOdnZ2d@brightview.co.uk> |
| In reply to | #41011 |
On 17/02/2016 22:19, Ian Collins wrote: > Let me ask you why you wouldn't obey the rules for say a device driver? > I certainly do and for such low level fiddly code I find TDD to be an > ideal tool. I like to step through, almost bit by bit, tasks such as > setting up device registers. The steps, both conceptually and in code, > are small and ideally suited to an incremental test/code/refactor cycle > such as TDD. Being close to a pure coding exercise, any objections to > TDD and design are irrelevant at this level. I'm working on an ALSA driver for an embedded device at the moment. I can't find any decent specs, the hardware doesn't seem to quite behave, and the calls from the kernel are... odd. I have a slight feeling that the whole of Linux was thrown together by a bunch of hackers (good ones) and that the kernel for my device has been changed by other hackers. None of them wrote down what they were intending to do, so when I look at different drivers that do things in different ways I can't really tell which is the new way, and which the old. I can't really write any tests at all - I can't really tell what it's supposed to do, beyond make a noise. And since the I2S DMA is broken that's a long way off. Andy
[toc] | [prev] | [next] | [standalone]
| From | legalize+jeeves@mail.xmission.com (Richard) |
|---|---|
| Date | 2016-02-18 17:48 +0000 |
| Message-ID | <na5060$2vm$1@news.xmission.com> |
| In reply to | #41010 |
[Please do not mail me a copy of your followup]
Wouter van Ooijen <wouter@voti.nl> spake the secret code
<56c4ef61$0$4197$e4fe514c@newszilla.xs4all.nl> thusly:
>Op 17-Feb-16 om 10:08 PM schreef Richard:
>> [Please do not mail me a copy of your followup]
>>
>> Wouter van Ooijen <wouter@voti.nl> spake the secret code
>> <56c4b474$0$4233$e4fe514c@newszilla.xs4all.nl> thusly:
>>
>>> PS Uncle Bob *does* claim that TTD is *the* tool to apply to every
>>> programming problem.
>>
>> What I've seen him claim is that he hasn't found anything better than
>> TDD. If you can show him something better than TDD, then he'll be
>> talking about that.
>>
>> If you have something you think is better than TDD, bring it Uncle Bob
>> and get him to champion it. If you can convince Uncle Bob, I'm very
>> interested in hearing about it.
>
>I'd rather convert [...]
Three words in and we're already into a straw man.
You present an opinion that is against TDD and you put words in Uncle
Bob's mouth so that you can conveniently make him out to be a zealout
and demolish the straw man.
When I point out that Uncle Bob is adopting a position based on
evidence and experience (not just his, but the experience of many
people), you invent another straw man turning it into a religious
debate.
Positions adopted based on evidence and supporting experience (the team
at IBM, the team at MS, etc.) are not religious positions.
When I see you respond this way, it makes you out to be the religious
zealout, not Uncle Bob.
--
"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]
| From | Wouter van Ooijen <wouter@voti.nl> |
|---|---|
| Date | 2016-02-18 19:04 +0100 |
| Message-ID | <56c607a1$0$4295$e4fe514c@newszilla.xs4all.nl> |
| In reply to | #41034 |
Op 18-Feb-16 om 6:48 PM schreef Richard: > [Please do not mail me a copy of your followup] > > Wouter van Ooijen <wouter@voti.nl> spake the secret code > <56c4ef61$0$4197$e4fe514c@newszilla.xs4all.nl> thusly: > >> Op 17-Feb-16 om 10:08 PM schreef Richard: >>> [Please do not mail me a copy of your followup] >>> >>> Wouter van Ooijen <wouter@voti.nl> spake the secret code >>> <56c4b474$0$4233$e4fe514c@newszilla.xs4all.nl> thusly: >>> >>>> PS Uncle Bob *does* claim that TTD is *the* tool to apply to every >>>> programming problem. >>> >>> What I've seen him claim is that he hasn't found anything better than >>> TDD. If you can show him something better than TDD, then he'll be >>> talking about that. >>> >>> If you have something you think is better than TDD, bring it Uncle Bob >>> and get him to champion it. If you can convince Uncle Bob, I'm very >>> interested in hearing about it. >> >> I'd rather convert [...] > > Three words in and we're already into a straw man. > > You present an opinion that is against TDD and you put words in Uncle > Bob's mouth so that you can conveniently make him out to be a zealout > and demolish the straw man. I did not put any words in his mouth (can you quote any that I did put in?), I just expressed (in a tongue-in-cheeck way) that I don't have much faith in converting him. Maybe more interesting is what I wrote after that fragment: I don't like the three rules when they are interpreted literally. The few talks by Uncle Bob that I have seen seem to indicate that he does. In the follow up I had a reasonable discussion with Ian, which we will probably continue when our timezones permit it. If you want to contribute to the real discussion you are welcome. My main pain point is that to me the rules seem to force me to write only one failing test case, and then just correct the code to pass that case. Other people talk about refactoring, but the three rules don't mention that, so following the 3 rules (and only the 3 rules, as Bob repeatly states in his talks) religiously seems (to me) to rule out refactoring, which seems absurd to me. Wouter van Ooijen
[toc] | [prev] | [next] | [standalone]
| From | Vir Campestris <vir.campestris@invalid.invalid> |
|---|---|
| Date | 2016-02-18 21:30 +0000 |
| Message-ID | <Se-dna-rfrh7qlvLnZ2dnUU78LOdnZ2d@brightview.co.uk> |
| In reply to | #40997 |
On 17/02/2016 11:26, Juha Nieminen wrote: > I don't think anybody (who knows anything) is claiming that TDD is > the silver bullet, the perfect tool for every possible situation. Extreme Programming. (We did the training course - then decided not to do it) Andy
[toc] | [prev] | [standalone]
Page 4 of 4 — ← Prev page 1 2 3 [4]
Back to top | Article view | comp.lang.c++
csiph-web