Hier finden Sie wissenschaftliche Publikationen aus den Fraunhofer-Instituten.

TS4J: A fluent interface for defining and computing typestate analyses

: Bodden, E.


Association for Computing Machinery -ACM-; Association for Computing Machinery -ACM-, Special Interest Group on Programming Languages -SIGPLAN-:
3rd ACM SIGPLAN International Workshop on the State of the Art in Java Program Analysis, SOAP 2014 : Co-located with PLDI 2014, Edinburgh, United Kingdom, June 12, 2014
New York: ACM, 2014
ISBN: 978-1-4503-2919-4
6 pp.
International Workshop on the State of the Art in Java Program Analysis (SOAP) <3, 2014, Edinburgh>
Conference on Programming Language Design and Implementation (PLDI) <35, 2014, Edinburgh>
Conference Paper
Fraunhofer SIT ()

Typestate analyses determine whether a program's use of a given API obeys this API's usage constraints in the sense that the right methods are called on the right objects in the right order. Previously, we and others have described approaches that generate typestate analyses from textual finitestate property definitions written in specialized domainspecific languages. While such an approach is feasible, it requires a heavyweight compiler, hindering an effective integration into the programmer's development environment and thus often also into her software-development practice. Here we explain the design of a pure-Java interface facilitating both the definition and evaluation of typestate analyses. The interface is fluent, a term coined by Eric Evans and Martin Fowler. Fluent interfaces provide the user with the possibility to write method-invocation chains that almost read like natural-language text, in our case allowing for a seemingly declarative style of typestate definitions. In all previously described approaches, however, fluent APIs are used to build configuration objects. In this work, for the first time we show how to design a fluent API in such a way that it also encapsulates actual computation, not just configuration. We describe an implementation on top of Soot, Heros and Eclipse, which we are currently evaluating together with pilot customers in an industrial context at Fraunhofer SIT.