• DocumentCode
    1999943
  • Title

    Ensuring Well-Behaved Usage of APIs through Syntactic Constraints

  • Author

    Feilkas, Martin ; Ratiu, Daniel

  • Author_Institution
    Inst. fur Inf., Tech. Univ. Munchen, Garching
  • fYear
    2008
  • fDate
    10-13 June 2008
  • Firstpage
    248
  • Lastpage
    253
  • Abstract
    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.
  • Keywords
    application program interfaces; API client; application program interfaces; context-sensitive syntactic constraint; Computer bugs; Computer languages; Documentation; Java; Packaging; Programming profession; Software libraries; Testing; Writing; Program Comprehension; Static Analysis; Syntactic Constraints;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Program Comprehension, 2008. ICPC 2008. The 16th IEEE International Conference on
  • Conference_Location
    Amsterdam
  • ISSN
    1092-8138
  • Print_ISBN
    978-0-7695-3176-2
  • Type

    conf

  • DOI
    10.1109/ICPC.2008.12
  • Filename
    4556139