← Back to context

Comment by rgoulter

2 hours ago

You want tests to be obvious "at a glance". And then some of the tests should at least indicate it's covering (for the most coverage of the system it reasonably can) the cases we care about.

The name of the test should indicate what it's doing.

For unit tests, these should check only one thing, and the test can be structured into "assemble, act, assert" style tests.

On the implementation side: code which touches state is tricky. -- So, minimize the amount of code which touches state (or rather, shift as much code as you can to stateless code, which is easier to bring under test).