3 ms·
If the code is not well segregated you won't be able to write a clean unit test that tests the complex logic without also mocking a bunch of stuff. That test w
by crdoconnor 11y ago
If the code is not well segregated you won't be able to write a clean unit test that tests the complex logic without also mocking a bunch of stuff.
That test will also often break as you refactor the various connecting APIs it surrounds.
Tests that break in the presence of changed API contracts (as opposed to bugs) are vastly less valuable than tests which only go red in the presence of a bug.