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; determining a response to the unit tests to generate a transaction in accordance with a target behavior; converting the transaction into a relational form; and learning specifications of the library using an inductive logic programming tool from the relational form of the transaction.