CN115904980A - Software architecture corrosion repair cost estimation method, device, equipment and storage medium - Google Patents

Software architecture corrosion repair cost estimation method, device, equipment and storage medium Download PDF

Info

Publication number
CN115904980A
CN115904980A CN202211494284.5A CN202211494284A CN115904980A CN 115904980 A CN115904980 A CN 115904980A CN 202211494284 A CN202211494284 A CN 202211494284A CN 115904980 A CN115904980 A CN 115904980A
Authority
CN
China
Prior art keywords
software architecture
corrosion
calculating
evolution
child nodes
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.)
Granted
Application number
CN202211494284.5A
Other languages
Chinese (zh)
Other versions
CN115904980B (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

Images

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 invention relates to the technical field of software measurement and evaluation, and provides a software architecture corrosion repair cost estimation method, a device, equipment and a storage medium, which comprises 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 judgment result; constructing multi-level software architecture trees of a software architecture before and after evolution; comparing the multi-level software architecture trees before evolution and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as change points of a software architecture; locating corrosion points based on quality attributes and change points of the software architecture; calculating a full section of the corrosion point; and calculating the repair cost of the corrosion point based on the full section of the corrosion point. The method and the device estimate the repair cost of the corrosion of the software architecture from the perspective of the software architecture, and achieve the technical effect of improving the accuracy of the estimated result.

Description

Software architecture corrosion repair cost estimation method, device, equipment and storage medium
Technical Field
The invention relates to the field of software measurement and evaluation technology, in particular to a software architecture corrosion repair cost estimation method, equipment and a storage medium.
Background
The software architecture is an important component of software, and the quality of the software architecture determines the quality, performance and the like of the software. However, in the software evolution process, the software architecture is often corroded due to cost pressure, immature technology and the like. In actual development, it is not practical to repair all corrosion problems, so that the repair cost of the corrosion of the software architecture is estimated, and repairing more corrosion problems at a certain cost has very important practical significance for improving the quality of the software architecture.
The existing repair cost method for estimating the corrosion of the software architecture has the defects in the practical application process that: (1) A repair cost estimation method from the software architecture point of view is lacking. The corrosion of the software architecture and the source code belong to different abstraction levels, so that the corrosion of the software architecture and the source code are greatly different from the source code of the software in the aspects of quality measurement, corrosion analysis, cost estimation and the like, and the repair cost is estimated based on the characteristics of the software architecture; (2) There is no method for locating the cause of corrosion of the software architecture at the source code level from the software architecture. The software architecture is a high-level abstraction of the software source code, so the root cause of the software architecture corrosion is unreasonable change of the source code, and a method for positioning the statement causing the architecture corrosion in the source code is lacked; (3) there is a lack of a method to accurately estimate the cost of repair. The root cause of the corrosion of the software architecture is that the statements are not changed reasonably, and when the statements are modified, the statements associated with the statements may need to be adjusted correspondingly, but a method for acquiring all the associated statement sets and calculating the repair cost based on the statement sets is lacked.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a storage medium for estimating the corrosion repair cost of a software architecture, which can estimate the repair cost of the corrosion of the software architecture from the perspective of the software architecture, so as to solve the technical problem that the estimation result of the corrosion repair cost of the software architecture in the prior art is inaccurate, and achieve the technical effect of improving the accuracy of the estimation result of the corrosion repair cost of the software architecture.
In order to achieve the above purpose, the invention provides the following scheme:
in a first aspect, the invention provides a software architecture corrosion repair cost estimation method, which includes 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 judgment result;
constructing multi-level software architecture trees of the software architecture before and after evolution based on the judgment result;
comparing the multi-level software architecture trees before and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as the change points of the software architecture;
locating corrosion points based on the quality attributes and change points of the software architecture;
calculating a full slice of the corrosion site;
calculating a repair cost for the corrosion site based on the full section of the corrosion site.
Further, the calculating the corrosion degree of the software architecture based on the quality attribute of the software architecture, and determining the corrosion degree of the software architecture based on the corrosion degree to obtain a determination result includes:
calculating a degree of corrosion ED (a, b) of the software architecture based on a quality attribute;
Figure SMS_1
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 respective quality attributes, N is a set of quality attributes of the software architecture, | N | is the number of elements included in N, N i_a Is a metric value of the ith quality attribute of a, N i_b Is a metric value for the ith quality attribute of b.
Further, constructing a multi-level software architecture tree before and after the software architecture evolution comprises:
respectively constructing a multi-level software architecture tree for a software architecture before evolution and a software architecture 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 sub-nodes;
the first-layer child nodes are component nodes, each component node represents a component, and the association relationship between the root node and the first-layer child nodes represents the components contained in the software architecture;
the second layer of child nodes are file nodes, each file node represents a file, and the incidence relation between the first layer of child nodes and the second layer of child nodes represents the files corresponding to the second layer of child nodes contained in the component corresponding to the first layer of child nodes;
the third-layer child nodes to the last-layer child nodes are statement nodes, each statement node represents a statement of a source code, and the association relationship between the second-layer child nodes and the third-layer child nodes represents the statements from the third-layer child nodes to the last-layer child nodes contained in the file corresponding to the second-layer child nodes.
Further, the comparing the multi-level software architecture tree before and after evolution includes: and detecting different points between the pre-evolution software architecture and the post-evolution software architecture according to the content contained in the child nodes in the multi-level software architecture tree.
Further, the locating the erosion point based on the quality attribute of the software architecture and the change point comprises:
analyzing the multi-level software architecture tree based on a measurement formula of the quality attribute of the software architecture, marking change points causing the software architecture corrosion in the multi-level software architecture tree, and marking the change points causing the software architecture corrosion as corrosion points.
Further, calculating a full slice of the corrosion site, comprising:
calculating a forward section f (p) of the corrosion point p by taking the corrosion point p as a section criterion;
calculating a backward section b (p) of the corrosion point p by taking the corrosion point p as a section criterion;
calculating a full slice S of the etch spot p based on the forward slice f (p) and the backward slice b (p) of the etch spot p p =f(p)∪b(p)。
Further, the calculating the repair cost of the corrosion site based on the full section of the corrosion site comprises:
full section S based on said corrosion site p p Calculating the repair cost m of said corrosion site p p
Figure SMS_2
Wherein S is p Full slices using p as slicing criterion, F p Is the statement set of the file in which p is located, | F p Is F | p Number of elements contained in, C p Is the statement set of the component in which p is located, | C p Is | C p Number of elements contained in (A) p Is the set of statements of the program in which p is located, | A p Is A p The number of elements, | F p ∩S p Is F p And S p The number of elements, | C, contained in the union p ∩S p Is | C p And S p The number of elements, | A, contained in the union of (1) p ∩S p Is A p And S p The number of elements contained in the union of (1) is the same file repair difficulty coefficient, beta is the same component repair difficulty coefficient, and gamma is the global repair difficulty coefficient.
In a second aspect, the present invention provides a software architecture corrosion repair cost estimation apparatus, 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, and judging the corrosion degree of the software architecture based on the corrosion degree to obtain a judgment result;
the construction module is used for constructing multi-level software architecture trees before and after the software architecture evolves based on the judgment result;
the comparison marking module is used for comparing the multi-level software architecture trees before evolution and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as change points of the software architecture;
an analysis module to locate corrosion sites 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 site;
a third calculation module for calculating a repair cost for the corrosion site based on the full slice of the corrosion site.
In a third aspect, the present invention further 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 invention also provides a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method as described above.
Has the advantages 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.
2. The method uses the change detection technology of the software architecture to associate the software architecture of a high-level abstraction level with the source code of a low-level abstraction level, and repairs the corrosion of the software architecture on a concrete code statement, so that the software architecture repair has stronger operability.
3. The method calculates all statements influencing corrosion points based on the slicing technology, and calculates the repair cost by combining the characteristics of a software architecture consisting of components, files and statements, so that the estimated result has higher accuracy.
It should be understood that all combinations of the foregoing concepts and additional concepts described in greater detail below can be considered as part of the inventive subject matter of this disclosure unless such concepts are mutually inconsistent.
The foregoing and other aspects, embodiments and features of the present teachings will be more fully understood from the following description taken in conjunction with the accompanying drawings. Additional aspects of the present invention, such as features and/or advantages of exemplary embodiments, will be apparent from the description which follows, or may be learned by practice of specific embodiments in accordance with the teachings of the present invention.
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 present invention 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 present application;
FIG. 2 is a schematic diagram of source codes before and after software evolution in an embodiment of the present application;
FIG. 3 is a diagram illustrating a multi-level tree analysis of a software architecture before and after software evolution in an embodiment of the present application.
Detailed Description
In order to make the purpose and technical solution of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention without any inventive step, are within the scope of protection of the invention.
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 invention 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.
The method estimates the repair cost of the corrosion of the software architecture from the perspective of the software architecture, utilizes the slicing technology to enable the estimation result of the repair cost of the corrosion of the software architecture to have higher aim and accuracy, and utilizes the change detection technology of the software architecture to enable the repair of the software architecture to have stronger operability.
The invention provides a method, equipment and a storage medium for estimating the corrosion repair cost of a software architecture, which are respectively explained below.
For convenience of description, as shown in fig. 2, this embodiment uses a set of source codes before and after software evolution to perform an example description, where an pre-evolution version and a post-evolution version 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 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 judgment result;
s102, constructing multi-level software architecture trees before and after the software architecture evolves;
step S103, comparing the multi-level software architecture trees before evolution and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as change points of a software architecture;
step S104, positioning corrosion points based on the quality attributes and the change points of the software architecture;
step S105, calculating a full section of the corrosion point;
and step S106, calculating the repair cost of the corrosion point based on the full section of the corrosion point.
In the steps, from the perspective of a software architecture, the method positions the corrosion reason of the software architecture at the source code level, and aims at the root cause of the corrosion of the software architecture, namely the unreasonable change of the source code, by acquiring all the associated statement sets, calculating the statements in the statement sets based on the slicing technology, and combining the characteristics of the software architecture comprising components, files and statements, compared with the conventional software architecture corrosion repair cost estimation method in the prior art, the method can obtain the repair cost estimation result with higher accuracy.
As shown in fig. 1, the specific process of the method for estimating the corrosion repair cost of the software architecture in the embodiment is as follows:
step S101, 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, wherein the specific process comprises the following steps:
calculating the corrosion degree ED (a, b) of the software architecture by using the following formula:
Figure SMS_3
wherein a represents a software architecture before evolution, b represents a software architecture after evolution, 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, and N is a value of a difference between the quality attributes of a and b i_a Is a measure of the ith quality attribute of a, N i_b Is a measure of the ith quality attribute of b;
calculating the corrosion degree ED (a, b) of the software architecture by the formula, wherein when the corrosion degree is more than or equal to 0, the software architecture is not corroded, and repair cost prediction and repair are not needed; when the corrosion degree is less than 0, the software architecture is corroded, and the subsequent steps are executed, wherein the lower the corrosion degree is, the more serious the corrosion degree is.
In specific implementation, the type and number of the quality attributes are determined according to specific conditions of the software architecture, and in this embodiment, taking calculation of the corrosion degree of the software architecture based on the intelligibility of the software architecture as an example, the intelligibility of the software architecture is calculated according to the following formula:
Figure SMS_4
where understandability is the intelligibility of the software architecture and N is the componentNumber, C i Is the ith component in the software architecture, C j Is the jth component in the software architecture, f (C) i ,C j ) Is C i And C j The association relationship between them, when C i Call out C j Then f (C) i ,C j ) Is 1, otherwise is 0;
calculating the corrosion degree of the software architecture from v1.0 to v2.0 based on a corrosion degree calculation formula and a comprehensibility measurement formula, wherein the calculation result is as follows:
Figure SMS_5
the degree of corrosion of the software architecture is
Figure SMS_6
Less than 0, so the software architecture is corroded and the subsequent steps are performed.
Step S102, constructing multi-level software architecture trees before and after the software architecture evolution, and the specific process is as follows;
for the source code of v1.0 and v2.0 in fig. 2, a multi-level software architecture tree is constructed respectively, and for the convenience of description, in the present embodiment, it is assumed that each file constitutes a component, where:
a root node of the tree represents the whole software architecture, and the root node is provided with a plurality of layers of sub nodes;
the first-layer child nodes are component nodes, each component node represents a component and is p1, p2 and p3, and the incidence relation between the root node and the first-layer child nodes represents the components contained in the software architecture;
the second layer of child nodes are file nodes, each file node represents a file, in the multi-level software architecture tree of the v1.0 version, the file nodes are mi nus.java, p l us.java and ca l.java respectively, in the multi-level software architecture tree of the v2.0 version, the file nodes are mi nus.java, p l us.java and pr i nt.java respectively, and the association relationship between the first layer of child nodes and the second layer of child nodes represents the files corresponding to the second layer of child nodes contained in the component corresponding to the first layer of child nodes;
and the third-layer child nodes to the last-layer child nodes are statement nodes, each statement node represents a statement of a source code, 13 statement nodes are shared in the multi-layer software architecture tree of the v1.0 version, 15 statement nodes are shared in the multi-layer software architecture tree of the v2.0 version, and the incidence relation between the second-layer child nodes and the third-layer child nodes to the last-layer child nodes represents statements corresponding to the third-layer child nodes to the last-layer child nodes contained in the file corresponding to the second-layer child nodes.
Step S103, comparing the multi-level software architecture trees before 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 trees in the comparison process, wherein the specific process is as follows;
as shown in fig. 3, comparing the multi-level software architecture tree of v1.0 and v2.0, the detected change points are file node pr i nt. Java, statement node c l ass ca l, ca l cu 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 mark the detected change points.
Step S104, based on the quality attribute of the software architecture and the change point and the location corrosion point, the specific process is as follows:
based on the measurement formula of intelligibility in the quality attributes selected in the step S101, the reason for the degradation of the intelligibility of the analysis software architecture is that the dependency relationship between the components increases when the number of the components is unchanged;
based on the change points detected and marked in step S103, the changes of the statement nodes a = mi nus.fun (2, 1) and b = p l us.fun (2, 1) result in two new dependent edges being added to the software architecture, and these two change points cause the software architecture to be corroded, and these two change points are marked as corrosion points.
Step S105, calculating a full section of the corrosion point, wherein the specific process comprises the following steps;
calculating a forward section f (p) of the corrosion point p by taking the corrosion point p as a section criterion:
the forward slice f (p) of the erosion point a = mi nus.fun (2, 1) contains statement nodes
Fu (2, 1), system.out.pr i nt n (a), c l ass mi nus, abs (i nt a, i nt b), if (a > b), return (a-b) and component node p2;
forward slice f (p) of erosion point b = p l us. Fun (2, 1) contains statement node b = p l us. Fun (2, 1), system.out. Pr i nt l n (b), fun (i nt a, i nt b), c l ass p l us, return (a + b), and component node p3;
and calculating a backward section b (p) of the corrosion point p by taking the corrosion point p as a section criterion:
fu (2, 1) backward slice b (p) containing statement node with corrosion point a = mi nus
Fun (2,1), calcu late (), class cal l and component node p1;
backward slice b (p) of etch point b = p us. Fun (2,1) contains statement node b = p l us. Fun (2,1), calcu late (), class cal l and component node p1;
based on the forward and backward sections of the corrosion site p, the full section S of the corrosion site p is calculated using the following formula p
S p =f(p)∪b(p);
In the formula, S p Is a full slice with p, f (p) is a forward slice with p as a slicing criterion, b (p) is a backward slice with p as a slicing criterion;
full slices of the erosion point a = mi nus. Fun (2, 1) are statement node a = minus. Fun (2, 1), calcu late (), class cal l, system.out. Pr int l n (a), c lass minus, abs (int a, int b), if (a > b), return (a-b) and component nodes p1 and p2;
full slices of corrosion point b = p us. Fun (2, 1) are statement node b = p us. Fun (2, 1), system.out.pr int l n (b), fun (int a, i nt b), class p l us, return (a + b), calcu late (), class cal l, and component nodes p1 and p3.
Step S106, calculating the repair cost of the corrosion point based on the full section of the corrosion point, wherein the specific process comprises the following steps:
full section S based on said corrosion site p p Calculating the repair cost m of the corrosion point p p
Figure SMS_7
Wherein S is p Full slices using p as slicing criterion, F p Is the statement set of the file in which p is located, | F p Is F | p Number of elements contained in, C p Is the statement set of the component in which p is located, | C p Is | C p The number of elements contained in (A) p Is the set of statements of the program in which p is located, | A p Is A p The number of elements, | F p ∩S p Is F | p And S p The number of elements, | C, contained in the union p ∩S p Is | C p And S p The number of elements, | A, contained in the union of p ∩S p Is A p And S p The number of elements contained in the union of (1) is the same file repair difficulty coefficient, beta is the same component repair difficulty coefficient and gamma is the global repair difficulty coefficient;
through 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 the repair cost is lower, the cost required to repair the current corrosion site is lower.
In the invention, the same file repair difficulty coefficient is assumed to be 0.2, the same component repair difficulty coefficient is assumed to be 0.3, and the global repair difficulty coefficient is assumed to be 0.5.
Repair cost for corrosion site a = mi nus. Fun (2,1) was calculated as follows:
Figure SMS_8
repair cost for corrosion site b = p l us. Fun (2,1) was calculated as follows:
Figure SMS_9
from the results of the repair cost calculation of the corrosion site a = mi nus · fun (2,1) and the corrosion site b = p l us · fun (2,1), it is understood that the repair cost of the corrosion site b = p l us · fun (2,1) is lower.
Based on the software architecture corrosion repair cost estimation method, the embodiment of the invention also provides a software architecture corrosion repair cost estimation device.
For example, the method for estimating the corrosion repair cost of the software architecture can be divided into a plurality of modules, the plurality of modules are stored in a memory, and the processor executes the method to complete the invention. The modules or units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used for describing the execution process of the software architecture corrosion repair cost estimation method. 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 the 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, and judging the corrosion degree of the software architecture based on the corrosion degree to obtain a judgment result;
the construction module is used for constructing multi-level software architecture trees of the software architecture before and after evolution;
the comparison marking module is used for comparing the multi-layer software architecture trees before evolution and after evolution, marking different points in the two multi-layer software architecture trees, and marking the different points as change points;
an analysis module to locate corrosion sites 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 site;
a third calculation module for calculating a repair cost for the corrosion site based on the full slice of the corrosion site.
Correspondingly, the invention also provides 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 of the embodiments of the invention.
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 flow or flows and/or block diagram block or blocks, and corresponding steps may be implemented by different modules.
The programs described above may be run on a processor or may also be stored in memory (or referred to as computer-readable media), which includes both non-transitory and non-transitory, removable and non-removable media, that implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media 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 that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (trans i-speed med ia), such as modulated data signals and carrier waves.
Accordingly, the present invention also provides a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method described in any of the embodiments of the present invention.
Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the protection scope of the present invention should be defined by the appended claims.

