Font Size: a A A

Research And Implementation Of Code Quality Analysis Method Based On Source Code And User Comments

Posted on:2022-09-05Degree:MasterType:Thesis
Country:ChinaCandidate:H Y XuFull Text:PDF
GTID:2518306524952369Subject:Computer technology
Abstract/Summary:PDF Full Text Request
At present,the research on code quality is very important.Source-code-based code quality analysis technology is usually measured by means of static analysis or dynamic testing,which has the advantages of simplicity and easy implementation,and is helpful for code quality analysis.As the developer community and the code-hosting platform become the primary means for programmers to access code,the number of user's comments on code increases dramatically.The comments given by users after using the code contain a variety of code quality information.The code quality analysis based on use's comments can be carried out from the perspective of users,thus helps the developer to know the user's code use situation and the code quality which the user pays attention to after pertinently promotes the code quality.However,in the current related research on code quality,researchers either take source code as the data source of code quality analysis,or take non-source code information closely related to source code as the research object,only one or a few aspects of the code quality analysis,and for multiple aspects of the code quality analysis and comprehensive consideration of source code and user's comments of the code quality research is less.In addition,the user's comments on the code are mostly complex sentences,and the complex sentences contain many kinds of logical relations,which make it difficult to judge the quality information of the code in the user's comments.Therefore,how to study the code quality information in source code and user's comments,and analyze the code quality from many aspects is the focus of this paper.This paper studies the code quality analysis based on the source code and user's comments.The main work of this paper is as follows:(1)A code quality model based on source code and user's comments is defined.Combined with software quality model,the hierarchical representation of code quality and the structure of code quality model based on source code and user's comments are given.In addition,11 code quality attributes and sub-attributes are divided for code quality,and corresponding code quality attribute feature lexicon is constructed for 11 code quality attributes.(2)Aiming at the information of code quality in source code,a method of code quality analysis based on source code is proposed.The method includes analyzing code quality information in source code and obtaining code quality in source code with code quality model structure based on source code and user's comments.(3)Aiming at the code quality information in user's comments of source code,a code quality analysis method based on user's comments is proposed.The method includes analyzing the code quality information in user's comments and obtaining the code quality in user's comments by combining the source code and the structure of the code quality model based on user's comments.In the analysis of the code quality information in user's comments,a method of identifying and analyzing the code quality information suitable for complex user's comments is proposed,this method includes constructing the directed graph of dependency syntactic relations of user's comments,extracting the topics in user's comments based on dependency syntactic relations,identifying the corresponding code quality attributes of the topics,merging the same topics and dealing with different topics based on the topic processing rules.Then,the sentiment tendency of the code quality information is judged,and the code quality in user 's comments is obtained by the structure of the code quality model.(4)Aiming at the code quality information in source code and user's comments,a code quality analysis method based on source code and user's comments is proposed.Combining the source-based code quality digraph and the user's comments-based code quality digraph,the complementary and mutual validation rules are proposed to analyze the code quality in source code and user's comments.(5)According to the proposed code quality analysis method based on source code and user's comments,a system prototype is developed.The validity of this method is proved by the experiment of code quality comprehensive analysis based on source code and user's comments.
Keywords/Search Tags:Code quality, source code, user's comments, code quality model, comprehensive analysis
PDF Full Text Request
Related items