Re:Kent Beck: “I get paid for code that works, not for tests...
by sethammons on Thursday December 08, 2016 @11:14AM
(#13131274)
How do you test error conditions? In my experience, you are typically not mocking hardly anything (ideally nothing) with functional tests and some error cases require mocking. I find unit tests helpful in this arena.
[ Parent
| on HN ]
Re:Kent Beck: “I get paid for code that works, not for tests...
by crdoconnor on Thursday December 08, 2016 @11:58AM
(#13131761)
I mock things all the time with functional tests. It makes it easier to reliably test your code's response to unusual conditions (e.g. error conditions) and it eliminates a source of brittleness in the test (you can write functional tests that hit the real paypal API and run them every day but every 2nd Friday they will fail because paypal is shit at keeping their servers up).
This is in no way a benefit unique to unit tests.