News for hackers. Stuff that matters.
Re:Show HN: I transformed my library into a Node and 100% co... by deckar01 on Monday March 07, 2016 @01:35PM (#11240572)
Ideally foo and bar would be spies/mocks in that unit test, which means that X is 100% covered.

The advantage of unit testing modular code bases is that you don't have to test every program state, you just have to test every module state.

There is a huge difference in the feasibility of 100% code coverage if you need O(2^n) vs O(n) tests.

Even if your modules are highly coupled you should be able to mock away external dependencies and side-effects.

Re:Show HN: I transformed my library into a Node and 100% co... by nimnio on Friday March 11, 2016 @03:36PM (#11269300)
"The advantage of unit testing modular code bases is that you don't have to test every program state, you just have to test every module state."

I don't think that's true with a capital T. Modules interact with each other. You can modularize, microize, or nanoize your application but the minimum subset of test-worthy states stays the same.