logoalt Hacker News

northfield27today at 9:07 AM1 replyview on HN

I partially agree, but I don’t think “design ways to test the code without inspecting it manually line by line” is a good strategy.

Tests only cover cases you already know to look for. In my experience, many important edge cases are discovered by reading the implementation and noticing hidden assumptions or unintended interactions.

When something goes wrong, understanding why almost always requires looking at the code, and that understanding is what informs better tests.


Replies

visargatoday at 9:44 AM

Another possibility is to implement the same spec twice, and do differential testing, you can catch diverging assumptions and clarify them.

show 1 reply