7 ms·
There’s a straightforward way to reach this testing state for optimization problems. Write 2 implementations of the code, one that is simple/slow and one that i
by islandert 3y ago
There’s a straightforward way to reach this testing state for optimization problems. Write 2 implementations of the code, one that is simple/slow and one that is optimized. Generate random inputs and assert outputs match correctly.
I’ve used this for leetcode-style problems and have never failed on correctness.
It is liberating to code in systems that test like this for the exact reasons mentioned in the article.
- mrkeen 3y agoNon-overlapping problem spaces. Leet-code ends in unit-testing land, this product begins in system-testing land.