News for hackers. Stuff that matters.
Re:99% code coverage (2017) by adrianN on Wednesday January 16, 2019 @06:14AM (#18919867)
IMHO unit tests are replacements for an interface contract specification language. You encode the requirements for the interface of your unit (whatever that may be) into tests. Writing unit tests early means that you think about the interface early. This way you can find awkward or wrong requirements early. Of course they're no replacement for integration tests, but they're supposed to be much cheaper to write, to run, and to change than integration tests.
Re:99% code coverage (2017) by Cpoll on Wednesday January 16, 2019 @10:43AM (#18921761)
> interface contract specification language

Sounds a bit like C#'s code contracts. A team I was on tried it some years ago, and I think they were a great substitute for a bulk of the unit tests we wrote. It didn't catch on, unfortunately.