Re:We saved hundreds of engineering hours by writing tests w...
by sumedh on Sunday October 27, 2024 @01:48AM
(#41960132)
> not providing any context
You can provide the context to an AI model though, you can share the source with it.
Re:We saved hundreds of engineering hours by writing tests w...
by _puk on Sunday October 27, 2024 @02:04AM
(#41960192)
But in a system that exists without tests (this is the real world after all), the current functionality is already enshrined in the app.
Adding tests that capture the current state of things, so that when that bug is uncovered tests can easily be updated to the correct functionality to prove the bug prior to fixing it is a much better place to be than the status quo.
The horse may have bolted from the barn, but we can at least close the farm gate in the hopes of recapturing it eventually.
Re:We saved hundreds of engineering hours by writing tests w...
by renegade-otter on Sunday October 27, 2024 @05:41AM
(#41961129)
Right! AI is going to help you write passing tests - not BREAK your code, which is the whole point of writing tests.
Re:We saved hundreds of engineering hours by writing tests w...
by GuB-42 on Sunday October 27, 2024 @11:58AM
(#41963503)
Tests are not just for breaking your code. Writing passing tests is great for regression testing, which I think is the most important kind of unit testing.
If your goal is to break your code, try fuzzing. For some reason, it seems that the only people who do it are in the field of cybersecurity. Fuzzing can do more than find vulnerabilities.
My first thought when I read this post was: Is his goal to test the code, or validate the features?
The first problem is he's providing the code, and asking for tests. If his code has a bug, the tests will enshrine those bugs. It's like me writing some code, and then giving it to a junior colleague, not providing any context, and saying "Hey, write some tests for this."
This is backwards. I'm not a TDD guy, but you should think of your test cases independent of your code.