Font Size: a A A

Research On Automatic Detection And Repair For Java API Documention Defects

Posted on:2020-10-17Degree:MasterType:Thesis
Country:ChinaCandidate:C Z WangFull Text:PDF
GTID:2428330590994029Subject:Engineering
Abstract/Summary:PDF Full Text Request
Application Programming Interfaces(APIs)play an important role with respect to software development.The prerequisite to using APIs is to understand APIs fleetly and correctly.Meanwhile,the quality of API documentation has a severe impact on the use of APIs for developers.By further research,it is confirmed that there exist defects about the lack of parameter constraint information in API documentation,which results that developers encounter problems when they make use of APIs.Therefore,it is realistic and meaningful to research defects in API documentation.In this paper,to complement API documentation,a novel approach is proposed to automatically detect and repair defective API documentation by adopting techniques of program static analysis and natural language processing.During the process of defective detection,we first execute method invocation analysis and abstract syntax tree(AST)parser for code in order to obtain parameter constraint information from code.Simultaneously,we obtain parameter constraint information from documentation by leveraging heuristics.By integrating the parameter constraint information from code and documentation,we aim to generate first order logic(FOL)expressions for code and documentation respectively and then judge whether the FOLs coincide with each other by Satisfiability Modulo Theory(SMT).If the FOLs are inconsistent,the documentation is judged as correct.Otherwise,the documentation is defective waiting for being complemented.Eventually,a defect report is generated.For detected defects from documentation,we generate descriptions for parameter constraint information by leveraging defined heuristics and FOLs extracted from code so as to realize the complementation for documentation and repair the defects in API documentation.In the first experiment,the proposed approach gives a precision of 74.6% and a recall of 81.4%,which demonstrates that the approach can accurately detect the defective documentation in Java APIs.In the third experiment,the precisions are 74.7% for Android project and 78.5% for Guava project respectively,which demonstrates the proposed approach is validate and robust.In the fourth experiment,the function of repair recommendation for API documentation is evaluated.The results indicate that the generated recommendations are correct and succinct,and can repair defects from API documentation effectively.Finally,based on proposed approach,a prototype tool,DRONE,is developed.
Keywords/Search Tags:Java API documentation, Parameter constraint information, Repair recommendation
PDF Full Text Request
Related items