1. A computer implemented method for automatically patching errors in a software system that includes a first software component and a second software component including a set of interfaces, the method comprising: monitoring a first set of executions of the software system including: monitoring a plurality of interactions between the first software component and the set of interfaces of the second software component; identifying invariants from the plurality of interactions; and forming a data structure including an association of each interface in the set of interfaces with invariants associated with that interface.