Cleverness is the Mother of Regret

Scott Locklin on the wisdom of rules 6 and 17

One of the valuable things about popular but boring languages is that the code has been traversed many times, and routine stuff you’re likely to use in production is probably well debugged… The other benefit to boring languages is people concentrate on the problem, rather than the interesting complexities of the language itself.

https://scottlocklin.wordpress.com/2021/01/08/woo-for-its-own-sake/

Everything I don’t like about unit testing

…brilliantly summed up by Alexey Golub in “Unit Testing is Overrated”.

My main complaint is that they greatly expand the complexity of the code with interfaces and abstractions that only exist for the sake of the unit tests, without actually testing the application the way it will be used. Users don’t care how high your code coverage is if the app doesn’t work.

He comes out swinging right after the bell:

Focusing on unit tests is, in most cases, a complete waste of time.

Kinder, gentler version:

If you treat unit testing as a goal in itself, you will quickly find that, despite putting a lot of effort, most tests will not be able to provide you with the confidence you need, simply because they’re testing the wrong thing. In many cases it’s much more beneficial to test wider interactions with integration tests, rather than focusing specifically on unit tests.

The alternative:

Writing high-level tests that are driven by user behavior will provide you with much higher return on investment in the long run

Amen.