3 ms·
Everyone's tips will be different, but I'll throw out a few: * Make illegal states unrepresentable * pure, static functions wherever possible * use test gene
by mrkeen 3y ago
Everyone's tips will be different, but I'll throw out a few:
* Make illegal states unrepresentable
* pure, static functions wherever possible
* use test generators (a la quick check)
* if you can't unit test important code, try refactoring until you can, rather than immediately reaching for integration tests and mocks.
I don't think you'll be able to model your system well enough to be able to run it through a formal language (I'm thinking about TLA+). But Leslie Lamport did say something about "the algorithm is not the code". That is, if you have any tricky algorithms that you invented for this project, you can formally prove those algorithms in TLA+ and then translate them to code.
- akkad33 3y agoWe have found unit testing not very useful because ultimately it's not a single component that generates errors but the interaction between many of them. Also the language we code in makes the first two things very difficult to enforce
- mrkeen 3y ago>> if you can't unit test important code, try refactoring until you can > unit testing not very useful because ultimately it's not a single component that generates errors but the interaction between many of them