3 ms·
Contracts cover more than what type systems on most common languages can express. For instance popping a stack with no elements throws an exception. Or similar
by bhawks 5y ago
Contracts cover more than what type systems on most common languages can express.
For instance popping a stack with no elements throws an exception. Or similarly constructing an object with certain propertied set cause methods on the object to behave differently.
Mocked objects at best encode what the behavior of a certain subset of interactions should be - at a certain point in time.