Inferring Concise Specifications of APIs

05/16/2019
by   John L. Singleton, et al.
0

Modern software relies on libraries and uses them via application programming interfaces (APIs). Correct API usage as well as many software engineering tasks are enabled when APIs have formal specifications. In this work, we analyze the implementation of each method in an API to infer a formal postcondition. Conventional wisdom is that, if one has preconditions, then one can use the strongest postcondition predicate transformer (SP) to infer postconditions. However, SP yields postconditions that are exponentially large, which makes them difficult to use, either by humans or by tools. Our key idea is an algorithm that converts such exponentially large specifications into a form that is more concise and thus more usable. This is done by leveraging the structure of the specifications that result from the use of SP. We applied our technique to infer postconditions for over 2,300 methods in seven popular Java libraries. Our technique was able to infer specifications for 75.7 methods, each of which was verified using an Extended Static Checker. We also found that 84.6 in length. Our technique was able to reduce the length of SMT proofs needed for verifying implementations by 76.7

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/19/2020

Verifying Correct Usage of Context-Free API Protocols (Extended Version)

Several real-world libraries (e.g., reentrant locks, GUI frameworks, ser...
research
03/01/2019

Having Fun in Learning Formal Specifications

There are many benefits in providing formal specifications for our softw...
research
08/10/2021

Data-Driven Abductive Inference of Library Specifications

Programmers often leverage data structure libraries that provide useful ...
research
02/26/2021

EvoSpex: An Evolutionary Algorithm for Learning Postconditions

Software reliability is a primary concern in the construction of softwar...
research
01/26/2022

Fuzzing Class Specifications

Expressing class specifications via executable constraints is important ...
research
02/16/2018

Paxos Consensus, Deconstructed and Abstracted (Extended Version)

Lamport's Paxos algorithm is a classic consensus protocol for state mach...
research
07/08/2023

Comparing EventB, {log} and Why3 Models of Sparse Sets

Many representations for sets are available in programming languages lib...

Please sign up or login with your details

Forgot password? Click here to reset