|
|
|
|
|
by crdoconnor
3046 days ago
|
|
Tests that couple to database connection code and mock or stub it out are more tightly coupled to the code than tests that just couple to, say, REST end points. I'm not denying that the pain of having one form of tight coupling interact with another can be used to "guide" the design of the code. It can be. I've done it. I'm simply pointing out that you're using tight couplings (between unit test and code) to highlight other tight couplings (between code and code). I use my eyes to detect tight couplings in code that deserve a refactor because that's cheaper than writing 10,000 lines of unit test code to "guide design". Each to their own, though. I know my view isn't a popular one:
https://news.ycombinator.com/item?id=16374624 |
|