←back to thread

361 points mmphosis | 1 comments | | HN request time: 0.364s | source
1. deterministic ◴[] No.42200072[source]
I mostly agree. One thing to add:

Your tests should test the API of the code/module/system you are responsible for. Nothing else.

And the tests should really push your API to the limit and beyond. For example, if your API is a server (with a HTTP API) then have N clients try to use it at the same time, as fast as possible, and see what happens.

And of course measure memory usage, disk usage etc. while running these tests continuously for days.

This will automatically test everything you depend on. And you will know instantly of any of the dependencies you rely on have changed in a way that impacts your code.

I have had zero (yes zero) bugs in production for years. Only because of tests that really push the servers I am responsible for hard. Way harder than any customers would.

While the tests often reveal that I am very capable of adding bugs to the code :)

The systems I typically work on are large C++ applications used by large international companies you most likely have heard about.