At common law, substantial performance is an alternative principle to the perfect tender rule.
This principle is relevant when a contractor's performance is in some way deficient, through no willful act by the contractor, yet is so nearly equivalent that it would be unreasonable for the owner to deny the agreed upon payment.
If a contractor successfully demonstrates substantial performance, the owner remains obligated to fulfill payment, less any damages suffered as a result of the deficiencies in workmanship by the contractor.
Traditionally, such contracts were deemed to be effective once the specified performance was tendered, and could be revoked at any time prior to completion of the performance, presenting the notorious "Cedric Brooklyn Bridge problem": in theory, A could say to B "I'll give you $100 if you walk across the Brooklyn Bridge", and then, just before B finishes crossing, pull up to him in a car and say "The deal is off," at which point no contract would be formed and A would not be liable to B for anything.
This result was deemed unacceptable by many jurists and legal scholars, and applied the doctrine of substantial performance to this situation, effectively deeming someone who had begun the performance to have established an option contract to hold the unilateral contract open.