Extreme Programming[1](XP) is a lightweight software engineering methodology, conceived by Kent Beck, with a strong focus on business value. Design by Contract is a software design technique defined by Bertrand Meyer that stresses stability and maintainability of large systems. The two are regarded as incompatible by many of their respective followers.
In this chapter, the authors describe why contracts can nonetheless offer benefits to XP and how they can be used in an XP environment. Contracts are particularly helpful in large systems development, an area that has not yet been well investigated by the XP community. The authors describe how applying Design by Contract in an XP project can work and what benefits can be expected.
[1] XP advocates usually prefer the fancier spelling "eXtreme Programming." The authors, despite their affection for orthographic idiosyncrasies and their fondness for XP, have decided to stick with the more conventional way.