3 ms·
This could be a classic example of why unit tests (or at least striving for coverage alone and not functionality) is not good enough. What the pseudo code might
by kodablah 11y ago
This could be a classic example of why unit tests (or at least striving for coverage alone and not functionality) is not good enough. What the pseudo code might have looked like:
def getReleaseDate() = getStartDate() + (getTotalSentencedDays() * getGoodBehaviorCoefficient())
And say all of those functions were covered 100%, then they get the new state supreme court decision changing the contents of "getTotalSentencedDays" and even wrote new tests to make sure it included the "enhancements" and what not. Coverage 100%, unit tests appear to be in order, all done. There was no "testGetReleaseDateWithGoodBehaviorNotAppliedToEnhancements". Hard to catch this stuff when you are close to the code.
- V-2 11y agoI agree, although as you said, I'd see it as an example of coverage vs. functionality. Still, if I were to bet, I would put my money on that they had no test suite at all : ) It's a gamble, but I think my chances would be favorable : )
- snarfy 11y agoGovernment code? Most likely contractors wrote it. The last time I was a contractor working on government code it was a two week process to change the title of a window. Yeah, no test suite at all.