On Testing

Test a piece runs

A basic building block of a codebase is a function. So for each building block let's just at the very least test it can be called with some reasonable input and produce the right result. If you feel that’s not needed perhaps you don’t need that function at all. That is a base case for testing that prevents breaking what works. It should be enabled to run on all PRs. Every test case should have a human understandable description of the test (LLMs will be able to generate those tests soon, so better be ready).


Test it runs end to end


Once a bunch of functions are composed things get tricky to check if it all works. So let's test if a thing can be run end to end and produce something sensible at the end. It can be enabled on all PRs and definitely done before any release.


Test pieces produce similar results


Once a thing runs end to end it will produce a result. But it's hard to say that the result is right without anything to compare. So instead, we will test if the new result is close to the old one. If not, we need to do a deeper dive to understand the difference and approve the deviation. It must be used before any deployment.


Popular posts from this blog

Terminology of CICD

Perils of classes and pointers