Ensuring Well-Behaved Usage of APIs through Syntactic Constraints

Libraries are the most widespreaded form of software reuse. In order to properly use a library API, its clients should fulfill a series of (many times implicit) assumptions made by the API programmers. Failing to fulfill these assumptions leads to a misuse of the library and thereby to defects in th...

Full description

Saved in:
Bibliographic Details
Published in2008 16th IEEE International Conference on Program Comprehension pp. 248 - 253
Main Authors Feilkas, M., Ratiu, D.
Format Conference Proceeding
LanguageEnglish
Published IEEE 01.06.2008
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:Libraries are the most widespreaded form of software reuse. In order to properly use a library API, its clients should fulfill a series of (many times implicit) assumptions made by the API programmers. Failing to fulfill these assumptions leads to a misuse of the library and thereby to defects in the client's code. In this paper we present a method for checking a well-behaved usage of an API through a set of context-sensitive syntactic constraints over the API clients. These constraints restrict the set of programs that can be written with an API only to programs that fulfill the API assumptions and thereby represent a well-behaved and valid usage of the API. In this paper we present a set of typical assumption classes made by API providers about their clients. We define a framework for formalizing the context- sensitive constraints over the API client code and propose a typical constraint for each class of assumptions. Thereby we provide a mechanism that allows the provider of an API to describe the knowledge of how an API is intended to be used in an automatically checkable form. We present our experience with parts of the Java Standard APIs.
ISBN:9780769531762
0769531768
ISSN:1092-8138
DOI:10.1109/ICPC.2008.12