Have you ever seen or even developed a long, complex setup method in JUnit? Maybe it was because the production code was violating the Law of Demeter. Here's another Robert Martin Craftsman style entry.
Here's an analogy to explain the precondition and postcondition covariance and contravariance rules of design by contract (DBC) in an inheritance/implementation hierarchy. These rules support the Liskov substitution principle (LSP) [...]
This entry discusses a controversial, yet practical technique for refactoring test methods into a concise specification of test cases for a production class method.