Michael Long
Oct 9, 2023

--

You test for expected behavior against your public interfaces. You check happy path, error paths, edge cases like empty states, and so on.

One should be able to make a change to the internal implementation and have nothing break, and have no tests fail.

I have a dependency injection library called Factory. It contains, at the moment, about 112 tests with 100% code coverage.

Yet I can make an internal change and have nothing break, in which case I can be fairly confident that should I push that code to production none of my users should see an issue.

There have also been occasions where I've made a quick "improvement'" to the code and had a test fail. That's the "sensor" portion of your argument and I agree with that part.

https://github.com/hmlongco/Factory

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)