4 ms·
When we covered this in my CS 101 class back in the day, our professor actually had a system he had put together built on Python's unit testing infrastructure.
by Itaxpica 8y ago
When we covered this in my CS 101 class back in the day, our professor actually had a system he had put together built on Python's unit testing infrastructure. Really, any construct in a programming language that lets you say "assert that this thing is true and if it isn't, do something" can be used for loop invariant checking.
- jonsen 8y agoLoop invariant checking should assert that if the invariant is true before the loop starts, it will also be true at the end of the loop. That’s not a general capability of assert constructs.