Re: [testdrivendevelopment] "bottom-up" TDD and common behaviors

"Alan Baljeu via Groups.Io" <[email protected]> Mon, 2 Dec 2019 12:26:08 +0000 (UTC)
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <[email protected]>
------=_Part_7540325_1801561953.1575289568249
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

The way I test if animals have updatable fields, I try to update a field an=
d check that it updated.
Alan [email protected]
=20

    On Sunday, December 1, 2019, 07:16:01 p.m. EST, Brian Marick <marick@e=
xampler.com> wrote:
=20
 What I=E2=80=99m guessing is that you invent an assertion that, when true=
 of the return value, implies that it has been made =E2=80=9Cwith updatable=
 fields=E2=80=9D. So it=E2=80=99s a property of the data rather than a prop=
erty of how it was created.
Yeah, that probably makes sense. Forget I asked.


On Dec 1, 2019, at 6:07 PM, Brian Marick <[email protected]> wrote:
Here=E2=80=99s some code I have:
<Screen Shot 2019-12-01 at 5.55.54 PM.png>

Here=E2=80=99s a correctness claim about that code: =E2=80=9Cany function =
that returns one or more Animals must ensure that those animals have =E2=80=
=
=98updatable fields=E2=80=99=E2=80=9D. I come from a mockish tradition, in=
 which that claim would be stated directly by an assertion that `put_updata=
ble_fields` would be called and be used as the return value.=C2=A0
I=E2=80=99ve been trying to do non-mockish testing in this app, and I=E2=
=80=99ve gotten myself all bollixed up. Without mocks, what would tests fo=
r these four functions look like?
I think I once knew the answers to such questions, but I can=E2=80=99t rem=
ember them.



-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#35791): https://groups.io/g/testdrivendevelopment/mess=
age/35791
Mute This Topic: https://groups.io/mt/64491946/3268755
Group Owner: [email protected]
Unsubscribe: https://groups.io/g/testdrivendevelopment/leave/6156322/74455=
6386/xyzzy  [[email protected]]
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-


------=_Part_7540325_1801561953.1575289568249
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div class=3D"ydpa365fa66yahoo-style-wrap" style=
=3D"font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16p=
x;"><div><div dir=3D"ltr" data-setdir=3D"false">The way I test if animals h=
ave updatable fields, I try to update a field and check that it updated.</d=
iv><div><br></div><div class=3D"ydpa365fa66signature"><div style=3D"font-fa=
mily:Helvetica, Arial, sans-serif;font-size:16px;"><span><div style=3D"colo=
r:rgb(0, 0, 0);font-family:Helvetica, Arial, sans-serif;font-size:16px;"><d=
iv class=3D"ydp6631cd6bsignature">Alan Baljeu</div></div><div class=3D"ydp6=
631cd6bsignature" style=3D"color:rgb(0, 0, 0);font-family:Helvetica, Arial,=
 sans-serif;font-size:16px;">[email protected]</div><div class=3D"ydp663=
1cd6bsignature" style=3D"color:rgb(0, 0, 0);font-family:Helvetica, Arial, s=
ans-serif;font-size:16px;"><br></div></span></div></div></div>
        <div><br></div><div><br></div>

        </div><div id=3D"ydp31b50204yahoo_quoted_5292360636" class=3D"ydp3=
1b50204yahoo_quoted">
            <div style=3D"font-family:'Helvetica Neue', Helvetica, Arial, =
sans-serif;font-size:13px;color:#26282a;">

                <div>
                    On Sunday, December 1, 2019, 07:16:01 p.m. EST, Brian =
