Re: [testdrivendevelopment] How would you TDD a website front-end?
"Gregory Salvan" <[email protected]> Sun, 5 Jan 2020 14:59:11 +0100
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Message-ID | <CAAZsQLDE4SUY7y7tgHZ3DKcN91FQiRpDu_gQVku65Mw7GBTReg@mail.gmail.com> |
--0000000000003a14a0059b64f39f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I insisted on "what" because it's not so obvious as it seems. I was doing web pages before all these frameworks show up (omg I feel old)= , so in my old time :-) we were taught that web pages have 3 concerns: structure and semantic with html, style with css, and behaviour with javascript. So if you stay focus on what is your sut: 1 - Structure and semantic of content can you test semantic and structure ? -> yes can these tests help you to design your content structure and semantic -> why not ? Content is not necessarily coupled to structure but I think it's ok to bin= d it, some examples: Imagine you write a blog article on TDD, you collect all the questions you find on forums with the keywords: emergent design, TDD, BDD, refactoring..= . (or you simply talk with beginners... whatever) You regroup these questions and priorize them, and you organize your article within this priority. It is quite similar to writing software, you= r readers have needs and you provide a set of features (contents) that try t= o respond to their needs. In this context it may have sense to drive the wrtting of your content wit= h tests. Concretly, if your subject is TDD, you'll merely have a big title h1 which contains the keyword "TDD", you also may have one h2 title with the keywor= d "red", one with "green" and one with "refactor" or you may have a h2 title with the 3 keywords "red", "green", "refactor", followed by 3 paragraphs with a h3 title with one of these keywords.... Also because of seo and accessibility it's interesting to bind the content to structure and semantic. Seo provides some tools to measure if your content is relevant like counting words, givinfg more importance to titles, links... 2 - style with css can you test style ? -> yes can these tests help you to design your page style ? -> why not ? I'm not graphist and can't precisely answer on the utility of these tests but this is some leads that may help. The style provide infomation to the user about what he can do, this is wha= t I would test. for example when a user fly over a button, the button background color can enlight to 20% to alert him an action is possible, otherwise if action is blocked the background color may dim by 50% There's intrinsically some rules in web pages like "underlined text is reserved to link", "h1 title font size is bigger than h2 size"... I imagin= e a graphist use more complex rules, and TDD can help. 3 - behaviour with javascript Some have said you test user input, in this context of frontend it may not be totally exact. In a javascript script the input is the webpage, you respond to event of the webpage not just user, for ex. user is writing in an input field, in the point of view of js, this is the input field which is emitting "change= " event. You can have push events form the server... it's not restricted to user input. A priori you have to test events, and idk if it can really lead your desig= n in all cases. To conclude (and show I'm not so old than it seems :-)), we can take the example of a web component like if it's a small web page with the 3 concerns. Our web component is a shortened description, about structure and semantic concern I would test if it contains a "summary" and "details", about style we can test if details are hidden in normal state and visible in expanded state, in behaviour we can test if when we click on summary the normal/expanded state is switching. <shorteneddesc><summary>being conscious of what you're testing is fundamental</summary><details>you can loose yourself in useless details if it's not clear in your mind ;-)</details></shorteneddesc> wish you the best for this new year, regards, Gr=C3=A9gory Le dim. 5 janv. 2020 =C3=A0 03:09, Russell Gold <[email protected]> a = =C3=A9crit : > And that is why UI testing in general needs to be split into tests of th= e > business logic independently of the UI. UI testing is never going to be = all > that fast or easy, but whatever can be automated is much faster than th= e > alternative. > ----------------- > Author, Getting Started with Apache Maven < > http://www.packtpub.com/getting-started-with-apache-maven/video> > Author, HttpUnit <http://www.httpunit.org> and SimpleStub < > http://simplestub.meterware.com> > Now blogging at <http://russgold.net/sw/> > > Have you listened to Edict Zero <https://edictzero.wordpress.com>? If > not, you don=E2=80=99t know what you=E2=80=99re missing! > > > > > > On Jan 4, 2020, at 5:03 PM, Gregory Salvan <[email protected]> wrote: > > Sorry I'm not convinced by all answers, specially when I see end to end > tests, TDD is rapid feedback and "end to end tests" are slow. > To illustrate my feelings, I've found the following article about Cohn > pyramid : https://martinfowler.com/articles/practical-test-pyramid.html > I think tests like the following for example are useless: > https://github.com/hamvocke/spring-testing/blob/master/src/test/java/exa= mple/HelloE2ERestTest.java > What's the purpose of the test shouldReturnGreeting() ? What is he > testing really ? > A different approach can consist in unit testing with small steps hello > method (String hello(@PathVariable final String lastName)), and checking > if "/hello/{lastName}" is mapped to this method. > Which one gives you the fastest feedback ? In case of test break, which > one will permit you to find faster where it's broken ? > Which approach document the best what you're testing ? Look at all the > tests, what if we want to show last name before first name ? > Don't you feel this kind of test are like "testing the compiler" ? > > The question I try to keep in mind is **"What is my SUT"** ? In this cas= e > spring framework is not, you can test it, but in my opinion its outside = of > TDD scope. > +1 to George Dinwiddie answer > > Hope it helps > > > > > > > > Le sam. 4 janv. 2020 =C3=A0 12:57, Ken Mccormack <[email protected]= > a > =C3=A9crit : > >> You need to split functions into separate categories - orthogonal >> concerns - not confuse/couple them by end to end flow tests. >> >> TBH a lot depends on the kind of quality outcomes you are looking for, >> the complexity of your UI-side logic, and the tech skills of your team. >> >> My guess with Blazor is that this is just standard nunit tests running >> against C# models. For the most part, I'd write non-200 tests here, e.= g. a >> stubs will cover un-happy paths, malformed responses, all classes API >> errors, but also things like already created. Other concerns would be >> tested using functional tests, probably, rather than repeat the same >> coverage in multiple places. >> >> But it depends. What is your app about? What is its most complex piece= ? >> Why Blazor, rather than React? Why silo front end tests, do you have a >> separate API team? What are your QA processes? >> >> The typical set of application tests might be - >> >> 1. unit tests to cover UI model logic, and in particular, to emulate >> error and fault cases >> 2. API tests - if you're in a silo, you should be throwing a set of >> consumer tests across each API release, to ensure that your basic >> assumptions aren't broken - if the api code is released independently f= rom >> the front end (eg a microservices architecture) you need to pin down yo= ur >> contract by passing the API team a set of tests to litmus check your >> expectations are being met (PACT is one approach that you might try, bu= t >> frameworks in .net weren't very mature and tbh it's easier to roll your= own >> approach, often) >> 3. UI automation - a journey test that hits each API once in an end to >> end flow (eg. place an order) >> >> The Cohn test pyramid is often used to describe the above - but it is >> also naively misquoted and rarely deeply understood - it says *you have= to >> test at all (composition) levels*, and so the pyramid is a reflection o= f a >> typical OO composition style (i.e. not all apps will have their tests >> resemble a pyramid, many apps use functional tests, and unit test only >> negative cases. >> >> Doing more advanced CD, for example, requires some system design, i.e. >> control and observation code, or the ability to run synthetic transacti= ons >> against production. I'd rather do that first than unit test happy path= s. >> In that situation a simple stub/mockist TDD approach doesn't cut it - b= ut >> how far you go depends upon the quality outcomes you're looking to achi= eve >> in terms of deploys per developer per day. >> >> Kennos >> >> 3, 2020 at 01:07 AM, Avi Kessner wrote: >> >> I would do it like this: >> >> User inputs a value >> Test local model updated with value. >> Form posts model to server. >> Test server handles form model and returns expected model. >> Force response to the model on the GUI >> Test the model has been updated correctly. >> Assume GUI updates correctly cause you if you used framework code to >> alter the form. >> Otherwise, test your hand written html as if it was a model. >> >> On Fri, Jan 3, 2020, 03:49 Alan Baljeu via Groups.Io <alanbaljeu=3D >> [email protected]> wrote: >> >>> The pattern I have is >>> >>> User inputs a value >>> Form posts value to server >>> Server responds with new model data. >>> Form reconfigures. >>> >>> "Test changes to the model" then I think means testing the web service= . >>> So don't test the view? >>> >>> Alan Baljeu >>> [email protected] >>> >>> >>> >>> On Thursday, January 2, 2020, 06:58:20 p.m. EST, Avi Kessner < >>> [email protected]> wrote: >>> >>> >>> Test the changes to the model, not the GUI itself. >>> >>> On Fri, Jan 3, 2020, 00:26 George Dinwiddie <[email protected]> >>> wrote: >>> >>> Alan, >>> >>> Way back, I played with test-driving AWT and Java Swing UIs, starting >>> with just jUnit. Given the availability of web driver libraries, you c= an >>> >>> do similar things much more easily. >>> >>> In general, I tested the GUI with a test API to make sure things were >>> wired up correctly. I tested the actual API to make sure the system >>> worked correctly. >>> >>> In >>> >>> https://github.com/gdinwiddie/EquineHoroscope/tree/master/src/test/jav= a/com/gdinwiddie/equinehoroscope/acceptance >>> >>> you can see an example of re-using a test that drove the API creation = to >>> >>> check the same result from the GUI by injecting a different adapter to >>> talk with the system under test. >>> >>> - George >>> >>> > Alan Baljeu >>> > [email protected] >>> > >>> > >>> >>> -- >>> --------------------------------------------------------------------= -- >>> * George Dinwiddie * http://blog.gdinwiddie.co= m >>> Software Development http://www.idiacomputing.co= m >>> Consultant and Coach >>> --------------------------------------------------------------------= -- >>> >>> >>> >>> >>> >>> >>> >> >> >> >=20 > > -=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 (#35838): https://groups.io/g/testdrivendevelopment/mess= age/35838 Mute This Topic: https://groups.io/mt/69387056/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- --0000000000003a14a0059b64f39f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div><div>I insisted on "what" because it's = not so obvious as it seems.<br></div>I was doing web pages before all these= frameworks show up (omg I feel old), so in my old time :-) we were taught = that web pages have 3 concerns: structure and semantic with html, style wit= h css, and behaviour with javascript.<br></div>So if you stay focus on what= is your sut:<br><div>1 - Structure and semantic of content</div><div>can y= ou test semantic and structure ? -> yes</div><div>can these tests help y= ou to design your content structure and semantic=C2=A0 -> why not ?<br><= /div><div>Content is not necessarily coupled to structure but I think it= 9;s ok to bind it, some examples:</div><div>Imagine you write a blog articl= e on TDD, you collect all the questions you find on forums with the keyword= s: emergent design, TDD, BDD, refactoring... (or you simply talk with begin= ners... whatever)<br></div><div>You regroup these questions and priorize th= em, and you organize your article within this priority. It is quite similar= to writing software, your readers have needs and you provide a set of feat= ures (contents) that try to respond to their needs.<br></div><div>In this c= ontext it may have sense to drive the wrtting of your content with tests. <= br></div><div>Concretly, if your subject is TDD, you'll merely have a b= ig title h1 which contains the keyword "TDD", you also may have o= ne h2 title with the keyword "red", one with "green" an= d one with "refactor" or you may have a h2 title with the 3 keywo= rds "red", "green", "refactor", followed by 3= paragraphs with a h3 title with one of these keywords....<br></div><div>Al= so because of seo and accessibility it's interesting to bind the conten= t to structure and semantic.</div><div>Seo provides some tools to measure i= f your content is relevant like counting words, givinfg more importance to = titles, links...<br></div><div><br></div><div>2 - style with css</div><div>= can you test style ? -> yes</div><div>can these tests help you to design= your page style ? -> why not ?</div><div>I'm not graphist and can&#= 39;t precisely answer on the utility of these tests but this is some leads = that may help.</div><div>The style provide infomation to the user about wha= t he can do, this is what I would test.<br>for example when a user fly over= a button, the button background color can enlight to 20% to alert him an a= ction is possible, otherwise if action is blocked the background color may = dim by 50%</div><div>There's intrinsically some rules in web pages like= "underlined text is reserved to link", "h1 title font size = is bigger than h2 size"... I imagine a graphist use more complex rules= , and TDD can help.<br><br></div><div>3 - behaviour with javascript</div><d= iv></div><div>Some have said you test user input, in this context of fronte= nd it may not be totally exact. <br>In a javascript script the input is the= webpage, you respond to event of the webpage not just user, for ex. user i= s writing in an input field, in the point of view of js, this is the input = field which is emitting "change" event. You can have push events = form the server... it's not restricted to user input.<br></div><div>A p= riori you have to test events, and idk if it can really lead your design in= all cases.<br></div><div><br></div><div>To conclude (and show I'm not = so old than it seems :-)), we can take the example of a web component like = if it's a small web page with the 3 concerns.</div><div>Our web compone= nt is a shortened description, about structure and semantic concern I would= test if it contains a "summary" and "details", about s= tyle we can test if details are hidden in normal state and visible in expan= ded state, in behaviour we can test if when we click on summary the normal/= expanded state is switching.<br></div><div><shorteneddesc><summary= >being conscious of what you're testing is fundamental</summary&g= t;<details>you can loose yourself in useless details if it's not = clear in your mind ;-)</details></shorteneddesc><br></div><div>= <br></div><div><br></div><div>wish you the best for this new year, regards,= </div><div>Gr=C3=A9gory<br></div><div><div><div><div><div><br></div></div><= /div></div></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" clas= s=3D"gmail_attr">Le=C2=A0dim. 5 janv. 2020 =C3=A0=C2=A003:09, Russell Gold = <<a href=3D"mailto:[email protected]" target=3D"_blank">russ@gold-fami= ly.us</a>> a =C3=A9crit=C2=A0:<br></div><blockquote class=3D"gmail_quote= " style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);= padding-left:1ex"><div>And that is why UI testing in general needs to be sp= lit into tests of the business logic independently of the UI. UI testing is= never going to be all that fast or easy, but whatever can be automated is = much faster than =C2=A0the alternative.<br><div> <div style=3D"color:rgb(0,0,0);letter-spacing:normal;text-align:start;text= -indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div s= tyle=3D"color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent= :0px;text-transform:none;white-space:normal;word-spacing:0px"><div style=3D= "color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;te= xt-transform:none;white-space:normal;word-spacing:0px"><div><div>----------= -------</div><div>Author,=C2=A0Getting Started with Apache Maven <<a hre= f=3D"http://www.packtpub.com/getting-started-with-apache-maven/video" targe= t=3D"_blank">http://www.packtpub.com/getting-started-with-apache-maven/vide= o</a>></div><div>Author, HttpUnit <<a href=3D"http://www.httpunit.org= " target=3D"_blank">http://www.httpunit.org</a>> and SimpleStub <<a h= ref=3D"http://simplestub.meterware.com" target=3D"_blank">http://simplestub= .meterware.com</a>><br>Now blogging at <<a href=3D"http://russgold.ne= t/sw/" target=3D"_blank">http://russgold.net/sw/</a>></div><div><br></di= v><div>Have you listened to Edict Zero <<a href=3D"https://edictzero.wor= dpress.com" target=3D"_blank">https://edictzero.wordpress.com</a>>? If n= ot, you don=E2=80=99t know what you=E2=80=99re missing!</div></div></div><b= r></div><br></div><br><br> </div> <div><br><blockquote type=3D"cite"><div>On Jan 4, 2020, at 5:03 PM, Gregor= y Salvan <<a href=3D"mailto:[email protected]" target=3D"_blank">apieum@g= mail.com</a>> wrote:</div><br><div><div dir=3D"ltr" style=3D"font-family= :Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-w= eight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-tr= ansform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div= >Sorry I'm not convinced by all answers, specially when I see end to en= d tests, TDD is rapid feedback and "end to end tests" are slow.<b= r></div><div>To illustrate my feelings, I've found the following articl= e about Cohn pyramid :<span>=C2=A0</span><a href=3D"https://martinfowler.co= m/articles/practical-test-pyramid.html" target=3D"_blank">https://martinfow= ler.com/articles/practical-test-pyramid.html</a><span>=C2=A0</span><br></di= v><div>I think tests like the following for example are useless:<span>=C2= =A0</span><a href=3D"https://github.com/hamvocke/spring-testing/blob/maste= r/src/test/java/example/HelloE2ERestTest.java" target=3D"_blank">https://gi= thub.com/hamvocke/spring-testing/blob/master/src/test/java/example/HelloE2E= RestTest.java</a></div><div></div><div>What's the purpose of the test<s= pan>=C2=A0</span><span>shouldReturnGreeting</span>() ? What is he testing r= eally ?=C2=A0</div><div><span><span>A different approach can consist in uni= t testing with small steps hello method (</span></span><span>String</span><= span>=C2=A0</span><span>hello</span>(<span>@PathVariable</span><span>=C2=A0= </span><span>final</span><span>=C2=A0</span><span>String</span><span>=C2=A0= </span><span>lastName</span>)<span><span>), and checking if<span>=C2=A0</sp= an><span>=C2=A0</span><span><span>"</span>/hello/{lastName}<span>"= ; is mapped to this method.<br></span></span></span></span></div><div><span= ><span><span><span></span></span></span></span></div><div><span><span></spa= n></span></div><div><span><span>Which one gives you the fastest feedback ? = In case of test break, which one will permit you to find faster where it= 9;s broken ?<br></span></span></div><div><span><span>Which approach documen= t the best what you're testing ? Look at all the tests, what if we want= to show last name before first name ?<br></span></span></div><div><span><s= pan>Don't you feel this kind of test are like "testing the compile= r" ?<br></span></span></div><div><span><span><br></span></span></div><= div><span><span>The question I try to keep in mind is **"What is my SU= T"** ? In this case spring framework is not, you can test it, but in m= y opinion its outside of TDD scope.<br></span></span></div><div><span><span= >+1 to</span></span><span>=C2=A0</span>George Dinwiddie answer<br></div><di= v><span><span><br></span></span></div><div><span><span>Hope it helps<br></s= pan></span></div><div><span><span><br><br><br><br></span></span></div><div>= <span><span><br><br></span></span></div></div><br style=3D"font-family:Helv= etica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight= :normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transfo= rm:none;white-space:normal;word-spacing:0px;text-decoration:none"><div clas= s=3D"gmail_quote" style=3D"font-family:Helvetica;font-size:12px;font-style:= normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;te= xt-align:start;text-indent:0px;text-transform:none;white-space:normal;word-= spacing:0px;text-decoration:none"><div dir=3D"ltr" class=3D"gmail_attr">Le= =C2=A0sam. 4 janv. 2020 =C3=A0=C2=A012:57, Ken Mccormack <<a href=3D"ma= ilto:[email protected]" target=3D"_blank">[email protected]</a>&g= t; a =C3=A9crit=C2=A0:<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">You need to split functions into separate categories - orthogonal co= ncerns - not confuse/couple them by end to end flow tests.=C2=A0<br>=C2=A0<= br>TBH a lot depends on the=C2=A0kind of quality outcomes you are looking f= or, the complexity of your UI-side logic, and the tech skills of your team.= <br><br>My guess with Blazor is that this is just standard nunit tests runn= ing against C# models.=C2=A0 For the most part, I'd write non-200 tests= here, e.g. a stubs will cover un-happy paths, malformed responses, all cla= sses API errors, but also things like already created.=C2=A0 Other concerns= would be tested using functional tests, probably, rather than repeat the s= ame coverage in multiple places.<br><br>But it depends. What is your app ab= out?=C2=A0 What is its most complex piece?=C2=A0 Why Blazor, rather than Re= act?=C2=A0 Why silo front end tests, do you have a separate API team?=C2=A0= What are your QA processes?<br><br>The typical set of application tests mi= ght be -<br><br>1. unit tests to cover=C2=A0 UI model logic, and in particu= lar, to emulate error and fault cases=C2=A0<br>2. API tests - if you're= in a silo, you should be throwing a set of consumer tests across each API = release, to ensure that your basic assumptions aren't broken - if the a= pi code is released independently from the front end (eg a microservices ar= chitecture) you need to pin down your contract by passing the API team a se= t of tests to litmus check your expectations are being met (PACT is one app= roach that you might try, but frameworks in .net weren't very mature an= d tbh it's easier to roll your own approach, often)<br>3. UI automation= - a journey test that hits each API once in an end to end flow (eg. place = an order)<br><br>The Cohn test pyramid is often used to describe the above = - but it is also naively misquoted and rarely deeply understood - it says *= you have to test at all (composition) levels*, and so the pyramid is a refl= ection of a typical OO composition style (i.e. not all apps will have their= tests resemble a pyramid, many apps use functional tests, and unit test on= ly negative cases.<br><br>Doing more advanced CD, for example, requires som= e system design, i.e. control and observation code, or the ability to run s= ynthetic transactions against production.=C2=A0 I'd rather do that firs= t than unit test happy paths. In that situation a simple stub/mockist TDD a= pproach doesn't cut it - but how far you go depends upon the quality ou= tcomes you're looking to achieve in terms of deploys per developer per = day.=C2=A0<br><br>Kennos<br><br>3, 2020 at 01:07 AM, Avi Kessner wrote:<br>= <blockquote><div dir=3D"auto"><div dir=3D"auto">I would do it like this:</d= iv><div dir=3D"auto">=C2=A0</div><div>User inputs a value</div><div dir=3D"= auto">Test local model updated with value.</div><div dir=3D"auto">Form post= s model to server.</div><div dir=3D"auto">Test server handles form model an= d returns expected model.</div><div dir=3D"auto">Force response to the mode= l on the GUI</div><div dir=3D"auto">Test the model has been updated correct= ly.</div><div dir=3D"auto">Assume GUI updates correctly cause you if you us= ed framework code to alter the form.</div><div dir=3D"auto">Otherwise, test= your hand written html as if it was a model.<br><br><div class=3D"gmail_qu= ote" dir=3D"auto"><div class=3D"gmail_attr" dir=3D"ltr">On Fri, Jan 3, 2020= , 03:49 Alan Baljeu via Groups.Io <alanbaljeu=3D<a href=3D"mailto:yahoo.= [email protected]" target=3D"_blank">[email protected]</a>> wrote:</div><b= lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le= ft:1px solid rgb(204,204,204);padding-left:1ex"><div><div style=3D"font-fam= ily:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px"><= div><div dir=3D"ltr">The pattern I have is</div><div dir=3D"ltr">=C2=A0</di= v><div dir=3D"ltr">User inputs a value</div><div dir=3D"ltr">Form posts val= ue to server</div><div dir=3D"ltr">Server responds with new model data.</di= v><div dir=3D"ltr">Form reconfigures.</div><div>=C2=A0</div><div dir=3D"ltr= ">"Test changes to the model" then I think means testing the web = service.=C2=A0 So don't test the view?</div><div>=C2=A0</div><div><div = style=3D"font-family:Helvetica,Arial,sans-serif;font-size:16px"><div style= =3D"font-family:Helvetica,Arial,sans-serif;font-size:16px"><div>Alan Balje= u</div></div><div style=3D"font-family:Helvetica,Arial,sans-serif;font-size= :16px"><a href=3D"mailto:[email protected]" rel=3D"noopener noreferrer" = target=3D"_blank">[email protected]</a></div><div style=3D"font-family:H= elvetica,Arial,sans-serif;font-size:16px">=C2=A0</div></div></div></div><di= v>=C2=A0</div><div>=C2=A0</div></div><div id=3D"gmail-m_8765813568421783205= gmail-m_-99187789164409144gmail-m_2462695110694953152m_1174070532757893286y= dp89e51f5yahoo_quoted_8399920580"><div style=3D"font-family:"Helvetica= Neue",Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">= <div>On Thursday, January 2, 2020, 06:58:20 p.m. EST, Avi Kessner <<a hr= ef=3D"mailto:[email protected]" rel=3D"noopener noreferrer" target=3D"_bla= nk">[email protected]</a>> wrote:</div><div>=C2=A0</div><div>=C2=A0</di= v><div><div id=3D"gmail-m_8765813568421783205gmail-m_-99187789164409144gmai= l-m_2462695110694953152m_1174070532757893286ydp89e51f5yiv9185559269"><div><= div>Test the changes to the model, not the GUI itself.</div><br clear=3D"no= ne"><div><div dir=3D"ltr">On Fri, Jan 3, 2020, 00:26 George Dinwiddie <<= a href=3D"mailto:[email protected]" rel=3D"nofollow noopener noreferr= er" shape=3D"rect" target=3D"_blank">[email protected]</a>> wrote:= </div><blockquote style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r= gb(204,204,204);padding-left:1ex">Alan,<br clear=3D"none"><br clear=3D"none= ">Way back, I played with test-driving AWT and Java Swing UIs, starting<spa= n>=C2=A0</span><br clear=3D"none">with just jUnit. Given the availability o= f web driver libraries, you can<span>=C2=A0</span><br clear=3D"none">do sim= ilar things much more easily.<br clear=3D"none"><br clear=3D"none">In gener= al, I tested the GUI with a test API to make sure things were<span>=C2=A0</= span><br clear=3D"none">wired up correctly. I tested the actual API to make= sure the system<span>=C2=A0</span><br clear=3D"none">worked correctly.<br = clear=3D"none"><br clear=3D"none">In<span>=C2=A0</span><br clear=3D"none"><= a href=3D"https://github.com/gdinwiddie/EquineHoroscope/tree/master/src/tes= t/java/com/gdinwiddie/equinehoroscope/acceptance" rel=3D"nofollow noopener = noreferrer" shape=3D"rect" target=3D"_blank">https://github.com/gdinwiddie/= EquineHoroscope/tree/master/src/test/java/com/gdinwiddie/equinehoroscope/ac= ceptance</a><span>=C2=A0</span><br clear=3D"none">you can see an example of= re-using a test that drove the API creation to<span>=C2=A0</span><br clear= = =3D"none">check the same result from the GUI by injecting a different adap= ter to<span>=C2=A0</span><br clear=3D"none">talk with the system under test= .<br clear=3D"none"><br clear=3D"none">=C2=A0<span>=C2=A0</span>- George<br= clear=3D"none"><br clear=3D"none">> Alan Baljeu<br clear=3D"none">><= span>=C2=A0</span><a href=3D"mailto:[email protected]" rel=3D"nofollow n= oopener noreferrer" shape=3D"rect" target=3D"_blank">[email protected]</= a><br clear=3D"none">><span>=C2=A0</span><br clear=3D"none">><span>= =C2=A0</span><br clear=3D"none"><br clear=3D"none">--<span>=C2=A0</span><b= r clear=3D"none">=C2=A0<span>=C2=A0</span>---------------------------------= -------------------------------------<br clear=3D"none">=C2=A0 =C2=A0* Geor= ge Dinwiddie *=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0<span>=C2=A0</span><a href=3D"http://blog.gdinwiddie.com/= " rel=3D"nofollow noopener noreferrer" shape=3D"rect" target=3D"_blank">htt= p://blog.gdinwiddie.com</a><br clear=3D"none">=C2=A0 =C2=A0Software Develop= ment=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<s= pan>=C2=A0</span><a href=3D"http://www.idiacomputing.com/" rel=3D"nofollow = noopener noreferrer" shape=3D"rect" target=3D"_blank">http://www.idiacomput= ing.com</a><br clear=3D"none">=C2=A0 =C2=A0Consultant and Coach<br clear=3D= "none">=C2=A0<span>=C2=A0</span>-------------------------------------------= ---------------------------<br clear=3D"none"><br clear=3D"none"><br clear= =3D"none"><br clear=3D"none"><br clear=3D"none"></blockquote></div></div><= /div></div></div></div></div><div>=C2=A0<br></div><div>=C2=A0<br></div></bl= ockquote></div></div></div></blockquote><div><br></div><div><br></div></blo= ckquote></div></div></blockquote></div><br></div> <p></p><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/35838">View/Reply Online (#35838)</a> | <a target=3D"_blank" href=3D"mailto:[email protected]?subj= ect=3DRe:%20Re%3A%20%5Btestdrivendevelopment%5D%20How%20would%20you%20TDD%2= 0a%20website%20front-end%3F">Reply To Group</a> | <a target=3D"_blank" href=3D"mailto:[email protected]?subject=3DPriva= te:%20Re:%20Re%3A%20%5Btestdrivendevelopment%5D%20How%20would%20you%20TDD%2= 0a%20website%20front-end%3F">Reply To Sender</a> | <a target=3D"_blank" href=3D"https://groups.io/mt/69387056/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> --0000000000003a14a0059b64f39f--