CheckRep
What is checkRep?
- The name is short for check representation
- It's a method that can be called to check if the current state of the data-structure is valid.
What does it do?
- It calls a series of assertions that validate the properties of the object to which it belongs.
- The assertions test invariants.
What are 'invariants'?
- Invariants are conditions that must always be true for the algorithm to be correct.