Tests ¡°scoped¡± to implementation
I had a live coding interview yesterday and I faced interesting ( at least
for me) issue.
A small background: I was about to implement a function to figure out if
sum of any 2 elements in input array
By
Jakub Milkiewicz
·
#35840
·
|
Re: How would you TDD a website front-end?
I've done a few projects with React + Redux (and now switching to Context / Hooks).
A component--the HTML--is declarative, as Tim suggests. The best rule is, no logic in components--the only things
By
Jeff Langr
·
#35839
·
|
Re: How would you TDD a website front-end?
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
By
Gregory Salvan
·
#35838
·
|
Re: How would you TDD a website front-end?
Can you provide a concrete example of what you are asking about? Talking
about GUI , form and model in the abstract can be confusing.
Basically, your GUI should be interacting with some object which
By
Avi Kessner
·
#35837
·
|
Re: How would you TDD a website front-end?
And that is why UI testing in general needs to be split 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
By
Russell Gold
·
#35836
·
|
Re: How would you TDD a website front-end?
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
By
Gregory Salvan
·
#35835
·
|
Re: How would you TDD a website front-end?
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,
By
Ken Mccormack <kenmccormack@...>
·
#35834
·
|
Re: How would you TDD a website front-end?
How?? This is interactive and deviates from the normal flow of the page.
.... Test server response.?OK....>Force response to the model on the GUI
I read this as, "Test changes the model.? Gui
By
Alan Baljeu
·
#35833
·
|
Re: How would you TDD a website front-end?
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
By
Avi Kessner
·
#35832
·
|
Re: How would you TDD a website front-end?
Whole project/webcast dedicated to TDD for web apps.
http://www.letscodejavascript.com/
James covers many topics - mock-free TDD, evolutionary design, CI,
frontend/backend, CSS TDD, realtime
By
Michal Svoboda
·
#35831
·
|
Re: How would you TDD a website front-end?
I¡¯ve struggled a bit with this in 2019. I think George is right.
With React and with Angular, it seems that a lot of the ¡°code¡± is css and
html and some declarative bits here and there. Many
By
Tim Ottinger
·
#35830
·
|
Re: How would you TDD a website front-end?
Alan,
I would test the business logic of the model/web service.
I would also have a few tests that make sure the view is wired correctly to the model/web service. Not many of these.
I might also have
By
George Dinwiddie
·
#35829
·
|
Re: How would you TDD a website front-end?
The pattern I have is
User inputs a valueForm posts value to serverServer responds with new model data.Form reconfigures.
"Test changes to the model" then I think means testing the web service.? So
By
Alan Baljeu
·
#35828
·
|
Re: How would you TDD a website front-end?
That was my original motivation in building HttpUnit¡ but it¡¯s limited JavaScript capabilities don¡¯t support many of today¡¯s complex sites.
Other than that, the Document-View pattern is your
By
Russell Gold
·
#35827
·
|
Re: How would you TDD a website front-end?
Test the changes to the model, not the GUI itself.
By
Avi Kessner
·
#35826
·
|
Re: How would you TDD a website front-end?
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 can do similar things much more easily.
In general, I
By
George Dinwiddie
·
#35825
·
|
How would you TDD a website front-end?
Using Visual Studio, C#, Razor forms, nothing complicated, just POSTING and GETTING and updating form elements.
Alan Baljeualanbaljeu@...
By
Alan Baljeu
·
#35824
·
|
[ann] new TDD book in Spanish
Hi!
I am happy to announce that I've recently published my second book on TDD in Spanish. Same title than the first one but completely new. With foreword by Sandro
By
Carlos Bl¨¦ <carlos@...>
·
#35823
·
|
Re: Diamond Kata using property-based tests with Nat Pryce
Yeah. We weren¡¯t at all happy with that property but wanted to press on to
express the symmetry which is a much better fit for property based testing.
In retrospect it would be better to start with
By
Nat Pryce
·
#35822
·
|
Re: Diamond Kata using property-based tests with Nat Pryce
Am I missing something, or did the indentation test not actually test
indentation?
By
Avi Kessner
·
#35821
·
|