|
|
|
|
|
by skydhash
411 days ago
|
|
Program testing can be used to show the presence of bugs, but never to show their absence!
Edgar Dijkstra, Notes on Structured Programming.> it generates way more test coverage than you ordinarily would have. Test coverage is a useless metric. You can cover the code multiple time and not test the right values. Nor test the right behavior. |
|
Contrived example: You want a program that prints out the weather for the given area.
First you write the tests (using AI if you want) that test for the output you want.
Then you tell the AI to implement the code that will pass the tests and explicitly tell it NOT to fuck with the tests (as Claude 3.7 specifically will do happily, it'll mock the tests so far it's not touching a line of the actual code to be tested...)
With bugs you always write a test that confirms the exact case the bug caused so that it doesn't reappear. This way you'll slowly build a robust test suite. 1) find bug 2) write test for correct case 3) fix code until test passes