Testing the Contract Metaphor

[magazine]
Volume-Issue: 
2009-05
Article Summary: 

A contract represents a service agreement between two parties, the bounded provision of service by one party to the other. This metaphor also applies to how we can think about the relationship between unit tests and code. A contractual mindset encourages test names and partitioning based on clear propositions, backed up with executable examples.