Re:Ask HN: What made you change your mind about a programmin...
by pjmlp on Monday March 04, 2019 @02:18AM
(#19299412)
My trick question to TDD advocates is how to develop native apps following those principles, after all no GUI change is allowed without a test.
[ Parent
| on HN ]
Re:Ask HN: What made you change your mind about a programmin...
by magduf on Monday March 04, 2019 @02:20PM
(#19304351)
GUIs don't lend themselves to unit testing at all, because the requirements aren't mathematical, but are instead based on human factors.
For GUIs, the proper approach is to unit-test the functionality underneath, not the GUI itself.
Re:Ask HN: What made you change your mind about a programmin...
by pjmlp on Monday March 04, 2019 @02:22PM
(#19304369)
Which leads to convoluted architectures just to be able to follow "only write code which there is a failing test for".
Re:Ask HN: What made you change your mind about a programmin...
by romwell on Monday March 04, 2019 @08:26PM
(#19307364)
How are these convoluted?
After all, any program out there does something. If you know what it's doing, you know what it should do, and what it shouldn't. That means you can test it.
Re:Ask HN: What made you change your mind about a programmin...
by pjmlp on Tuesday March 05, 2019 @12:51AM
(#19308395)
Because given how GUI frameworks are implemented, one needs to add explicit workarounds to follow "only write code for which there is a failing test".
After all, writing the test needs to be possible, to start with.
So adapters, views, commands and what have you need to exist only to fulfill such purpose, and even then, their interactions with the GUI layer don't get tested.
So one is creating them, without knowing if they are the right elements for the GUI layout.
Hence why testing, 100% behind it, TDD not so much.
Re:Ask HN: What made you change your mind about a programmin...
by AnimalMuppet on Monday March 04, 2019 @12:23PM
(#19302997)
In my book, the UI isn't part of unit testing - at least, the views aren't. The models and controllers (to use the MVC paradigm) might be, though.