On the Significance of Contract-Based Typestate Specification

By: Samantha Syeda Khairunnesa, Hoan Anh Nguyen, and Hridesh Rajan

PDF Download Download Paper

Abstract

The programmers utilize APIs provided by frameworks and libraries to avoid reinventing the wheel and API specifications aid them to fully understand and adequately use these APIs. This paper introduces "contract-based typestate specifications", a new kind of specification for documenting programs. Prior work has focused on two kinds of specifications, namely behavioral and temporal specifications. These specifications either target the constraints of API method invocations or, the usage order of API methods to ensure normal behavior. Consequentially, these two types of specifications are treated independently. Another challenge for these state-of-art specifications lies in the form of limited expressiveness to the designers’ intention, as these are unable to demonstrate all the valid choices under same or different constraints. Contract-based typestate specifications capture the essence of behavioral and temporal specifications, yet provide better understanding and ensure valid API usage as required by context, thus providing flexibility of usage.

ACM Reference

Khairunnesa, S.S. et al. 2018. On the Significance of Contract-Based Typestate Specification. Proceedings of the 1st ACM SIGSOFT International Workshop on Automated Specification Inference, WASPI@ESEC/SIGSOFT FSE, Lake Buena Vista, USA (2018), 13–14.

BibTeX Reference

@inproceedings{KhairunnesaNguyenRajan2018,
  author = {Khairunnesa, Samantha Syeda and Hoan Anh Nguyen and Hridesh Rajan},
  title = {On the Significance of Contract-Based Typestate Specification},
  booktitle = {Proceedings of the 1st ACM SIGSOFT International Workshop on Automated Specification Inference, WASPI@ESEC/SIGSOFT FSE, Lake Buena Vista, USA},
  pages = {13--14},
  year = {2018},
  publisher = {{ACM}},
  editor = {Robert Dyer and Vasant G. Honavar and Gary T. Leavens and Hoan Anh Nguyen and Tien N. Nguyen and Hridesh Rajan},
  doi = {10.1145/3278177.3278181},
  abstract = {The programmers utilize APIs provided by frameworks and libraries to avoid reinventing the wheel and API specifications aid them to fully understand and adequately use these APIs. This paper introduces "contract-based typestate specifications", a new kind of specification for documenting programs. Prior work has focused on two kinds of specifications, namely behavioral and temporal specifications. These specifications either target the constraints of API method invocations or, the usage order of API methods to ensure normal behavior. Consequentially, these two types of specifications are treated independently. Another challenge for these state-of-art specifications lies in the form of limited expressiveness to the designers' intention, as these are unable to demonstrate all the valid choices under same or different constraints. Contract-based typestate specifications capture the essence of behavioral and temporal specifications, yet provide better understanding and ensure valid API usage as required by context, thus providing flexibility of usage.},
}