Software evolution evaluation method based on code loop complexity measurement

A technology of software evolution and complexity, which is applied in software testing/debugging, instrumentation, electrical digital data processing, etc., and can solve the problems that the complexity cannot be effectively controlled

CN107239396AInactive Publication Date: 2017-10-10SOUTHEAST UNIV
2 Cites 18 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2017-10-10
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a software evolution evaluation method based on code loop complexity measurement. The method includes the steps of firstly, conducting code parse on a to-be-evaluated software source code to generate an abstract syntax tree; secondly, by calculating the number of determination nodes in the abstract syntax tree, conducting the code loop complexity measurement by the three levels of a method level, a class level and a system level; finally, conducting threshold comparison assessment on the metric of the method level and the class level. According to the method, after acquiring the code loop complexity metric of each software version, the loop complexity before and after software evolution is compared and analyzed to locate the change position of complexity and analyze the reason of complexity changes through code change detection. The evaluation method can not only automatically parse the source code to evaluate the loop complexity of the code by various aspects of software and make an early warning for modules and methods with excessive complexity, but also locate the position which causes the complexity changes in evolution, and analyze the causes of the changes to provide reference bases for software evolution evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to a software evolution evaluation method based on code cyclomatic complexity measurement, which belongs to the field of software evolution and maintenance. Background technique

[0002] Code complexity is a measure of the complexity of the code and an indication of the effort required to understand and maintain the code. Code complexity directly affects software quality attributes such as readability, maintainability, and understandability. By evaluating the code complexity, it can help developers understand, control and adjust the complexity of the code in a timely manner.

[0003] Cyclomatic complexity is a kind of code complexity, and it is a quality indicator used to measure the complexity of the judgment structure in the program. Usually, people use the measurement and evaluation of cyclomatic complexity to measure the complexity of software module judgment structure, understand the minimum number of paths to be tested to ...

Examples

Embodiment Construction

[0061] The present invention will be further described below in conjunction with embodiment and accompanying drawing. figure 1 The process of software evolution evaluation method based on code cyclomatic complexity measurement is given. The project used in the embodiment is the Java open source software project JEditor.

[0062] JEditor is a Java-based open source text editor. So far, 7 versions have been released. The number of code lines is between 13098-13635. The download address is http: / / sourceforge.net / projects / jeditor / files / .

[0063] The embodiment of cyclomatic complexity measurement evaluation is JEditor0.2 version; on the basis of measuring each version of JEditor separately, we selected JEditor0.4 and JEditor0.4.1 with the largest complexity change for cyclomatic complexity evolution reason Examples of analysis. The specific implementation method is:

[0064] Step 1) Use JDT to analyze the program source code of Jeditor 0.2 to generate an abstract syntax tree. ...