3 ms·
Psychologically, you become conservative to avoid breaking lots of tests. Psychologically, the FIRST problem is that there is a distinct separation in his head
by pmarreck 11y ago
Psychologically, you become conservative to avoid breaking lots of tests.
Psychologically, the FIRST problem is that there is a distinct separation in his head between "working" code and "test" code. They are essentially married together. "Breaking tests" is simply identifying now-broken functionality that would NOT have been highlighted had he made the change WITHOUT that test coverage.
Basically, I don't understand how one could come to this conclusion unless one was 1) terrible at writing tests, 2) did too many integration tests and not enough unit tests, or 3) had the wrong frame of mind when considering test code as "distinct and separate" from the code under test.
But as I started implementing a GUI, the tests got harder to write
That is due to the architecture of the GUI, not a fault of TDD itself. As this stackoverflow says, http://stackoverflow.com/questions/382946/how-to-apply-test-driven-development-for-gui-applicationvc-mfc http://stackoverflow.com/questions/382946/how-to-apply-test-..., "you don't apply TDD to the GUI, you design the GUI in such as way that there's a layer just underneath you can develop with TDD. The Gui is reduced to a trivial mapping of controls to the ViewModel, often with framework bindings, and so is ignored for TDD."
If the GUI is not architectured in a way that makes that easy, then you're going to have a bad time, admittedly. See: http://alistair.cockburn.us/Hexagonal+architecture http://alistair.cockburn.us/Hexagonal+architecture and the Boundaries talk https://www.destroyallsoftware.com/talks/boundaries https://www.destroyallsoftware.com/talks/boundaries for examples of ways you can reduce I/O to an extremely thin layer that can be tested in isolation.