Marick &lt;[email protected]&gt; wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id=3D"ydp31b50204yiv9317728238"><div>What I=E2=
=80=99m guessing is that you invent an assertion that, when true of the re=
turn value, implies that it has been made =E2=80=9Cwith updatable fields=E2=
=
=80=9D. So it=E2=80=99s a property of the data rather than a property of h=
ow it was created.<div class=3D"ydp31b50204yiv9317728238"><br class=3D"ydp3=
1b50204yiv9317728238"></div><div class=3D"ydp31b50204yiv9317728238">Yeah, t=
hat probably makes sense. Forget I asked.<br class=3D"ydp31b50204yiv9317728=
238"><div><br class=3D"ydp31b50204yiv9317728238"><blockquote type=3D"cite" =
class=3D"ydp31b50204yiv9317728238"><div class=3D"ydp31b50204yiv9317728238">=
On Dec 1, 2019, at 6:07 PM, Brian Marick &lt;<a href=3D"mailto:marick@examp=
ler.com" class=3D"ydp31b50204yiv9317728238" rel=3D"nofollow" target=3D"_bla=
nk">[email protected]</a>&gt; wrote:</div><br class=3D"ydp31b50204yiv9317=
728238Apple-interchange-newline"><div class=3D"ydp31b50204yiv9317728238"><d=
iv class=3D"ydp31b50204yiv9317728238">Here=E2=80=99s some code I have:<div =
class=3D"ydp31b50204yiv9317728238"><br class=3D"ydp31b50204yiv9317728238"><=
/div><div class=3D"ydp31b50204yiv9317728238"><span id=3D"ydp31b50204yiv9317=
728238cid:E046400A-A2BB-4A13-8014-3FC69D7B77ED">&lt;Screen Shot 2019-12-01 =
at 5.55.54 PM.png&gt;</span></div><div class=3D"ydp31b50204yiv9317728238"><=
br class=3D"ydp31b50204yiv9317728238"></div><div class=3D"ydp31b50204yiv931=
7728238"><br class=3D"ydp31b50204yiv9317728238"></div><div class=3D"ydp31b5=
0204yiv9317728238">Here=E2=80=99s a correctness claim about that code: =E2=
=80=9Cany function that returns one or more Animals must ensure that those=
 animals have =E2=80=98updatable fields=E2=80=99=E2=80=9D. I come from a mo=
ckish tradition, in which that claim would be stated directly by an asserti=
on that `put_updatable_fields` would be called and be used as the return va=
lue.&nbsp;</div><div class=3D"ydp31b50204yiv9317728238"><br class=3D"ydp31b=
50204yiv9317728238"></div><div class=3D"ydp31b50204yiv9317728238">I=E2=80=
=99ve been trying to do non-mockish testing in this app, and I=E2=80=99ve =
gotten myself all bollixed up. Without mocks, what would tests for these fo=
ur functions look like?</div><div class=3D"ydp31b50204yiv9317728238"><br cl=
ass=3D"ydp31b50204yiv9317728238"></div><div class=3D"ydp31b50204yiv93177282=
38">I think I once knew the answers to such questions, but I can=E2=80=99t =
remember them.</div></div>


</div></blockquote></div><br class=3D"ydp31b50204yiv9317728238"></div></di=
v>


</div></div>
            </div>
        </div></body></html>

<div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div>
<hr>
Groups.io Links:<p>

You receive all messages sent to this group.


<p>

<a target=3D"_blank" href=3D"https://groups.io/g/testdrivendevelopment/mes=
sage/35791">View/Reply Online (#35791)</a> |


  <a target=3D"_blank" href=3D"mailto:[email protected]?subj=
ect=3DRe:%20Re%3A%20%5Btestdrivendevelopment%5D%20%22bottom-up%22%20TDD%20a=
nd%20common%20behaviors">Reply To Group</a>
  
    | <a target=3D"_blank" href=3D"mailto:[email protected]?subject=3DP=
rivate:%20Re:%20Re%3A%20%5Btestdrivendevelopment%5D%20%22bottom-up%22%20TDD=
%20and%20common%20behaviors">Reply To Sender</a>
  


|


  
    <a target=3D"_blank" href=3D"https://groups.io/mt/64491946/3268755">Mu=
te This Topic</a>
  

| <a href=3D"https://groups.io/g/testdrivendevelopment/post">New Topic</a>=
<br>



<br>

<a href=3D"https://groups.io/g/testdrivendevelopment/editsub/3268755">Your=
 Subscription</a> |
<a href=3D"mailto:[email protected]">Contact Group Own=
er</a> |

<a href=3D"https://groups.io/g/testdrivendevelopment/leave/6156322/7445563=
86/xyzzy">Unsubscribe</a>

 [[email protected]]<br>
<div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div>


------=_Part_7540325_1801561953.1575289568249--