Claims (10)

1. A method for estimating the corrosion repair cost of a software architecture is characterized by comprising 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 judgment result;
constructing multi-level software architecture trees before and after the software architecture evolution;
comparing the multi-level software architecture trees before and after evolution, marking different points in the two multi-level software architecture trees, and marking the different points as change points of a software architecture;
locating corrosion points based on the quality attributes and the change points of the software architecture;
calculating a full slice of the corrosion site;
calculating a repair cost for the corrosion site based on the full section of the corrosion site.
2. The method of claim 1, wherein the method comprises: the method comprises the following steps of 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, wherein the judgment result comprises the following steps:
calculating a degree of corrosion ED (a, b) of the software architecture based on the quality attribute;
Figure FDA0003964929530000011
where a represents a software architecture before evolution, b represents a software architecture after evolution, ED (a, b) represents an average value of differences from respective quality attributes, N is a set of quality attributes of the software architecture, | N | is the number of elements included in N, N i_a Is a metric value of the ith quality attribute of a, N i_b Is a metric value for the ith quality attribute of b.
3. The method of claim 1, wherein the method comprises: constructing the multi-level software architecture tree before and after the software architecture evolution, comprising the following steps:
respectively constructing a multi-level software architecture tree for the software architecture before 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 sub-nodes;
the first-layer child nodes are component nodes, each component node represents a component, and the association relationship between the root node and the first-layer child nodes represents the components contained in the software architecture;
the second layer of child nodes are file nodes, each file node represents a file, and the incidence relation between the first layer of child nodes and the second layer of child nodes represents the files corresponding to the second layer of child nodes contained in the component corresponding to the first layer of child nodes;
the third-layer child nodes to the last-layer child nodes are statement nodes, each statement node represents a statement of a source code, and the association relationship between the second-layer child nodes and the third-layer child nodes to the last-layer child nodes represents statements corresponding to the third-layer child nodes to the last-layer child nodes included in the file corresponding to the second-layer child nodes.
4. The method of claim 3, wherein the method comprises: the comparing the multi-level software architecture tree before and after evolution comprises: and detecting different points between the pre-evolution software architecture and the post-evolution software architecture according to the content contained in the child nodes in the multi-level software architecture tree.
5. The method of claim 1, wherein the method comprises: the locating of the corrosion point based on the quality attribute of the software architecture and the change point comprises:
analyzing the multi-level software architecture tree based on a measurement formula of the quality attribute of the software architecture, marking the change points causing the software architecture corrosion in the multi-level software architecture tree, and recording the change points causing the software architecture corrosion as corrosion points.
6. The method of claim 1, wherein the method comprises: the calculating a full slice of the corrosion site comprises:
calculating a forward section f (p) of the corrosion point p by taking the corrosion point p as a section criterion;
calculating backward slices b (p) of the corrosion points p by taking the corrosion points p as slicing criteria;
calculating a full slice S of said corrosion site p based on said forward slice f (p) and said backward slice b (p) of said corrosion site p p =f(p)∪b(p)。
7. The method of claim 6, wherein the method comprises: calculating a repair cost for the corrosion site based on the full section of the corrosion site, comprising:
full section S based on said corrosion site p p Calculating the repair cost m of said corrosion site p p
Figure FDA0003964929530000021
Wherein S is p Is p isFull slices of the slicing criterion, F p Is the statement set of the file in which p is located, | F p Is F | p Number of elements contained in, C p Is the statement set of the component in which p is located, | C p Is | C p Number of elements contained in (A) p Is the set of statements of the program in which p is located, | A p Is A p The number of elements, | F p ∩S p Is F | p And S p The number of elements, | C, contained in the union of (1) p ∩S p Is | C p And S p The number of elements, | A, contained in the union of p ∩S p Is A p And S p The number of elements contained in the union of (1) is the same file repair difficulty coefficient, beta is the same component repair difficulty coefficient, and gamma is the global repair difficulty coefficient.
8. A software architecture corrosion repair cost estimation device is characterized by comprising:
the first calculation module is used for 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 judgment result;
the construction module is used for constructing multi-level software architecture trees of the software architecture before and after evolution;
the comparison marking module is used for comparing the multi-layer software architecture trees before evolution and after evolution, marking different points in the two multi-layer software architecture trees, and marking the different points as change points of the software architecture;
an analysis module to locate corrosion sites based on quality attributes of the software architecture and the change points;
a second calculation module for calculating a full slice of the corrosion site;
a third calculation module for calculating a repair cost for the corrosion site based on the full section of the corrosion site.
9. 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 7.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1 to 7.
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 true CN115904980A (en) 2023-04-04
CN115904980B 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
CN115904980B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
CN109542789B (en) Code coverage rate statistical method and device
CN110196811B (en) Method and equipment for evaluating software quality
CN102331921A (en) Be used to detect the unusual method and system of decimal system floating-point amount
CN110909306B (en) Business abnormality detection method and device, electronic equipment and storage equipment
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
CN114943307A (en) Model training method and device, storage medium and electronic equipment
CN110515758B (en) Fault positioning method and device, computer equipment and storage medium
CN112131078B (en) Method and equipment for monitoring disk capacity
CN111765676A (en) Multi-split refrigerant charge capacity fault diagnosis method and device
CN115904980B (en) Method, device, equipment and storage medium for estimating corrosion repair cost of software architecture
CN112712181A (en) Model construction optimization method, device, equipment and readable storage medium
CN112561171B (en) Landslide prediction method, device, equipment and storage medium
CN111382052A (en) Code quality evaluation method and device and electronic equipment
CN112560267B (en) Method, device, equipment and storage medium for dividing ramp units
CN114513401A (en) Automatic operation and maintenance repair method and device for private cloud and computer readable medium
CN116303026B (en) Evolution history-based software architecture degradation prediction method, device and equipment
CN112257587B (en) Target object detection effect evaluation method, device, storage medium and equipment
CN115470922B (en) Quantum bit calibration method and device, quantum control system and quantum computer
CN112836745B (en) Target detection method and device
CN116303731B (en) Code matching method and device for hospital standard main data and electronic equipment
CN111913805B (en) CPU utilization rate calculation method and device
CN108712284B (en) Fault service positioning method and device and service server
CN118032374A (en) Test evaluation method, computer storage medium and terminal
CN117908334A (en) Method, system, computer device and storage medium for optimizing photolithography process window

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