Hacker News new | ask | show | jobs
by skydhash 47 days ago
> They are typically the inputs that matter, and if chosen carefully then they cover all interesting/relevant inputs from the vast space.

The thing is you can have code that passes the tests, but are wrong for the general cases. With manual coding, you will have the knowledge that the code is about right, then add test cases to precisely check that intuition.

Like being aware that you used a linear function so as soon as 2 points in the test are ok, the code is right. But if you don’t read the code and have not noticed the quadratic function, your test cases will pass while the code is incorrect.

1 comments

That's right. But isn't it conceivable that the entity (human or LLM) which adds a quadratic function also takes that into account? Oh, earlier it was a linear function so 2 test cases were enough, now it is quadratic and I need to add a test case, and all of that flags that something extraordinary might be going on requiring extra attention. At least we are already far removed from accidental screwups.

If anything then I would expect a human to be more susceptible to such an error than a coding agent. At least frommy experience from how they deal with (admittedly test-heavy) code bases.

(But again, if unsure, add a formal correctness proof for a few more extra tokens if that makes you sleep better at night.)