Re: [testdrivendevelopment] "bottom-up" TDD and common behaviors
"Ron Jeffries" <[email protected]> Mon, 2 Dec 2019 15:48:57 -0500
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_2123B958-7A63-444E-A3AE-9F27E5ED44FE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii We still don't know the context, but it seems like we have some kind of a t= hing that either has fields that are sometimes mod and sometimes not, or so= metimes has mod fields added to it. That could be built in lots of interest= ing ways, as with an adapter that covers up the fields making them unmodifi= able, or a partner object adapter that knows the secret handshake. My basic approach would be to ask the question I want to know the answer t= o, roughly, "are those fields modifiable", and then let the code tell me mo= re about the implementation. If that question became more complex to answer= , that might be just fine. Without building the thing, I cannot know.=20 > On Dec 2, 2019, at 2:48 PM, Steve Gordon <[email protected]> wrote: >=20 > What motivates implementing a setter method under TDD unless there is a = test that requires it to exist and work? Extra tests would only be require= d if we also need to implement is<X>Modifiable() for some field X. Ron Jeffries ronjeffries.com <http://ronjeffries.com/> Perfectionism is the voice of the oppressor -- Anne Lamott -=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 (#35798): https://groups.io/g/testdrivendevelopment/mess= age/35798 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- --Apple-Mail=_2123B958-7A63-444E-A3AE-9F27E5ED44FE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset= = =3Dus-ascii"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mod= e: space; line-break: after-white-space;" class=3D"">We still don't know th= e context, but it seems like we have some kind of a thing that either has f= ields that are sometimes mod and sometimes not, or sometimes has mod fields= added to it. That could be built in lots of interesting ways, as with an a= dapter that covers up the fields making them unmodifiable, or a partner obj= ect adapter that knows the secret handshake.<div class=3D""><br class=3D"">= </div><div class=3D"">My basic approach would be to ask the question I want= to know the answer to, roughly, "are those fields modifiable", and then le= t the code tell me more about the implementation. If that question became m= ore complex to answer, that might be just fine.</div><div class=3D""><br cl= ass=3D""></div><div class=3D"">Without building the thing, I cannot know.&n= bsp;<br class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""= ><div class=3D"">On Dec 2, 2019, at 2:48 PM, Steve Gordon <<a href=3D"ma= ilto:[email protected]" class=3D"">[email protected]</a>> wrote:</= div><br class=3D"Apple-interchange-newline"><div class=3D""><span style=3D"= caret-color: rgb(0, 0, 0); font-family: ArialMT; font-size: 18px; font-styl= e: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: = normal; text-align: start; text-indent: 0px; text-transform: none; white-sp= ace: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decora= tion: none; float: none; display: inline !important;" class=3D"">What motiv= ates implementing a setter method under TDD unless there is a test that req= uires it to exist and work? Extra tests would only be required if we = also need to implement is<X>Modifiable() for some field X.</span></di= v></blockquote></div><br class=3D""><div class=3D""> <div style=3D"color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; = text-align: start; text-indent: 0px; text-transform: none; white-space: nor= mal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-= wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white= -space;" class=3D""><div style=3D"color: rgb(0, 0, 0); letter-spacing: norm= al; orphans: auto; text-align: start; text-indent: 0px; text-transform: non= e; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-strok= e-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line= -break: after-white-space;" class=3D""><div style=3D"color: rgb(0, 0, 0); f= ont-variant: normal; letter-spacing: normal; line-height: normal; orphans: = 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-= space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px= ; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: afte= r-white-space;" class=3D""><div style=3D"color: rgb(0, 0, 0); font-variant:= normal; letter-spacing: normal; line-height: normal; orphans: 2; text-alig= n: -webkit-auto; text-indent: 0px; text-transform: none; white-space: norma= l; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D"= "><br class=3D"Apple-interchange-newline">Ron Jeffries</div><div style=3D"c= olor: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-heig= ht: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-tr= ansform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-t= ext-stroke-width: 0px;" class=3D""><a href=3D"http://ronjeffries.com" class= = =3D"">ronjeffries.com</a></div><div class=3D""><span class=3D"Apple-style-= span" style=3D"border-collapse: separate; border-spacing: 0px;">Perfectioni= sm is the voice of the oppressor -- Anne Lamott</span></div></div></div></d= iv> </div> <br class=3D""></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/35798">View/Reply Online (#35798)</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= = =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> --Apple-Mail=_2123B958-7A63-444E-A3AE-9F27E5ED44FE--