CN115904980B - Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture - Google Patents

Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture Download PDF

Info

Publication number
CN115904980B
CN115904980B CN202211494284.5A CN202211494284A CN115904980B CN 115904980 B CN115904980 B CN 115904980B CN 202211494284 A CN202211494284 A CN 202211494284A CN 115904980 B CN115904980 B CN 115904980B
Authority
CN
China
Prior art keywords
software architecture
corrosion
evolution
points
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211494284.5A
Other languages
Chinese (zh)
Other versions
CN115904980A (en
Inventor
王桐
吴宣够
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui University of Technology AHUT
Original Assignee
Anhui University of Technology AHUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui University of Technology AHUT filed Critical Anhui University of Technology AHUT
Priority to CN202211494284.5A priority Critical patent/CN115904980B/en
Publication of CN115904980A publication Critical patent/CN115904980A/en
Application granted granted Critical
Publication of CN115904980B publication Critical patent/CN115904980B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Testing Resistance To Weather, Investigating Materials By Mechanical Methods (AREA)

Abstract

The application relates to the technical field of software measurement and evaluation, and provides a method, a device, equipment and a storage medium for estimating corrosion repair cost of a software architecture, which comprise the following steps: calculating the corrosion degree of the software architecture based on the quality attribute of the software architecture, and judging the corrosion degree of the software architecture based on the corrosion degree to obtain a judging result; constructing a multi-level software architecture tree before and after the evolution of the software architecture; comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as changing points of the software architecture; locating corrosion points based on quality attributes and change points of the software architecture; calculating the whole slice of the corrosion point; the repair costs for the corrosion sites are calculated based on the full slice of the corrosion sites. According to the method, the repair cost of the corrosion of the software architecture is estimated from the angle of the software architecture, and the technical effect of improving the accuracy of the estimated result is achieved.

Description

Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture
Technical Field
The application relates to the field of software measurement and evaluation technology, in particular to a method, equipment and a storage medium for estimating corrosion repair cost of a software architecture.
Background
The software architecture is an important component of the software, and its quality determines the quality, performance, etc. of the software. However, in the process of software evolution, software architecture is often corroded due to cost pressure, immature technology and the like. In practical development, repairing all corrosion problems is not operable, so that the repair cost of software architecture corrosion is estimated, and repairing more corrosion problems under the condition of certain cost has very important practical significance for improving the quality of the software architecture.
The existing repair cost method for predicting the corrosion of the software architecture has the following defects in the actual application process: (1) There is no repair cost estimation method from the viewpoint of software architecture. The corrosion of the software architecture and the source code belong to different abstraction levels, so that the corrosion is greatly different from the source code in the aspects of quality measurement, corrosion analysis, cost estimation and the like, and the repair cost estimation is needed based on the characteristics of the software architecture; (2) There is a lack of a method for locating the cause of software architecture corrosion at the source code level, starting from the software architecture. The software architecture is a high-level abstraction of the software source code, so that the root cause of the software architecture corrosion is due to unreasonable modification of the source code, and a method for positioning sentences causing the architecture corrosion in the source code is lacking; (3) lack of a method for accurately predicting repair costs. The root cause of software architecture corrosion is that statements are unreasonably altered, and when the statement is modified, the statements associated with the statement may all need to be adjusted accordingly, but a method for how to acquire all the associated statement sets and calculate repair costs based on the statement sets is lacking.
Disclosure of Invention
The application aims to provide a method, a device, equipment and a storage medium for estimating the corrosion repair cost of a software architecture, which are used for estimating the corrosion repair cost of the software architecture from the angle of the software architecture and solving the technical problem that the estimated result of the corrosion repair cost of the software architecture is inaccurate in the prior art, so as to achieve the technical effect of improving the accuracy of the estimated result of the corrosion repair cost of the software architecture.
In order to achieve the above object, the present application provides the following solutions:
in a first aspect, the present application provides a method for estimating corrosion repair cost of a software architecture, including the following steps:
calculating the corrosion degree of the software architecture based on the quality attribute of the software architecture, and judging the corrosion degree of the software architecture based on the corrosion degree to obtain a judging result;
constructing a multi-level software architecture tree before and after the evolution of the software architecture based on the judging result;
comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as changing points of the software architecture;
locating an erosion point based on the quality attribute and a change point of the software architecture;
calculating a full slice of the corrosion points;
and calculating the repair cost of the corrosion point based on the full slice of the corrosion point.
Further, the calculating the corrosion degree of the software architecture based on the quality attribute of the software architecture, and judging the corrosion degree of the software architecture based on the corrosion degree to obtain a judging result includes:
calculating a corrosion ED (a, b) of the software architecture based on the quality attributes;
wherein a represents a software architecture before evolution, b represents a software architecture after evolution, ED (a, b) represents an average value of differences from each quality attribute, N is a set of quality attributes of the software architecture, N is the number of elements contained in N, N i_a Is the metric value of the ith quality attribute of a, N i_b Is the metric value of the ith quality attribute of b.
Further, constructing the multi-level software architecture tree before and after the evolution of the software architecture, including:
respectively constructing multi-level software architecture trees for the software architecture before evolution and after evolution, wherein:
the root node of the tree represents the whole software architecture, and the root node is provided with a plurality of layers of child nodes;
the first layer of sub-nodes are component nodes, each component node represents a component, and the association relation between the root node and the first layer of sub-nodes represents a component contained in the software architecture;
the second-layer sub-nodes are file nodes, each file node represents a file, and the association relation between the first-layer sub-nodes and the second-layer sub-nodes represents the file corresponding to the second-layer sub-nodes contained in the component corresponding to the first-layer sub-nodes;
the third layer of child nodes to the last layer of child nodes are statement nodes, each statement node represents a statement of source codes, and the association relation between the second layer of child nodes and the third layer of child nodes to the last layer of child nodes represents the statement of the third layer of child nodes to the last layer of child nodes contained in the file corresponding to the second layer of child nodes.
Further, the comparing the multi-level software architecture tree before evolution and after evolution includes: and detecting the difference point between the software architecture before evolution and the software architecture after evolution according to the content contained by the child nodes in the multi-level software architecture tree.
Further, the locating the corrosion point based on the quality attribute of the software architecture and the change point includes:
analyzing the multi-level software architecture tree based on the measurement formula of the quality attribute of the software architecture, marking change points which cause the software architecture to corrode in the multi-level software architecture tree, and marking the change points which cause the software architecture to corrode as corrosion points.
Further, calculating a full slice of the corrosion site, comprising:
calculating a forward slice f (p) of the corrosion point p by taking the corrosion point p as a slice criterion;
calculating a backward slice b (p) of the corrosion point p by taking the corrosion point p as a slice criterion;
calculating a full slice S of the corrosion site p based on the forward slice f (p) and the backward slice b (p) of the corrosion site p p =f(p)∪b(p)。
Further, the calculating the repair cost of the corrosion point based on the full slice of the corrosion point includes:
full slice S based on the corrosion point p p Calculating repair cost m of the corrosion point p p
Wherein S is p Is a full slice with p as a slice criterion, F p Is the statement set of the file where p is located, |F p I is F p The number of elements contained in (C) p Is the statement set of the component where p is located, |C p I is C p The number of the elements A p Is the statement set of the program where p is located, |A p I is A p The number of elements contained in the composition, |F p ∩S p I is F p And S is equal to p The number of elements contained in the union, |C p ∩S p I is C p And S is equal to p The number of elements contained in the union, |A p ∩S p I is A p And S is equal to p The number of elements contained in the union of the files, alpha is the coefficient of difficulty in repairing the files, beta is the coefficient of difficulty in repairing the files, and gamma is the coefficient of difficulty in repairing the files in the whole.
In a second aspect, the present application provides a device for estimating corrosion repair cost of a software architecture, including:
the first calculation module is used for calculating the corrosion degree of the software architecture based on the quality attribute of the software architecture, judging the corrosion degree of the software architecture based on the corrosion degree, and obtaining a judgment result;
the construction module is used for constructing a multi-level software architecture tree before and after the evolution of the software architecture based on the judging result;
the comparison marking module is used for comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees and marking the different points as changing points of the software architecture;
an analysis module for locating corrosion points based on the quality attributes and the change points of the software architecture;
a second calculation module for calculating a full slice of the corrosion points;
and a third calculation module for calculating repair costs of the corrosion points based on the full slice of the corrosion points.
In a third aspect, the present application also provides an electronic device, including:
at least one processor;
a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.
In a fourth aspect, the application also provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method as described above.
The beneficial effects are that:
1. according to the technical scheme, the method, the device, the equipment and the storage medium for estimating the corrosion repair cost of the software architecture are provided, and the method, the device and the storage medium for estimating the corrosion repair cost of the software architecture are used for estimating the corrosion repair cost of the software architecture from the perspective of the software architecture, so that the estimated result has higher pertinence.
2. The application uses the change detection technology of the software architecture to correlate the software architecture with the source code with the high level of abstraction with the low level of abstraction, and repairs the software architecture corrosion on specific code sentences, thereby ensuring that the software architecture repair has stronger operability.
3. According to the method, all sentences influencing corrosion points are calculated based on a slicing technology, and the repair cost is calculated by combining the characteristics of a software architecture consisting of components, files and sentences, so that the estimated result has higher accuracy.
It should be understood that all combinations of the foregoing concepts, as well as additional concepts described in more detail below, may be considered a part of the inventive subject matter of the present disclosure as long as such concepts are not mutually inconsistent.
The foregoing and other aspects, embodiments, and features of the present teachings will be more fully understood from the following description, taken together with the accompanying drawings. Other additional aspects of the application, such as features and/or advantages of the exemplary embodiments, will be apparent from the description which follows, or may be learned by practice of the embodiments according to the teachings of the application.
Drawings
The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component that is illustrated in various figures may be represented by a like numeral. For purposes of clarity, not every component may be labeled in every drawing. Embodiments of various aspects of the application will now be described, by way of example, with reference to the accompanying drawings, in which:
FIG. 1 is a schematic flow chart of a method in an embodiment of the application;
FIG. 2 is a schematic diagram of source code before and after software evolution in an embodiment of the application;
fig. 3 is a schematic diagram of a software architecture multi-level analysis tree before and after software evolution in the embodiment of the present application.
Detailed Description
In order to make the purpose and technical solution of the embodiments of the present application more clear, the technical solution of the present application will be clearly and completely described below in connection with the embodiments of the present application. It will be apparent that the described embodiments are some, but not all, embodiments of the application. All other embodiments, which can be made by a person skilled in the art without creative efforts, based on the described embodiments of the present application fall within the protection scope of the present application.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
According to the method, from the aspect of the software architecture, the repair cost of the software architecture corrosion is estimated, the slicing technology is utilized, so that the estimated result of the software architecture corrosion repair cost has higher pertinence and accuracy, and the software architecture modification detection technology is utilized, so that the software architecture repair has stronger operability.
The application provides a method, equipment and a storage medium for estimating corrosion repair cost of a software architecture, which are respectively described below.
For convenience of description, as shown in fig. 2, the present embodiment uses a set of source codes before and after the evolution of the software to illustrate, wherein the version before and after the evolution of the software source code are respectively denoted as v1.0 and v2.0.
As shown in FIG. 1, a method for estimating corrosion cost of a software architecture includes the following steps:
step S101, calculating the corrosion degree of a software architecture based on the quality attribute of the software architecture, and judging the corrosion degree of the software architecture based on the corrosion degree to obtain a judging result;
step S102, constructing a multi-level software architecture tree before and after the evolution of the software architecture;
step S103, comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as changing points of the software architecture;
step S104, positioning corrosion points based on the quality attributes and the change points of the software architecture;
step S105, calculating the full slice of the corrosion point;
and step S106, calculating the repair cost of the corrosion point based on the full slice of the corrosion point.
In the steps, the method and the device position the reason of the corrosion of the software architecture in the source code hierarchy from the aspect of the software architecture, aim at the root cause of the corrosion of the software architecture, namely the unreasonable change of the source code, calculate the sentences in the sentence set based on the slicing technology by acquiring all the related sentence sets, and combine the characteristics of the software architecture consisting of components, files and sentences at the same time, and finally, compared with the conventional method for estimating the corrosion repair cost of the software architecture in the prior art, the method and the device can obtain the estimated result of the repair cost with higher accuracy.
As shown in fig. 1, the specific flow of the software architecture corrosion repair cost estimation method in this embodiment is as follows:
step S101, calculating the corrosion degree of the software architecture based on the quality attribute of the software architecture, and judging the corrosion degree of the software architecture based on the corrosion degree to obtain a judging result, wherein the specific process is as follows:
the corrosiveness ED (a, b) of the software architecture is calculated using the following formula:
wherein a represents a pre-evolution software architecture, b represents a post-evolution software architecture, ED (a, b) represents an average value of differences of respective quality attributes of a and b, N is a set of quality attributes of the software architecture, N is the number of elements contained in N, N i_a Is the metric value of the ith quality attribute of a, N i_b Is the metric value of the ith quality attribute of b;
according to the formula, the corrosion ED (a, b) of the software architecture is calculated, and when the corrosion is more than or equal to 0, the software architecture does not generate corrosion phenomenon, and repair cost estimation and repair are not needed; when the corrosion is less than 0, the software architecture is corroded, and the subsequent steps are performed, wherein the lower the corrosion is, the more serious the corrosion is.
In the specific implementation, the type and number of quality attributes should be determined according to the specific situation of the software architecture, in this embodiment, taking the software architecture corrosion degree calculation based on the software architecture easy understanding as an example, the software architecture easy understanding is calculated according to the following formula:
in the formula, unrerstandsidedness is the understandability of a software architecture, N is the number of components, and C i Is the ith component in the software architecture, C j Is the j-th component in the software architecture, f (C i ,C j ) Is C i And C j The association relation between C i Call C j F (C) i ,C j ) The value of (2) is 1, otherwise 0;
the software architecture corrosiveness of v1.0 evolution to v2.0 is calculated based on a corrosiveness calculation formula and an easy understandability measurement formula, and the calculation result is as follows:
the corrosiveness of the software architecture isIs less than 0 due toThe software architecture is eroded, performing subsequent steps.
Step S102, constructing a multi-level software architecture tree before and after the evolution of the software architecture, wherein the specific process is as follows;
for purposes of description, it is assumed in this embodiment that each file constitutes a component, where:
the root node of the tree represents the whole software architecture, and the root node is provided with a plurality of layers of child nodes;
the first layer of sub-nodes are component nodes, each component node represents a component, p1, p2 and p3 are respectively included, and the association relation between the root node and the first layer of sub-nodes represents the component contained in the software architecture;
the second-layer child nodes are file nodes, each file node represents a file, in the v1.0 version of the multi-level software architecture tree, the file nodes are respectively mi nus.java, p l us.java and cal l.java, in the v2.0 version of the multi-level software architecture tree, the file nodes are respectively mi nus.java, p l us.java and pr i nt.java, and the association relation between the first-layer child nodes and the second-layer child nodes represents the files corresponding to the second-layer child nodes contained in the components corresponding to the first-layer child nodes;
the third layer of child nodes to the last layer of child nodes are statement nodes, each statement node represents a statement of a source code, 13 statement nodes are shared in a v1.0 version of multi-level software architecture tree, 15 statement nodes are shared in a v2.0 version of multi-level software architecture tree, and the association relation between the second layer of child nodes and the third layer of child nodes to the last layer of child nodes represents the statement corresponding to the third layer of child nodes to the last layer of child nodes contained in the file corresponding to the second layer of child nodes.
Step S103, comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees, marking the different points as change points, and detecting the different points of the two software architectures according to the content contained in the nodes in the multi-level software architecture tree in the comparison process, wherein the specific process is as follows;
as shown in fig. 3, comparing v1.0 and v2.0, the change points are detected as file nodes pr i nt.java, sentence nodes cl ass ca l, ca l cu l ate (), a=mi nus.fun (2, 1), b= p l us.fun (2, 1), system.out.pr i nt l n (a), system.out.pr i nt l n (b), return (a-b) and return (b-a), and the change points detected in the above are marked.
Step S104, based on the quality attribute of the software architecture and the change point and the positioning corrosion point, the specific process is as follows:
based on the measurement formula of the understandability in the quality attribute selected in the step S101, the reason for the decrease of the understandability of the analysis software architecture is that the dependency relationship between the components increases under the condition that the number of the components is unchanged;
based on the several change points detected and marked in the above step S103, the change of the statement nodes a=mi nus. Fun (2, 1) and b= p l us. Fun (2, 1) results in two newly added dependent edges in the software architecture, and these two change points cause corrosion of the software architecture, and these two change points are recorded as corrosion points.
Step 105, calculating the full slice of the corrosion point, wherein the specific process comprises the following steps of;
calculating a forward slice f (p) of the corrosion point p by taking the corrosion point p as a slice criterion:
the forward slice f (p) of the corrosion point a=mi nus. Fun (2, 1) contains statement nodes
a=mi nus.fun (2, 1), system.out.pr i nt n (a), c i ass mi nus, abs (i nt a, i nt b), if (a > b), return (a-b) and component node p2;
the forward slice f (p) of the corrosion point b= p l us.fun (2, 1) contains the statement node b= p l us.fun (2, 1), system.out.pr i nt i n (b), fun (i nt a, i nt b), c i ass p i us, return (a+b) and component node p3;
and calculating a backward slice b (p) of the corrosion point p by taking the corrosion point p as a slice criterion:
the backward slice b (p) of the corrosion point a=mi nus. Fun (2, 1) contains statement nodes
a=mi nus.fun (2, 1), calcu late (), class cal, and component node p1;
the backward slice b (p) of the corrosion point b=plus.fun (2, 1) contains the statement node b= p l us.fun (2, 1), calcu late (), class cal, and component node p1;
forward slicing and backward slicing based on the corrosion point p, a full slice S of the corrosion point p is calculated using the following formula p
S p =f(p)∪b(p);
Wherein S is p Is a full slice with p, f (p) is a forward slice with p as a slice criterion, and b (p) is a backward slice with p as a slice criterion;
the full slice of the corrosion point a=mi nus. Fun (2, 1) is the statement node a=minus. Fun (2, 1), calcu late (), class cal, system. Out. Pr int l n (a), c class minus, abs (int a, int b), if (a > b), return (a-b) and component nodes p1 and p2;
the full slice of the corrosion point b=plus.fun (2, 1) is the statement node b=plus.fun (2, 1), system.out.pr int l n (b), fun (int a, int b), class p l us, return (a+b), calcu late (), class cal, and component nodes p1 and p3.
Step S106, calculating the repair cost of the corrosion point based on the full slice of the corrosion point, wherein the concrete process comprises the following steps:
full slice S based on the corrosion point p p Calculating repair cost m of corrosion point p p
Wherein S is p Is a full slice with p as a slice criterion, F p Is the statement set of the file where p is located, |F p I is F p The number of elements contained in (C) p Is the statement set of the component where p is located, |C p I is C p The number of the elements A p Is the statement set of the program where p is located, |A p I is A p The number of elements contained in the composition, |F p ∩S p I is F p And S is equal to p The number of elements contained in the union, |C p ∩S p I is C p And S is equal to p The number of elements contained in the union, |A p ∩S p I is A p And S is equal to p The number of elements contained in the union of the files, alpha is the coefficient of difficulty of repair of the same file, beta is the coefficient of difficulty of repair of the same component, and gamma is the coefficient of difficulty of global repair;
by the above formula, the repair cost of each corrosion point can be calculated, and when the repair cost is higher, the cost required for repairing the current corrosion point is higher. When repair costs are lower, the lower the costs required to repair the current corrosion site.
In the application, the coefficient of difficulty in repair of the same file is assumed to be 0.2, the coefficient of difficulty in repair of the same component is assumed to be 0.3, and the coefficient of difficulty in repair of the whole file is assumed to be 0.5.
The repair cost for corrosion site a=mi nus. Fun (2, 1) is calculated as follows:
repair costs for corrosion points b= p l us. Fun (2, 1) were calculated as follows:
as is clear from the repair cost calculation results of the corrosion point a=mi nus.fun (2, 1) and the corrosion point b= p l us.fun (2, 1), the repair cost of the corrosion point b= p l us.fun (2, 1) is lower.
Based on the software architecture corrosion repair cost estimation method, the embodiment of the application also provides a software architecture corrosion repair cost estimation device.
For example, the software architecture corrosion repair cost estimation method may be divided into a plurality of modules, and the plurality of modules are stored in a memory and executed by a processor to complete the present application. The plurality of modules or units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the method for estimating cost of corrosion repair for a software architecture. For example, the software architecture corrosion repair cost estimation device is divided into a first calculation module, a construction module, a comparison marking module, an analysis module, a second calculation module and a third calculation module, and specific functions of the modules are as follows:
the first calculation module is used for calculating the corrosion degree of the software architecture based on the quality attribute of the software architecture, judging the corrosion degree of the software architecture based on the corrosion degree, and obtaining a judgment result;
the construction module is used for constructing a multi-level software architecture tree before and after the evolution of the software architecture;
the comparison marking module is used for comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees and marking the different points as change points;
an analysis module for locating corrosion points based on the quality attributes and the change points of the software architecture;
a second calculation module for calculating a full slice of the corrosion points;
and a third calculation module for calculating repair costs of the corrosion points based on the full slice of the corrosion points.
Correspondingly, the application also provides electronic equipment, which comprises:
at least one processor;
a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the embodiments of the application.
These computer programs may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks and/or block diagram block or blocks, and corresponding steps may be implemented in different modules.
The above-described programs may be run on a processor or may also be stored in memory (or referred to as computer-readable media), including both permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technique. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (trans i tory med i a), such as modulated data signals and carrier waves.
Accordingly, the present application also provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method described in any of the embodiments of the present application.
While the application has been described with reference to preferred embodiments, it is not intended to be limiting. Those skilled in the art will appreciate that various modifications and adaptations can be made without departing from the spirit and scope of the present application. Accordingly, the scope of the application is defined by the appended claims.

Claims (9)

1. The method for estimating the corrosion repair cost of the software architecture is characterized by comprising the following steps:
calculating the corrosiveness of the software architecture based on the quality attribute of the software architecture;
wherein the corrosiveness isWherein a represents a pre-evolution software architecture, b represents a post-evolution software architecture, ED (a, b) represents an average value of differences of respective quality attributes of a and b, N is a set of quality attributes of the software architecture, N is the number of elements contained in N, N i_a Is the metric value of the ith quality attribute of a, N i_b Is the metric value of the ith quality attribute of b;
based on the calculation result, judging whether the corrosion degree ED (a, b) is smaller than 0, if yes, the software architecture is corroded, and the lower the corrosion degree ED (a, b), the more serious the corrosion degree of the software architecture is; otherwise, the software architecture is not corroded;
obtaining a judgment result of the corrosion degree of the software architecture;
constructing a multi-level software architecture tree before and after the evolution of the software architecture based on the judging result of the corroded software architecture;
comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as changing points of the software architecture;
locating an erosion point based on the quality attribute of the software architecture and the change point;
calculating a full slice of the corrosion points;
and calculating the repair cost of the corrosion point based on the full slice of the corrosion point.
2. The method for predicting corrosion repair cost of a software architecture according to claim 1, wherein: constructing the multi-level software architecture tree before and after the evolution of the software architecture, comprising:
respectively constructing multi-level software architecture trees for the software architecture before evolution and after evolution, wherein:
the root node of the tree represents the whole software architecture, and the root node is provided with a plurality of layers of child nodes;
the first layer of sub-nodes are component nodes, each component node represents a component, and the association relation between the root node and the first layer of sub-nodes represents a component contained in the software architecture;
the second-layer child nodes are file nodes, each file node represents a file, and the association relation between the first-layer child nodes and the second-layer child nodes represents the file corresponding to the second-layer child nodes contained in the component corresponding to the first-layer child nodes;
the third layer of child nodes to the last layer of child nodes are statement nodes, each statement node represents a statement of a source code, and the association relation between the second layer of child nodes and the third layer of child nodes to the last layer of child nodes represents the statement corresponding to the third layer of child nodes to the last layer of child nodes contained in the file corresponding to the second layer of child nodes.
3. The method for predicting corrosion repair cost of a software architecture according to claim 2, wherein: the multi-level software architecture tree comparing the pre-evolution and post-evolution comprises: and detecting the difference point between the software architecture before evolution and the software architecture after evolution according to the content contained by the child nodes in the multi-level software architecture tree.
4. The method for predicting corrosion repair cost of a software architecture according to claim 1, wherein: the locating corrosion points based on the quality attributes of the software architecture and the change points includes:
analyzing the multi-level software architecture tree based on a measurement formula of the quality attribute of the software architecture, marking change points which cause the software architecture to corrode in the multi-level software architecture tree, and marking the change points which cause the software architecture to corrode as corrosion points.
5. The method for predicting corrosion repair cost of a software architecture according to claim 1, wherein: the calculating the full slice of the corrosion site includes:
calculating a forward slice f (p) of the corrosion point p by taking the corrosion point p as a slice criterion;
calculating a backward slice b (p) of the corrosion point p by taking the corrosion point p as a slice criterion;
calculating a full slice S of the corrosion site p based on the forward slice f (p) and the backward slice b (p) of the corrosion site p p =f(p)∪b(p)。
6. The method for predicting corrosion repair cost of a software architecture according to claim 5, wherein: the full slice based on corrosion points, calculating repair costs for the corrosion points, comprising:
full slice S based on the corrosion point p p Calculating repair cost m of the corrosion point p p
Wherein S is p Is a full slice with p as a slice criterion, F p Is the statement set of the file where p is located, |F p I is F p The number of elements contained in (C) p Is the statement set of the component where p is located, |C p I is C p The number of the elements A p Is the statement set of the program where p is located, |A p I is A p The number of elements contained in the composition, |F p ∩S p I is F p And S is equal to p The number of elements contained in the union, |C p ∩S p I is C p And S is equal to p The number of elements contained in the union, |A p ∩S p I is A p And S is equal to p The number of elements contained in the union of the files, alpha is the coefficient of difficulty in repairing the files, beta is the coefficient of difficulty in repairing the files, and gamma is the coefficient of difficulty in repairing the files in the whole.
7. A software architecture corrosion repair cost prediction apparatus, comprising:
the first calculation module is configured to calculate, based on the first calculation module,for calculating a corrosiveness of a software architecture based on quality attributes of the software architecture; wherein the corrosiveness isWherein a represents a pre-evolution software architecture, b represents a post-evolution software architecture, ED (a, b) represents an average value of differences of respective quality attributes of a and b, N is a set of quality attributes of the software architecture, N is the number of elements contained in N, N i_a Is the metric value of the ith quality attribute of a, N i_b Is the metric value of the ith quality attribute of b;
the judging module is used for judging whether the corrosion degree ED (a, b) is smaller than 0 or not based on the calculation result, if so, the software architecture is corroded, and the lower the corrosion degree ED (a, b), the more serious the corrosion degree of the software architecture is; otherwise, the software architecture is not corroded;
the result receiving module is used for obtaining a judging result of the corrosion degree of the software architecture;
the construction module is used for constructing a multi-level software architecture tree before and after the evolution of the software architecture;
the comparison marking module is used for comparing the multi-level software architecture tree before evolution and after evolution, marking different points in the two multi-level software architecture trees and marking the different points as changing points of the software architecture;
an analysis module for locating an erosion point based on the quality attributes of the software architecture and the change point;
a second calculation module for calculating a full slice of the corrosion points;
and a third calculation module for calculating repair costs of the corrosion points based on the full slice of the corrosion points.
8. An electronic device, comprising:
at least one processor;
a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.
9. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1 to 6.
CN202211494284.5A 2022-11-25 2022-11-25 Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture Active CN115904980B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211494284.5A CN115904980B (en) 2022-11-25 2022-11-25 Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211494284.5A CN115904980B (en) 2022-11-25 2022-11-25 Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture

Publications (2)

Publication Number Publication Date
CN115904980A CN115904980A (en) 2023-04-04
CN115904980B true CN115904980B (en) 2023-09-22

Family

ID=86474439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211494284.5A Active CN115904980B (en) 2022-11-25 2022-11-25 Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture

Country Status (1)

Country Link
CN (1) CN115904980B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509338A (en) * 2018-03-17 2018-09-07 东南大学 A kind of Software Evolution assessment system and method based on multi-level analysis on altered project
US20190371433A1 (en) * 2018-06-03 2019-12-05 Beijing Curacloud Technology Co., Ltd. Method and system for anatomical tree structure analysis
CN111258556A (en) * 2020-01-16 2020-06-09 焦作大学 Software development management system
CN111538655A (en) * 2020-04-09 2020-08-14 哈尔滨工业大学(威海) Software failure detection method, system, storage medium, computer program, and terminal
CN114528221A (en) * 2022-02-24 2022-05-24 北京航空航天大学 Software defect prediction method based on heterogeneous graph neural network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509338A (en) * 2018-03-17 2018-09-07 东南大学 A kind of Software Evolution assessment system and method based on multi-level analysis on altered project
US20190371433A1 (en) * 2018-06-03 2019-12-05 Beijing Curacloud Technology Co., Ltd. Method and system for anatomical tree structure analysis
CN111258556A (en) * 2020-01-16 2020-06-09 焦作大学 Software development management system
CN111538655A (en) * 2020-04-09 2020-08-14 哈尔滨工业大学(威海) Software failure detection method, system, storage medium, computer program, and terminal
CN114528221A (en) * 2022-02-24 2022-05-24 北京航空航天大学 Software defect prediction method based on heterogeneous graph neural network

Also Published As

Publication number Publication date
CN115904980A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
CN108897724B (en) Function completion progress determining method and device
US20100251220A1 (en) Method and apparatus for dynamically instrumenting a program
CN111401518B (en) Neural network quantization method, device and computer readable storage medium
CN102331921A (en) Be used to detect the unusual method and system of decimal system floating-point amount
CN111400164A (en) Software testing method and device
WO2021169386A1 (en) Graph data processing method, apparatus and device, and medium
CN110647447A (en) Abnormal instance detection method, apparatus, device and medium for distributed system
CN114091281A (en) Product life prediction method and device, electronic equipment and storage medium
CN115904980B (en) Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture
CN114219917A (en) Vulnerability repairing method for laser radar point cloud data
CN112131078B (en) Method and equipment for monitoring disk capacity
CN117217136A (en) FPGA resource consumption estimation method based on RTL design
CN112560267B (en) Method, device, equipment and storage medium for dividing ramp units
CN112561171B (en) Landslide prediction method, device, equipment and storage medium
CN114817209A (en) Monitoring rule processing method and device, processor and electronic equipment
CN114328662A (en) Abnormal data positioning method and device, electronic equipment and storage medium
CN116303026B (en) Evolution history-based software architecture degradation prediction method, device and equipment
CN112765231A (en) Data processing method and device and computer readable storage medium
CN111767937A (en) Target detection model training method and device, electronic equipment and storage medium
CN115470922B (en) Quantum bit calibration method and device, quantum control system and quantum computer
CN113282299B (en) Information processing method, device, equipment and storage medium
CN116303731B (en) Code matching method and device for hospital standard main data and electronic equipment
CN111913805B (en) CPU utilization rate calculation method and device
CN111639342B (en) Map tile data blank vulnerability rapid detection and repair method
CN112836745B (en) Target detection method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant