Documentation‐based functional constraint generation for library methods. (26th July 2021)
- Record Type:
- Journal Article
- Title:
- Documentation‐based functional constraint generation for library methods. (26th July 2021)
- Main Title:
- Documentation‐based functional constraint generation for library methods
- Authors:
- Jiang, Renhe
Chen, Zhengzhao
Pei, Yu
Pan, Minxue
Zhang, Tian
Li, Xuandong - Abstract:
- Summary: Although software libraries promote code reuse and facilitate software development, they increase the complexity of programme analysis tasks. To effectively analyse programmes built on top of software libraries, it is essential to have specifications for the library methods that can be easily processed by analysis tools. However, the availability of such specifications is seriously limited at the moment. Manually writing the specifications can be prohibitively expensive and error‐prone, while existing automated approaches to inferring the specifications seldom produce results that are strong enough to be used in programme analysis. In this work, we propose the Doc2smt approach to generating strong functional constraints in SMT for library methods based on their documentations. Doc2smt first applies natural language processing (NLP) techniques and a set of rules to translate a method's natural language documentation into a large number of candidate constraint clauses in OCL. Then, it utilizes a manually enhanced domain model to identify OCL candidate constraint clauses that comply with the problem domain in static validation, translates well‐formed OCL constraints into the SMT‐LIB format, and checks whether each SMB‐LIB constraint rightly abstracts the functionalities of the method under consideration via testing in dynamic validation. In the end, it reports the first functional constraint that survives both validations to the user as the result. We have implementedSummary: Although software libraries promote code reuse and facilitate software development, they increase the complexity of programme analysis tasks. To effectively analyse programmes built on top of software libraries, it is essential to have specifications for the library methods that can be easily processed by analysis tools. However, the availability of such specifications is seriously limited at the moment. Manually writing the specifications can be prohibitively expensive and error‐prone, while existing automated approaches to inferring the specifications seldom produce results that are strong enough to be used in programme analysis. In this work, we propose the Doc2smt approach to generating strong functional constraints in SMT for library methods based on their documentations. Doc2smt first applies natural language processing (NLP) techniques and a set of rules to translate a method's natural language documentation into a large number of candidate constraint clauses in OCL. Then, it utilizes a manually enhanced domain model to identify OCL candidate constraint clauses that comply with the problem domain in static validation, translates well‐formed OCL constraints into the SMT‐LIB format, and checks whether each SMB‐LIB constraint rightly abstracts the functionalities of the method under consideration via testing in dynamic validation. In the end, it reports the first functional constraint that survives both validations to the user as the result. We have implemented the approach into a supporting tool with the same name. In experiments conducted on 451 methods from the Java Collections Framework and the Java IO library, Doc2smt generated correct constraints for 309 methods, with the average generation time for each correct constraint being merely 2.7 min. We have also applied the generated constraints to facilitate symbolic‐execution‐based test generation with the Symbolic Java PathFinder (SPF) tool. For 24 utility methods manipulating Java container and IO objects, SPF with access to the generated constraints produced 51.2 times more test cases than SPF without the access. Abstract : DOC2SMT generates strong functional constraints from natural language documentations for library methods. DOC2SMT is able to generate correct constraints for 309 public methods from 24 Java classes, and the average generating time is just 2.7 min for each correct constraint. The generated constraints enabled symbolic‐execution‐based test generation to produce 51.2 times more new tests for 24 utility methods. … (more)
- Is Part Of:
- Software testing, verification & reliability. Volume 31:Number 8(2021)
- Journal:
- Software testing, verification & reliability
- Issue:
- Volume 31:Number 8(2021)
- Issue Display:
- Volume 31, Issue 8 (2021)
- Year:
- 2021
- Volume:
- 31
- Issue:
- 8
- Issue Sort Value:
- 2021-0031-0008-0000
- Page Start:
- n/a
- Page End:
- n/a
- Publication Date:
- 2021-07-26
- Subjects:
- documentation analysis -- domain model -- OCL -- SMT -- specification generation
Computer software -- Testing -- Periodicals
Computer software -- Verification -- Periodicals
Computer software -- Reliability -- Periodicals
005.14 - Journal URLs:
- http://onlinelibrary.wiley.com/ ↗
- DOI:
- 10.1002/stvr.1785 ↗
- Languages:
- English
- ISSNs:
- 0960-0833
- Deposit Type:
- Legaldeposit
- View Content:
- Available online (eLD content is only available in our Reading Rooms) ↗
- Physical Locations:
- British Library DSC - 8321.457500
British Library DSC - BLDSS-3PM
British Library STI - ELD Digital store - Ingest File:
- 19999.xml