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

"Avi Kessner" <[email protected]> Wed, 4 Dec 2019 08:43:57 +0200
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <CAGEhWpEncftFGE-Zx93NQTVho=0KsrvBs=UtBf-f41FahrGNKA@mail.gmail.com>
--000000000000d322a70598db23cb
Content-Type: text/plain; charset="UTF-8"

So this is definitely required behavior and it will be your own, so it
needs to be tested.
On the other hand, it's a very specific implementation detail which could
change when the technology changes and we don't want that to impact actual
behavior related tests about animals.

What I would do is make a transformation decorator and then test sample
data to see that it gets transformed correctly.  If Ecto ever changes, that
transformation decorator can do nothing if needed.
You basically need a map of fields that can be changed and the
transformation needed for that field.

A bit more work, but it allows for a change in Ecto or a change in
understanding of Ecto to not impact the main test suite.

On Wed, Dec 4, 2019, 01:50 Brian Marick <[email protected]> wrote:

> Yes.
>
> On Dec 3, 2019, at 5:31 AM, Avi Kessner <[email protected]> wrote:
>
> If I understand correctly, the code here is specifically for doing an Ecto
> transformation, correct? If you decide not to use Ecto the need for this
> abstraction is removed?
>
>
> 
>

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

View/Reply Online (#35806): https://groups.io/g/testdrivendevelopment/message/35806
Mute This Topic: https://groups.io/mt/64491946/3268755
Group Owner: [email protected]
Unsubscribe: https://groups.io/g/testdrivendevelopment/leave/6156322/744556386/xyzzy  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


--000000000000d322a70598db23cb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">So this is definitely required behavior and it will be yo=
ur own, so it needs to be tested.<div dir=3D"auto">On the other hand, it&#3=
9;s a very specific implementation detail which could change when the techn=
ology changes and we don&#39;t want that to impact actual behavior related =
tests about animals.</div><div dir=3D"auto"><br></div><div dir=3D"auto">Wha=
t I would do is make a transformation decorator and then test sample data t=
o see that it gets transformed correctly.=C2=A0 If Ecto ever changes, that =
transformation decorator can do nothing if needed.</div><div dir=3D"auto">Y=
ou basically need a map of fields that can be changed and the transformatio=
n needed for that field.</div><div dir=3D"auto"><br></div><div dir=3D"auto"=
>A bit more work, but it allows for a change in Ecto or a change in underst=
anding of Ecto to not impact the main test suite.</div></div><br><div class=
=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 4, 2019=
, 01:50 Brian Marick &lt;<a href=3D"mailto:[email protected]">marick@exam=
pler.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style=
=3D"word-wrap:break-word;line-break:after-white-space"><div style=3D"word-=
wrap:break-word;line-break:after-white-space">Yes.<br><div><br><blockquote =
type=3D"cite"><div>On Dec 3, 2019, at 5:31 AM, Avi Kessner &lt;<a href=3D"m=
ailto:[email protected]" target=3D"_blank" rel=3D"noreferrer">akessner@gma=
il.com</a>&gt; wrote:</div><br><div><span style=3D"font-family:Helvetica;fo=
nt-size:16px;font-style:normal;font-variant-caps:normal;font-weight:normal;=
letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;=
white-space:normal;word-spacing:0px;text-decoration:none;float:none;display=
:inline!important">If I understand correctly, the code here is specifically=
=
=C2=A0for doing an Ecto transformation, correct? If you decide not to use =
Ecto the need for this abstraction is removed?</span><br style=3D"font-fami=
ly:Helvetica;font-size:16px;font-style:normal;font-variant-caps:normal;font=
-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-=
transform:none;white-space:normal;word-spacing:0px;text-decoration:none"></=
div></blockquote></div><br></div></div>


</p></p></blockquote></div>

<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/35806">View/Reply Online (#35806)</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=3DPri=
vate:%20Re:%20Re%3A%20%5Btestdrivendevelopment%5D%20%22bottom-up%22%20TDD%2=
0and%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>


--000000000000d322a70598db23cb--