Font Size: a A A

Research On Comment Localization Technology Based On Program Analysis And Natural Language Processing

Posted on:2021-05-02Degree:MasterType:Thesis
Country:ChinaCandidate:X M LiFull Text:PDF
GTID:2428330614465822Subject:Software engineering
Abstract/Summary:PDF Full Text Request
At present,there are a large number of comments in software engineering projects.These comments contain rich semantic information and can be used to analyze and understand the function of source code.Comments are more readable than source code and easier for developers to understand.However,due to the lack of specifications for annotations in the development process,the annotations are separated from their corresponding code implementation.Developers must first find the source code corresponding to the annotations to understand the method functions.As the project iterates,the code is often changed,and the comments of the source code will be inconsistent.In the subsequent development tasks,developers will be misled and introduce new bugs.Based on the above problems,this paper proposes an annotation positioning technology for natural language processing and program analysis,and locates the annotations of the method-level description method implementation details in its specific implementation code.This method first classifies according to the semantics expressed by the annotation text,and extracts How-type annotations.Program analysis techniques are then used to extract code fragments from the source code that may be related to How type comments.Finally,the code fragments and comments are embedded into a high-dimensional vector space through a neural network model,and then the similarity between the code vectors and the annotation vectors is calculated to construct the mapping relationship between the annotation code fragments.Finally,this article implements the annotation positioning tool PCom,and experiments on four Java projects,as well as user research on 10 developers.The experimental results show that PCom locates 2457 annotations,and the accuracy of positioning reaches 88%.Using the positioning of comments,46 comments that were inconsistent with the source code were checked from the project.Our user research results show that annotation positioning information is generated after annotation positioning,which can effectively help developers understand the code function.
Keywords/Search Tags:program analysis, annotation classification, annotation positioning, natural language processing
PDF Full Text Request
Related items