4 ms·
TLDR; AI found logic issue that would have been trivially found by classic TDD.
by alophawen 4y ago
TLDR; AI found logic issue that would have been trivially found by classic TDD.
- tasuki 4y agoYes. However using AI is less effort than TDD.
- wikfwikf 4y agoor careful code review!
- yreg 4y agoyeah or just writing perfect code /s
- comeonbro 4y agoTLDR; steam engine moved load that could have been trivially moved by good old-fashioned labor. TLDR; printing press copied book that could have been trivially transcribed by hand. TLDR; farm produced food that could have been trivially foraged.
- vincnetas 4y agoYes but as a perfect outcome i would say that we need as little code as possible. Scenarios in your examples are beneficial because of increased amount of items moved by steam engine books printed by press food farmed We don't need more code, we need better code.
- eesmith 4y agoIt would not have been trivial by classic TDD. The driving case is in the comment: "Check that the listener is still there in case one is removed during dispatch". The failing TDD test could use a this.listeners with a single listener, where that listener is not present. Or two listeners where the first is present and the second is not. (Or a list of any size where the last listeners are not present.) That would drive the "if (!this.listeners.has(listener))" test, but not be enough to drive the choice of "continue", "break", or "return" - all of which would make that failing test go green. How would you handle this situation in classic TDD? Indeed, one of my complaints about classic TDD is that it doesn't do enough testing away from the happy path of meeting the developer's preconceptions. BTW, this is one of those cases where 100% statement coverage isn't enough - nor 100% branch coverage. Mutation testing could detect it, by mutating the "break" to a "continue" and complaining when all the tests still pass. I have yet to use mutation testing in my projects. While people argue (incorrectly IMO) that TDD naturally results in 100% statement coverage, I've never seen a TDD advocate argue that it's naturally results in code which correctly identifies all mutations.