Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Non-overlapping problem spaces.

Leet-code ends in unit-testing land, this product begins in system-testing land.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: