Software code complexity detection method and device and electronic equipment

A software code and detection method technology, applied in the computer field, can solve the problem of not forming a perfect overall software detection and evaluation mechanism, etc.

Inactive Publication Date: 2019-12-17
ZHEJIANG UNIV
View PDF5 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

For the detection and evaluation of code complexity, at the current stage, only some complexity indicators for specific code fragmen

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Software code complexity detection method and device and electronic equipment
  • Software code complexity detection method and device and electronic equipment
  • Software code complexity detection method and device and electronic equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0050] Based on the above-mentioned software code complexity detection scheme idea, such as figure 2 As shown, it is a schematic flow chart of a method for detecting software code complexity in Embodiment 1 of the present invention. The execution subject of the method is a detection device for software code complexity. The method includes:

[0051] S210. Acquire code complexity indicators of multiple code fragments of the software to be evaluated.

[0052] Wherein, as explained above, the code complexity index can be obtained by collecting the original measurement data of the code fragment and mapping the original measurement data according to the preset threshold interval.

[0053] In practical application scenarios, the original measurement data of code complexity indicators in multiple dimensions can be collected by calling the indicator calculator, and different threshold intervals can be preset for different types of code complexity indicators{t 1 ,t 2 ...t n}, accord...

Embodiment 2

[0060] Based on the method for detecting software code complexity described in the previous embodiment, this embodiment will further refine the method. image 3 It is a schematic flow diagram of the detection method of the software code complexity in the second embodiment of the present invention, as image 3 As shown, the method includes:

[0061] S310. Obtain code complexity indicators of multiple code fragments of the software to be evaluated. The content of this step S310 is the same as that of the above-mentioned step S210.

[0062] S320, longitudinally aggregate the code complexity indicators of the multiple code fragments according to the hierarchical order of any multiple layers in the class layer, file layer, module layer, and project layer, to obtain a first aggregation score.

[0063] Further, the step-by-step vertical aggregation of the code complexity indicators of multiple code fragments includes: using the weak term intensive aggregation function to perform le...

Embodiment 3

[0079] Figure 4 It is a schematic structural diagram of a software code complexity detection device according to an embodiment of the present invention, and the device is mainly used to execute figure 2 The method steps shown, as Figure 4 As shown, the device includes:

[0080] A code complexity index acquisition module 410, configured to acquire a code complexity index of a code segment of the software to be evaluated;

[0081] A vertical aggregation module 420, configured to vertically aggregate code complexity indicators of multiple code fragments step by step to obtain a first aggregation score;

[0082] The horizontal aggregation module 430 is configured to horizontally aggregate the first aggregation score to obtain a second aggregation score, and output the second aggregation score as code complexity.

[0083] Further, the above code complexity indicators include:

[0084] Method type indicators of multiple dimensions and / or type type indicators of multiple dimen...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention provides a software code complexity detection method and device and electronic equipment, and the method comprises the steps: obtaining code complexity indexes of a plurality of code segments of to-be-evaluated software; performing step-by-step longitudinal aggregation on the code complexity indexes of the plurality of code snippets to obtain a first aggregation score; and transversely aggregating the first aggregation score to obtain a second aggregation score, and outputting the second aggregation score as the code complexity. According to the embodiment of the invention, the code complexity of the to-be-evaluated software is detected and evaluated in a step-by-step longitudinal aggregation manner; a comprehensive and deep complexity detection result can be formed, and in addition, a developer can conveniently locate code fragments with problems in the aspect of code complexity through backtracking the complexity detection process of step-by-step aggregation.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a detection method, device and electronic equipment for the complexity of software codes. Background technique [0002] With the development of computer science and technology, the scope and scale of software applications are also expanding. At present, in the context of broader software application scenarios, software quality has become a more concerned issue for professional technicians. In software quality assessment, code quality is an important part of software quality, which largely determines software quality. Traditional software metrics are mainly software metrics based on structured and modular programming ideas, and the main analysis objects include code size, program control flow, and implementation complexity. The complexity of the code is one of the important factors affecting the code failure rate and maintainability, especially in large-scale codes, ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F11/36G06F8/41
CPCG06F8/441G06F11/362
Inventor 邓水光傅珉智晨陈曦尹建伟李元平朱海
Owner ZHEJIANG UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products