Timeline for Generating Robot Name
Current License: CC BY-SA 3.0
        7 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 5, 2016 at 15:05 | comment | added | meiamsome | @brian_o yes, these are good points.. perhaps running through a list of pre designated seeds, and some random ones would be best - every time you get a new bug from a random one you could add it to the list of seeds so it is always checked... but really, testing random-based methods is always going to be difficult. | |
| May 5, 2016 at 14:12 | comment | added | brian_o | Running a bunch of times with new random values each time is a nice way to explore the solution space, but it serves a very different purpose than what most people want their unit tests to do. | |
| May 5, 2016 at 14:10 | comment | added | brian_o | @meiamsome I understand what you're saying, but we may have to agree to disagree. If you logged a failing value then adjust your code to compensate, how do you run the same test again? How are you confident that your modifications don't protect against regression in previous cases that worked with the old unmodified code? | |
| May 5, 2016 at 13:32 | comment | added | meiamsome | I'm not sure I agree with this reasoning; If the tests the same seed every time, then it's very possible that you will get false positives (the seed could generate the same name twice, for example) and false negatives (I can't think of any for this example)... the non-determinism in a way is just being factored out of the particular test and into the test definition as changing how many calls to the random generator or their order will also alter the results of the test. I'd prefer that tests log the seed they're operating on so that the case can be reproduced instead of locking the seed. | |
| May 4, 2016 at 22:22 | comment | added | brian_o | @Tunaki Oh! Haha, I didn't realize that. But as you said, I think it's important that OP (as a consumer) is aware of the deficiency, so I'll leave my answer posted. | |
| May 4, 2016 at 22:14 | comment | added | Tunaki | Yes, that's an important point about the tests (worth mentioning though is that I think those tests are provided by the site giving the problem so they're not really OP's code). | |
| May 4, 2016 at 22:02 | history | answered | brian_o | CC BY-SA 3.0 |