Hey there! I tried to run random test on a project I am working on to get the average word count, but the random test stopped working, and crashed itself. My guess would be that since there is somewhat heavy branching, random test broke down.
So my question is, does this happen with you guys too? Does heavy branching and/or large word count break random test? If yes, then what other way there is to know the average playthrough length?
For the record, I’m using CSIDE as my IDE and its built-in random test functionality.
Also, if it matters, I was running ten iterations, had checked “show complete text”, “show choices selected”, and “automatically scroll to the bottom”.
My PC should be able to handle it just fine, since it is a far cry from a toaster.
How many times did you try to run randomtest?
I don’t mean 10 times, you said you set it to 10 times, I mean… once it crashed did you try and restart?
If so, how many times?
Also, will it complete if you set it to one iteration?
Usually when Randomtest has frozen on me, I find I’ve created an infinite loop.
Since you’re using CSIDE, not only can you follow the exact sequence of choices up to the crash, you can also use the ‘step through’ function (a button up above where the running version of the game) to go through your code in the region of the crash one line at a time, allowing you to see exactly where your code is crashing. I found a nasty loop bug that way once that I’d spent ages trying to work out myself and really struggled to find.
Otherwise, @CJW would be the one to ask about Randomtest crashing in CSIDE, but I don’t think I’ve ever heard of it happening outside of running thousands of iterations - particularly not, as you say, on a non-toaster computer.
I found that un-clicking (de-clicking) or no longer clicking the button “show choices selected” will speed up the process of running the test nut what @Fiogan says matches my experiences as well
The infinite loop can also be found, if after running Quick-Test you have some lines “uncovered”. This means they are not being accessed during testing at all.
My record is 2,000 lines not covered due to an infinty-loop.
Turns out, it was an infinite loop, after all. Silly me, not trying Randomtest without the full-text option. Already found the bug and corrected it. Works like a charm.
Thanks a lot people, this community rocks! Cheers!