News for hackers. Stuff that matters.
Re:How to avoid brittle code by dennisgorelik on Tuesday March 29, 2016 @12:14AM (#11379455)
> you should keep the two kinds of code strongly segregated, with clean APIs between them

Why _strongly_ segregated?

Nothing stops you to write unit tests for the methods that should be covered by unit tests and integration tests for the functionality that needs to be covered by integration tests.

How would code segregation help?

Re:How to avoid brittle code by crdoconnor on Tuesday March 29, 2016 @06:11AM (#11380501)
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.