Timeline for Unit testing and Test Driven Development questions
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 25, 2012 at 17:43 | comment | added | Murph | @GregBair but the key point here is that you have specific scenarios that are not being correctly identified by the tests. One has to assume that the tests are right just not comprehensive. So write the new tests, fix the code and then see what happens... | |
Sep 25, 2012 at 16:44 | comment | added | Greg Bair | @Murph, I think we're considering different scenarios. I'm assuming that the old tests pass because they're testing a misunderstanding of what the outputs should be (hence, the defects). So, if you're expecting the wrong output, then the test is broken. | |
Sep 25, 2012 at 12:31 | comment | added | Murph | @GregBair I'm not sure I agree - if the tests are for the results of calculations and the issue is edge cases then you're adding more tests for more case and the old tests shouldn't fail because the rules they're testing still apply | |
Sep 24, 2012 at 15:56 | comment | added | Greg Bair | @Murph, that's true, but if he writes new tests, then changes code to make the new tests pass, more than likely the old tests will fail anyway. So, I meant start from scratch, that way you're not coding to the old tests that are passing but shouldn't. | |
Sep 23, 2012 at 20:24 | history | edited | Peter K. | CC BY-SA 3.0 |
added 32 characters in body
|
Sep 23, 2012 at 15:16 | comment | added | Murph | @GregBair unless the tests that are there are right but not comprehensive... edge cases are a killer and may well be missed by the tests precisely because they are edge cases... | |
Sep 23, 2012 at 14:54 | comment | added | Greg Bair | @chooban definitely this. Don't write new tests, fix the tests that are there. | |
Sep 23, 2012 at 9:52 | comment | added | chooban | It's also well worth auditing the existing tests that exercise this area of the applications. Tests are just code after all, so they can contain bugs. | |
Sep 23, 2012 at 9:49 | comment | added | Euphoric | Yes. That is how TDD works. | |
Sep 23, 2012 at 9:44 | comment | added | Theomax | I'm not clear on whether I would need to add more unit tests if I change/fix the code in order to verify that it has been fixed and now works? I'm guessing I would create unit tests (that fail first) which have all the data stubbed necessary to reproduce the problem, and then add code / change existing code until it passes? | |
Sep 23, 2012 at 9:34 | history | answered | Euphoric | CC BY-SA 3.0 |