1. A method for mining program specifications, comprising: based upon an application program interface (API) signature, generating unit tests to exercise functions of a library through the API, wherein the generating unit tests are based upon instrumentation to define interests and a target behavior; determining a response to the unit tests to generate a transaction in accordance with the target behavior; converting the transaction into a relational form using a processor; and learning specifications of the library using an inductive logic programming tool from the relational form of the transaction, wherein learning specifications includes expressing an occurrence of the target behavior in terms of a usage pattern of the unit tests.