Re: [testdrivendevelopment] "bottom-up" TDD and common behaviors
"Giorgio Vespucci" <[email protected]> Thu, 5 Dec 2019 15:41:43 +0100
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Message-ID | <CAFdtVemOpdv3C4_eMjSdyXMhVQyGq7AMn+53rBOVPC-_Ot_3jQ@mail.gmail.com> |
--0000000000003914ae0598f5ee4c Content-Type: text/plain; charset="UTF-8" I don't know why, but it seems this thread is completely separated, at least in my Gmail inbox, from the original Brian's one. Am I the only one seeing this? :| On Wed, 4 Dec 2019 at 07:44, Avi Kessner <[email protected]> wrote: > 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? >> >> >> > > -- Giorgio Vespucci [image: https://]about.me/giorgiovespucci <https://about.me/giorgiovespucci?promo=email_sig> -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#35807): https://groups.io/g/testdrivendevelopment/message/35807 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]] -=-=-=-=-=-=-=-=-=-=-=- --0000000000003914ae0598f5ee4c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">I don't know why, but it seems this thread=C2=A0is com= pletely separated, at least in my Gmail inbox, from the original Brian'= s one.<div>Am I the only one seeing=C2=A0this? :|</div></div><br><div class= = =3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, 4 Dec 2019 = at 07:44, Avi Kessner <<a href=3D"mailto:[email protected]">akessner@gm= ail.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"= margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef= t:1ex"><div dir=3D"auto">So this is definitely required behavior and it wil= l be your own, so it needs to be tested.<div dir=3D"auto">On the other hand= , it's a very specific implementation detail which could change when th= e technology changes and we don't want that to impact actual behavior r= elated tests about animals.</div><div dir=3D"auto"><br></div><div dir=3D"au= to">What I would do is make a transformation decorator and then test sample= data to 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">You basically need a map of fields that can be changed and the transf= ormation 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 understanding 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, De= c 4, 2019, 01:50 Brian Marick <<a href=3D"mailto:[email protected]" ta= rget=3D"_blank">[email protected]</a>> wrote:<br></div><blockquote cla= ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid = rgb(204,204,204);padding-left:1ex"><div style=3D"overflow-wrap: break-word;= "><div style=3D"overflow-wrap: break-word;">Yes.<br><div><br><blockquote ty= pe=3D"cite"><div>On Dec 3, 2019, at 5:31 AM, Avi Kessner <<a href=3D"mai= lto:[email protected]" rel=3D"noreferrer" target=3D"_blank">akessner@gmail= .com</a>> wrote:</div><br><div><span style=3D"font-family:Helvetica;font= -size:16px;font-style:normal;font-variant-caps:normal;font-weight:normal;le= tter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;wh= ite-space:normal;word-spacing:0px;text-decoration:none;float:none;display:i= nline">If I understand correctly, the code here is specifically=C2=A0for do= ing an Ecto transformation, correct? If you decide not to use Ecto the need= for this abstraction is removed?</span><br style=3D"font-family:Helvetica;= font-size:16px;font-style:normal;font-variant-caps:normal;font-weight:norma= l;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:non= e;white-space:normal;word-spacing:0px;text-decoration:none"></div></blockqu= ote></div><br></div></div> </blockquote></div> <p></p><p></p></blockquote></div><br clear=3D"all"><div><br></div>-- <br><= div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr"><table border=3D= "0" cellpadding=3D"0" cellspacing=3D"0" style=3D"margin:0px;padding:0px;bor= der:0px;outline:0px;font-size:14px;font-family:proxima-nova-1,proxima-nova-= 2,Tahoma,Helvetica,Verdana,sans-serif,"Segoe UI Emoji","Sego= e UI Symbol",Symbola,EmojiSymbols;vertical-align:baseline;border-spaci= ng:0px;color:rgb(51,51,51);line-height:18.2px"><tbody style=3D"margin:0px;p= adding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;fo= nt-family:inherit;vertical-align:baseline"><tr style=3D"margin:0px;padding:= 0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;font-fami= ly:inherit;vertical-align:baseline"><td style=3D"padding:0px;border:0px;out= line:0px;font-style:inherit;font-size:0px;font-family:inherit;vertical-alig= n:baseline;width:auto;height:30px">=C2=A0</td></tr><tr style=3D"margin:0px;= padding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;f= ont-family:inherit;vertical-align:baseline"><td style=3D"padding:0px;border= :0px;outline:0px;font-style:inherit;font-family:inherit;vertical-align:base= line;width:auto"><div style=3D"margin:0px;padding:0px;border:0px;outline:0p= x;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align= :baseline;line-height:0"><a href=3D"https://about.me/giorgiovespucci?promo= =3Demail_sig" style=3D"margin:0px;padding:0px;border:0px;outline:0px;font-= weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseli= ne;color:rgb(43,130,173);text-decoration:none;display:inline-block" target= =3D"_blank"><table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" style= =3D"margin:0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font= -style:inherit;font-family:inherit;vertical-align:baseline;border-spacing:0= px"><tbody style=3D"margin:0px;padding:0px;border:0px;outline:0px;font-weig= ht:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline">= <tr style=3D"margin:0px;padding:0px;border:0px;outline:0px;font-weight:inhe= rit;font-style:inherit;font-family:inherit;vertical-align:baseline"><td ali= gn=3D"left" valign=3D"top" style=3D"padding:0px;border:0px;outline:0px;font= -style:inherit;font-family:inherit;vertical-align:top;width:auto;line-heigh= t:1"><div style=3D"margin:0px;padding:0px;border:0px;outline:0px;font-weigh= t:bold;font-style:inherit;font-size:18px;font-family:proxima-nova-1,Proxima= -Nova,Helvetica,Arial,sans-serif;vertical-align:baseline;line-height:1;colo= r:rgb(51,51,51)">Giorgio Vespucci</div></td></tr><tr style=3D"margin:0px;pa= dding:0px;border:0px;outline:0px;font-weight:inherit;font-style:inherit;fon= t-family:inherit;vertical-align:baseline"><td align=3D"left" valign=3D"top"= style=3D"padding:0px;border:0px;outline:0px;font-style:inherit;font-family= :inherit;vertical-align:top;width:auto;line-height:1"><div style=3D"margin:= 3px 0px 0px;padding:0px;border:0px;outline:0px;font-weight:inherit;font-sty= le:inherit;font-size:12px;font-family:proxima-nova-1,Proxima-Nova,Helvetica= ,Arial,sans-serif;vertical-align:baseline"><img alt=3D"https://" width=3D"0= " height=3D"0" style=3D"margin: 0px; padding: 0px; border: 0px; outline: 0p= x; font-weight: inherit; font-style: inherit; font-family: inherit; vertica= l-align: baseline; display: block; width: 0px; height: 0px; overflow: hidde= n;">about.me/giorgiovespucci</div></td></tr></tbody></table></a>=C2=A0 =09 = = =09</div></td></tr><tr style=3D"margin:0px;padding:0px;border:0px;outline:= 0px;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-ali= gn:baseline"><td style=3D"padding:0px;border:0px;outline:0px;font-style:inh= erit;font-size:0px;font-family:inherit;vertical-align:baseline;width:auto;h= eight:20px"><img src=3D"https://about.me/t/sig?u=3Dgiorgiovespucci" width= =3D"1" height=3D"1" style=3D"margin: 0px; padding: 0px; border: 0px; outli= ne: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; v= ertical-align: baseline; overflow: hidden;"></td></tr></tbody></table></div= ></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/35807">View/Reply Online (#35807)</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]?subje= ct=3DPrivate:%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> --0000000000003914ae0598f5ee4c--