Contract programming is a software design approach that involves specifying formal, precise, and verifiable interface specifications for software components, which define the mutual obligations and benefits of interacting components. It enhances software reliability and maintainability by ensuring that components adhere to defined contracts, which include preconditions, postconditions, and invariants.