Font Size: a A A

Automatic Code Review Approach Based On Software Design

Posted on:2015-08-11Degree:MasterType:Thesis
Country:ChinaCandidate:J T HeFull Text:PDF
GTID:2308330482979049Subject:Computer technology
Abstract/Summary:PDF Full Text Request
Code review is a very important means to ensure the quality of code in practice. It has been widely used in industry since it was proposed. Nowadays code review is still mainly done by manual work in industry. However, increasing scale of the software challenges manual reviewing. So automating the code review process is highly desired. Software design is the process of abstracting a lot of things and problem with different levels and views. Programmers need to correctly implement code based on design information. To ensure that the code is implemented as expected, this paper proposes an approach to automatically review code in the view of specified design. The main work include the aspects below:(1) Propose a rules construction approach based on design. Define the review rules based on abstract syntax tree and regular expression, and store them in formation with XML document. Analyze the UML behavior models, which descript the software design, and design patterns, which descript deep design information, to extract corresponding information to build review rules.(2) Propose an automatic code review approach based on review rules. Build AST by preprocess the code to be reviewed. And according to the generated review rules, use sub tree matching algorithm to check element in classes, including class name, modifiers and members, use regular expression matching to check the consistency implementation of the methods, and report the inconsistency.(3) A supporting tool was developed, to read in rules to conduct code review automatically, and show the review results, locate the related code line quickly; and two experiments were conducted to demonstrate the applicability of our approach.
Keywords/Search Tags:Code Review, Design pattern, Behavior Model, Abstract Syntax Tree
PDF Full Text Request
Related items