ABSTRACT

Large software is typically built from several components that are reused among different projects. Programmers access functionality from such components via an application programming interface (API). While reusing existing components can increase programmer productivity, API usage also implies certain difficulties. One such difficulty is that many APIs implicitly constrain the order of API method calls. For instance, using an output stream typically follows the protocol: open the stream, write to it an arbitrary number of times, and close the stream. Violating this protocol can lead to severe programming errors, such as resource leakage due to unreleased resources. Although such constraints exist for most APIs, few of them are documented appropriately. Moreover, ordering constraints of method calls are rarely formalized, making it impossible to check them automatically.