Re: [testdrivendevelopment] "bottom-up" TDD and common behaviors
"Ron Jeffries" <[email protected]> Mon, 2 Dec 2019 14:26:27 -0500
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_56163AA8-D895-49E2-85AF-2A45CFA42A11 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii If we're gonna be like that, wouldn't you need a test for every modifiable = field? :) > On Dec 2, 2019, at 11:16 AM, Steve Gordon <[email protected]> wrote: >=20 > Just because an object has a method implemented to "know" whether or not= a field is modifiable does not mean that that method is correctly implemen= ted. If there is such a method, you would still have to have at least two = tests that verifies returns true only when that field is actually modifiabl= e and false only when it is not. >=20 > Unless the application itself needs such a method, I would have a test t= hat gets the fields value, sets it to a different value, and gets the field= value to verify it changes. Ron Jeffries ronjeffries.com <http://ronjeffries.com/> Master your instrument, master the music, then forget all that shit and ju= st play. -- Charlie Parker -=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 (#35796): https://groups.io/g/testdrivendevelopment/mess= age/35796 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=_56163AA8-D895-49E2-85AF-2A45CFA42A11 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"">If we're gonna be like= that, wouldn't you need a test for every modifiable field? :)<br class=3D"= "><div><br class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">= On Dec 2, 2019, at 11:16 AM, Steve Gordon <<a href=3D"mailto:sgordonphd@= gmail.com" 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-style: normal; font-= variant-caps: normal; font-weight: normal; letter-spacing: normal; text-ali= gn: start; text-indent: 0px; text-transform: none; white-space: normal; wor= d-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; floa= t: none; display: inline !important;" class=3D"">Just because an object has= a method implemented to "know" whether or not a field is modifiable d= oes not mean that that method is correctly implemented. If there is s= uch a method, you would still have to have at least two tests that verifies= returns true only when that field is actually modifiable and false only wh= en it is not. </span><div style=3D"caret-color: rgb(0, 0, 0); fo= nt-family: ArialMT; font-size: 18px; font-style: normal; font-variant-caps:= normal; font-weight: normal; letter-spacing: normal; text-align: start; te= xt-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0p= x; -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><br c= lass=3D""></div><div style=3D"caret-color: rgb(0, 0, 0); font-family: Arial= MT; font-size: 18px; font-style: normal; font-variant-caps: normal; font-we= ight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-= stroke-width: 0px; text-decoration: none;" class=3D"">Unless the applicatio= n itself needs such a method, I would have a test that gets the fields valu= e, sets it to a different value, and gets the field value to verify it chan= ges.</div></div></blockquote></div><br class=3D""><div class=3D""> <div style=3D"color: rgb(0, 0, 0); font-family: Helvetica; font-style: nor= mal; font-variant: normal; font-weight: normal; letter-spacing: normal; lin= e-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; t= ext-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -we= bkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: spac= e; -webkit-line-break: after-white-space;" class=3D""><div class=3D""><div = class=3D""><br class=3D"">Ron Jeffries</div><div class=3D""><a href=3D"http= ://ronjeffries.com" class=3D"">ronjeffries.com</a><br class=3D"Apple-interc= hange-newline">Master your instrument, master the music, then forget all th= at shit and just play. -- Charlie Parker</div></div></div> </div> <br class=3D""></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/35796">View/Reply Online (#35796)</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=_56163AA8-D895-49E2-85AF-2A45CFA42A11--