Disclosure of Invention
The invention provides an iteration defect risk assessment method and system, which are used for solving the problem that defects of iterated codes are easy to identify or review errors in the prior art.
Acquiring iteration risk index data of at least two target function points of target software, wherein the target software is software performing function iteration, and the iteration risk index data comprises a plurality of iteration risk indexes of the target function points;
obtaining the weight of each iteration risk index according to preset project factors;
weighting the iteration risk index data of the target function points based on the weight of the iteration risk index to obtain a risk value of each target function point;
And determining a target risk area based on the risk value, wherein the target risk area refers to a code risk area of the target software, and the target risk area is used for determining a software testing key area.
In an embodiment of the present invention, the plurality of iteration risk indexes include a function period change rate, and the step of obtaining the function period change rate data of the target function point includes:
Acquiring the iteration times of the target function point of the target software in a preset iteration period and the total iteration times of the target software in the iteration period;
And determining the ratio of the iteration times of the target functional point to the total iteration times as the functional period change rate data of the current target functional point.
In an embodiment of the present invention, the plurality of iteration risk indexes include a code line change rate, and the step of obtaining code line change rate data of the target function point includes:
acquiring the code change line number of the target function point in the current software function iteration process and the total code line number corresponding to the target function point currently;
And determining the ratio of the code change line number to the corresponding total code line number as code line change rate data of the current target function point.
In an embodiment of the present invention, the plurality of iteration risk indexes include a function influence range, and the step of obtaining the function influence range data of the target function point includes:
Obtaining a function point directly associated with the target function point based on the association relation of each function point in the target software;
determining the number of function points directly related to the target function point as a first number;
Determining the number of all the function points in the target software as a second number;
And determining the ratio between the first quantity and the second quantity as the function influence range data of the current target function point.
In an embodiment of the present invention, the plurality of iteration risk indexes includes testing non-coverage rate, and the step of obtaining testing non-coverage rate data of the target function point includes:
determining a code corresponding to the target function point as a target code;
determining the ratio of the number of lines of the target code covered by the last test to the total number of lines of the target code as a test coverage rate, wherein the last test is an automatic test and/or a unit test, the automatic test refers to code analysis and test by utilizing a preset automatic test tool, and the unit test refers to test of code units which are functions or methods in the code of the target software;
And determining the complement of the test coverage rate as test non-coverage rate data of the current target functional point.
In an embodiment of the present invention, after the step of obtaining the iterative risk indicator data of at least two target function points of the target software, the method further includes:
constructing a risk view based on the iterative risk index data of the target function point;
And visually displaying the risk view, wherein the iteration risk index data of the target function point in the risk view are updated periodically according to a data acquisition period, and the data acquisition period refers to the period of acquiring the iteration risk index data.
In an embodiment of the present invention, the step of determining the target risk area of the code of the target software based on the risk value includes:
sorting the target function points from large to small based on the risk values of all the target function points to determine one or more target function points arranged in front as risk function points;
Acquiring association relations of all function points in the target software;
based on the association relation, obtaining function points which are directly associated and/or indirectly associated with the risk function points;
determining a function point which is directly or indirectly related to the risk function point as a risk related point;
and determining the target risk area based on the risk function points and the corresponding risk association points.
In an embodiment of the present invention, the step of obtaining the weight of each iteration risk indicator according to a preset project factor includes:
Constructing a hierarchical structure model based on the project factors and the iteration risk indexes, wherein the hierarchical structure model comprises a target layer, a criterion layer and a scheme layer, the content of the target layer is an optimal scheme for acquiring the weights of the iteration risk indexes, the criterion layer comprises a plurality of the project factors, and the scheme layer comprises a plurality of the iteration risk indexes;
the first weight of each item factor is obtained by comparing the item factors in the criterion layer in pairs;
Based on the scheme layer, constructing a judgment matrix to compare iteration risk indexes in the scheme layer in pairs to obtain a second weight of the iteration risk indexes relative to each project factor;
Determining a product between the second weight and the corresponding first weight as an intermediate weight;
determining the sum of all the intermediate weights of the iteration risk indexes as the synthesis weight of the iteration risk indexes;
and obtaining the weight of each iteration risk index based on the synthetic weight ratio of all the iteration risk indexes.
In an embodiment of the present invention, the plurality of iteration risk indexes further includes a carry-over problem rate, and the step of obtaining carry-over problem rate data of the target function point includes:
acquiring the current defect number and the total code line number of the target function point;
Determining a ratio between the defect number and the total code line number as an intermediate value;
the product of the intermediate value and 1000 is determined as legacy problem rate data.
The invention also provides an iterative defect risk assessment system, which comprises:
The data acquisition module is used for acquiring iteration risk index data of at least two target function points of target software, wherein the target software is software performing function iteration, and the iteration risk index data comprises data of a plurality of iteration risk indexes of the target function points;
the weight acquisition module is used for acquiring the weight of each iteration risk index according to a preset project factor;
The risk value acquisition module is used for carrying out weighting processing on the iteration risk index data of the target function points based on the weight of the iteration risk index so as to obtain the risk value of each target function point;
the target risk area determining module is used for determining a target risk area based on the risk value, wherein the target risk area refers to a code risk area of the target software, and the target risk area is used for determining a software testing key area.
The iteration defect risk assessment method and system have the advantages that iteration risk index data of at least two target function points of target software are obtained, the target software is software which is subjected to function iteration, the iteration risk index data comprise multiple iteration risk index data of the target function points, weight of each iteration risk index is obtained according to preset project factors, weighting processing is conducted on the iteration risk index data of the target function points based on the weight of the iteration risk index to obtain a risk value of each target function point, a target risk area is determined based on the risk value, the target risk area refers to a code risk area of the target software, and the target risk area is used for determining a software test key area. The method can obtain the target risk area of the target software, namely the area with higher risk of generating the code defects in the iterative process, and is convenient for the subsequent related personnel to pay important attention to and test the area so as to avoid the situations of code defect identification or examination errors and the like.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict.
It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In the following description, numerous details are set forth in order to provide a more thorough explanation of embodiments of the present invention, it will be apparent, however, to one skilled in the art that embodiments of the present invention may be practiced without these specific details, in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring the embodiments of the present invention.
The iterative defect risk assessment method, system, electronic device and storage medium provided by the invention are explained below with reference to fig. 1 to 7.
Referring to fig. 1, fig. 1 is a flowchart of an iterative defect risk assessment method according to an embodiment of the present invention, as shown in fig. 1, the iterative defect risk assessment method includes:
S110, acquiring iteration risk index data of at least two target function points of target software, wherein the target software is software performing function iteration, and the iteration risk index data comprise data of a plurality of iteration risk indexes of the target function points.
It should be noted that, by acquiring the iteration risk index data of at least two target function points of the target software of the current version or the designated version, the subsequent analysis of the iteration defect risk (the risk of the iteration defect occurring after the last iteration) of the target function point in the function iteration process based on the iteration risk index data can be facilitated, and the instantaneity is strong. The target function points are selected from all the function points of the target software, namely, the function points are functions realized by the target software, such as a user list function, a user detail function and the like. Functional iteration is a method commonly used in software development. The iteration risk index is a preset risk index, and can be set according to actual conditions, such as code change amount, code complexity and the like of the function points.
And S120, obtaining the weight of each iteration risk index according to the preset project factors.
The project factors include project (project where the target software is located) characteristic factors, historical data (historical version) of the target software, and the like. The project characteristic factors comprise uniqueness of application environment, uniqueness of resources, uniqueness of requirements, technical complexity, external dependence and the like. In this embodiment, the weight of each iteration risk indicator may be obtained by a manual scoring manner according to a preset project factor. It should be further noted that, by acquiring the weight of each iteration risk indicator, the risk value of the target function point is convenient to acquire subsequently.
It should be mentioned that the sum of the weights of the iteration risk indexes of the target function point is 1.
And S130, weighting the iteration risk index data of the target function points based on the weight of the iteration risk index to obtain the risk value of each target function point.
Specifically, the data of each iteration risk index are multiplied by the corresponding weights respectively and summed to obtain the risk value of each target function point. It should be noted that, by acquiring the risk value of each target function point, the risk of generating defects after iteration of each target function point is quantified, and the user can conveniently identify the target function point with a higher risk value, so as to determine the function point which needs to be subjected to the subsequent key test.
And S140, determining a target risk area based on the risk value, wherein the target risk area refers to a code risk area of the target software, and the target risk area is used for determining a software testing key area.
It should be noted that, the target risk area is used to provide guidance for allocation of software testing resources. Specifically, according to actual requirements, determining an area where a code corresponding to a target function point with a higher risk value is located as a target risk area, wherein the code in the target risk area means that the risk of iteration defects is higher. And when the software test is carried out later, testing is carried out on codes in the target risk area to finish the test resource allocation. Through the mode, defects after software function iteration can be found in advance, and defect identification errors are avoided, namely, high-risk codes (codes in a target risk area) are subjected to key verification and testing, reasonable allocation of testing resources is achieved, and accurate testing of code defects is achieved.
In order to improve the accuracy of the acquired risk values, the invention provides four iteration risk indexes, and the risk values with higher accuracy are obtained by acquiring the data of the following four iteration risk indexes. The four iteration risk indexes comprise a function period change rate, a code line change rate, a function influence range and test non-coverage rate. The steps of acquiring the data of the four iteration risk indexes are explained below by way of example.
In some embodiments, the step of obtaining the function period change rate data (data of the function period change rate) of the target function point includes:
1. And acquiring the iteration times of the target function point of the target software in a preset iteration period and the total iteration times of the target software in the iteration period.
It should be noted that the iteration period may be set according to practical situations, for example, 3 months, 4 months, and the like.
2. And determining the ratio of the iteration times of the target functional point to the total iteration times as the functional period change rate data of the current target functional point. For example, assuming that the iteration cycle is 3 months, the iteration number of the current target function point in 3 months is 3, and the total iteration number of the target software in 3 months is 10, the function cycle change rate data of the target function point is 30%. By acquiring the function period change rate, the iteration frequency of the target function point can be reflected well. Typically, the functional cycle change rate data is proportional to the risk of iterative defects at the target functional point.
In some embodiments, the step of obtaining code line change rate data (data of code line change rate) of the target function point includes:
1. and acquiring the code change line number of the target function point in the current software function iteration process and the total code line number corresponding to the target function point currently.
The changed line number includes a deleted line number, a newly added line number and a modified line number. The total code line number refers to the code line number corresponding to the target function point after the last software iteration.
2. And determining the ratio of the code change line number to the corresponding total code line number as code line change rate data of the current target function point. For example, assume that in the current software function iteration process, codes corresponding to any target function point have 100 lines of change, i.e. the number of lines of code change is 100. If the total number of code lines of the target function point is 1 ten thousand lines, the code line change rate data is 1%. By acquiring the code line change rate, the code change rate of the target function point can be reflected well. Typically, the code line change rate data is proportional to the risk of iteration flaws at the target function point.
In some embodiments, the step of obtaining the functional influence range data (data of functional influence range) of the target functional point includes:
1. and obtaining the function points directly related to the target function points based on the association relation of each function point in the target software.
It should be noted that, the association relationship of each functional point in the target software is preset, so that the association relationship can be directly obtained. The function points have direct association, indirect association or no association.
2. The number of function points directly associated with the target function point is determined as a first number.
3. And determining the number of all the function points in the target software as a second number.
4. And determining the ratio between the first quantity and the second quantity as the function influence range data of the current target function point. For example, assuming that the target software has 10 function points in total and 3 function points having a direct association relationship with the current target function point, the function influence range data of the current target function point is 30%. According to the embodiment, the risk value of the target function point can be conveniently determined later by acquiring the function influence range of the target function point. In general, the larger the functional impact range data, the greater the risk of iteration defects.
In some embodiments, the step of obtaining test non-coverage data (test non-coverage data) for the target function point comprises:
1. and determining the code corresponding to the target function point as a target code.
2. Determining the ratio of the number of lines of the target code covered by the last test to the total number of lines of the target code as a test coverage rate, wherein the last test is an automatic test and/or a unit test, the automatic test refers to code analysis and test by utilizing a preset automatic test tool, and the unit test refers to test of code units which are functions or methods in the code of the target software.
3. And determining the complement of the test coverage rate as test non-coverage rate data of the current target functional point.
Specifically, a difference between 1 and the test coverage is determined as test non-coverage data of the current target function point. It should be noted that, by acquiring the test non-coverage rate data, it is convenient to accurately grasp the iteration defect risk of the current target function point. In general, the larger the test non-coverage data, the greater the risk of iterative defects.
In order to facilitate the user to grasp the iteration defect risk change condition of the target software in the current software function iteration process, in some embodiments, after the step of obtaining the iteration risk indicator data of at least two target function points of the target software, the method further includes:
1. And constructing a risk view based on the iterative risk index data of the target function point.
2. And visually displaying the risk view, wherein the iteration risk index data of the target function point in the risk view are updated periodically according to a data acquisition period, and the data acquisition period refers to the period of acquiring the iteration risk index data.
By constructing the risk view and visually displaying the risk view, a user can conveniently and timely grasp the variation condition of iteration defect risks of each target function point, and further timely optimize a test plan and a strategy so as to improve the test efficiency. It can be understood that by testing codes corresponding to target function points with higher risks in the risk view, reasonable allocation of testing resources is realized, and therefore testing efficiency is effectively improved. And, while improving the test efficiency, ensure the software quality of the goal software to pass.
It should be noted that, in the iterative process, automated data collection is implemented to update the risk view in real time, so as to ensure that risk variation is monitored in time.
In some embodiments, the step of determining a target risk region of the code of the target software based on the risk value comprises:
First, the target function points are sorted from large to small based on the risk values of all the target function points to determine one or more of the target function points arranged in front as a risk function point.
And secondly, acquiring the association relation of each functional point in the target software.
And then, based on the association relation, obtaining the function points which are directly associated and/or indirectly associated with the risk function points.
And determining the function points directly or indirectly associated with the risk function points as risk associated points.
And finally, determining the target risk area based on the risk function points and the corresponding risk association points.
It should be noted that, by determining the target risk area and feeding back, the subsequent key test on the target risk area can be facilitated, so that situations such as missing of iterative defect identification and the like are avoided.
In some embodiments, the step of obtaining the weight of each iteration risk indicator according to a preset project factor includes:
1. and constructing a hierarchical structure model based on the project factors and the iteration risk indexes, wherein the hierarchical structure model comprises a target layer, a criterion layer and a scheme layer, the content of the target layer is an optimal scheme for acquiring the weights of the iteration risk indexes, the criterion layer comprises a plurality of the project factors, and the scheme layer comprises a plurality of the iteration risk indexes.
2. And comparing the project factors in the criterion layer in pairs to obtain a first weight of each project factor.
Specifically, the item factors in the rule layer can be compared in pairs by adopting a scale method (1 to 9 minutes), and the first weight of each item factor is obtained.
3. Based on the scheme layer, constructing a judgment matrix to compare iteration risk indexes in the scheme layer in pairs to obtain a second weight of the iteration risk indexes relative to each project factor.
Specifically, the iterative risk indicators in the scheme layer can be compared in pairs by using a scale method (1 to 9 minutes) to obtain the first weight of each project factor.
4. The product between the second weight and the corresponding first weight is determined as an intermediate weight.
5. And determining the sum value of all the intermediate weights of the iteration risk indexes as the synthesis weight of the iteration risk indexes.
6. And obtaining the weight of each iteration risk index based on the synthetic weight ratio of all the iteration risk indexes.
It should be noted that, assuming that 4 iteration risk indexes currently exist, the synthesis weight ratio of all iteration risk indexes may be expressed as a: b: c: d, where a represents the synthesis weight of the first iteration risk index, b represents the synthesis weight of the second iteration risk index, c represents the synthesis weight of the third iteration risk index, and d represents the synthesis weight of the fourth iteration risk index. The value corresponding to each iteration risk index in the composite weight ratio is the weight of the iteration risk index. In the embodiment, the weight of each iteration risk index is obtained by using an analytic hierarchy process, so that the accuracy is high.
In addition, when no project factor exists, the project factor in the criterion layer can be changed into an iteration risk index, and the iteration risk index in the scheme layer is changed into a different weight scheme of the iteration risk index. And further, based on an analytic hierarchy process, the synthesized weights of different weight schemes are obtained. And finally, determining the weight scheme with the highest synthesized weight as a final weight scheme. The weight in the final weight scheme is the weight of each iteration risk index.
In some embodiments, the plurality of iterative risk indicators further includes a carry-over problem rate. Further, the step of acquiring the legacy problem rate data of the target function point includes:
1. And acquiring the current defect (bug) number and the total code line number of the target function point.
2. And determining the ratio between the defect number and the total code line number as an intermediate value.
3. The product of the intermediate value and 1000 is determined as legacy problem rate data. It should be noted that, by acquiring the legacy problem rate data, the accuracy of the risk value acquired later can be improved.
It should be noted that, in addition to the above function cycle change rate, code line change rate, function influence range, test non-coverage, and legacy problem rate, other indexes such as personnel change rate, defect escape rate (defect escape rate of historical version of target software) and the like may be customized. After the data of the iteration risk indexes are obtained, the weight of each iteration risk index is obtained by using a hierarchical analysis method, for example, the weight of the function period change rate is 0.4, the weight of the function influence range is 0.3, the weight of the code line change rate is 0.2, the weight of the test non-coverage rate is 0.1, and the like. And further obtaining the risk value of the target function point based on the data of each iteration risk index and the corresponding weight.
The iterative defect risk assessment method in the above embodiment is explained in the following with a specific embodiment.
Referring to fig. 2, the iterative defect risk assessment method includes a first step, starting functional iteration. Specifically, functional iterations are started for the target software. 2. And classifying the functional points of the target software. Specifically, the target software is divided into a plurality of functional points, and the target functional point, namely the functional point needing iterative defect risk assessment, is determined from the plurality of functional points. 3. And acquiring iteration risk index data. Specifically, function cycle change rate data, code line change rate data, function influence range data, and test uncovering rate data of the target function point are calculated. (in this embodiment, only four iteration risk indexes including a function period change rate, a code line change rate, a function influence range and a test non-coverage rate are used for illustration, and other indexes can be added in an actual implementation process) and a risk view is constructed. Specifically, a risk view is constructed based on the iterative risk indicator data. 5. And obtaining the weight of each iteration risk index according to the preset project factors. 6. And calculating the risk value of the target function point, namely the risk value of the defect of the target function point in the iterative process. 7. And determining a target risk area, specifically, determining the target risk area based on the risk value of each target function point. 8. The functional iteration ends. Through the steps, the iteration defect risk of each target function point can be monitored in real time in the whole function iteration process, so that the test plan and strategy of the target software can be timely adjusted in the function iteration process, and the test efficiency is improved. And, guarantee the compliance of the goal software.
In addition, in the whole function iteration process, iteration risk index data are required to be acquired in real time so as to realize real-time updating of a risk view and iteration defect risk monitoring of a target function point. And under the condition that the data of the iteration risk index comprises four data, namely functional period change rate data, code line change rate data and functional influence range data, and test non-coverage rate data, different data acquisition flows are involved with the acquisition of the four data. Fig. 3 is a schematic flow diagram of an exemplary automated data acquisition involved in acquiring these four types of data, as shown in fig. 3, with respect to the function cycle rate data acquisition, an iteration cycle is first set, such as three months or the like. And secondly, acquiring the total iteration times of the target software in the iteration period. Finally, the iteration times of the current target functional point in the iteration period are obtained, so that the collection of the related data of the functional period change rate data is completed. The code line change rate data acquisition relates to two types of data, namely the code change line number of a target functional point in the current software function iteration process (the code change line number of the target functional point of the current version of the target software under the code warehouse) and the total code line number corresponding to the target functional point currently (the total code line number of the target functional point of the current version of the target software under the code warehouse). The data acquisition of the functional influence range relates to two types of data, namely the number of all functional points in target software, namely the number of all functional points in the current iteration, and the number of functional points directly related to the target functional points. The test non-coverage rate data acquisition relates to three types of data acquisition, namely, an automatic test coverage line number under a corresponding iteration branch (a code corresponding to a target function point, namely, a target code), a unit test coverage line number of the corresponding iteration branch, and a total code function of the corresponding iteration branch under a code warehouse, namely, a total line number of the target code.
The iterative defect risk assessment method in the above embodiment is further explained with another specific embodiment.
Suppose that there is currently a user management system (target software) that is performing an iteration of the software function, the project data of which are as follows:
1. The project management tool records that 10 iterations, currently 11 iterations, have been completed within three months.
2. The code version management tool records that a user list is 1000 lines of newly added functions, 1000 lines of total codes of user detail functions and 100 lines of changes.
3. And the current iteration content comprises a new user list function and a user detail function (increasing user login time, user head portraits and user nicknames) is optimized. The user management system has 10 function points in total by the current iteration. The user list function is directly related to the user detail function, which is directly related to the remaining 3 function points, and the user detail function is also changed in the 8 th and 9 th iterations.
4. And (3) testing coverage content, namely acquiring 100 lines of codes covered by the automatic test of the user detail function, wherein the total number of lines of codes of the user detail function is 1000 lines, and no unit test is performed. The user list function is a new function without automatic test and unit test.
5. The rest background of the project is that the user detail function in the current iteration is participated by 2 persons, wherein the user detail function is temporarily added by 2 persons, namely the user detail function is provided with 2 persons of detail information, and the details of one person are temporarily added information.
And starting to perform iterative defect risk assessment based on the project data. First, the target software is subjected to functional point classification. Specifically, the evaluation requirement information is obtained from the project management tool, a new function point (user list function point) is added in the current iteration, and one function point (user detail function point) is optimized. The two function points are target function points. And secondly, acquiring iteration risk index data, namely functional period change rate, code line change rate, functional influence range and test non-coverage rate data. In the current iteration, personnel variation exists in the user detail function, so in addition to the four indexes of the function period change rate, the code line change rate, the function influence range and the test non-coverage rate, the embodiment also defines a personnel variation risk index, and therefore, the data of the iteration risk index also comprises personnel variation rate (the ratio between the number of the varied personnel and the total personnel) data. The iterative risk indicator data for two functional points are shown in table 1 below:
Table 1 iterative risk indicator data for two functional points
Specifically, regarding the user list function, the function cycle change rate is 0, the code line change rate is 100%, the function influence range is 10%, the test non-coverage rate is 100%, and the personnel change rate is 0. Regarding the user detail function, the function cycle change rate was 20%, the code line change rate was 10%, the function influence range was 30%, the test non-coverage was 90%, and the personnel change rate was 50% (1/2=50%).
Then, a risk view is constructed. Fig. 4 is an exemplary schematic diagram of a risk view constructed based on the above iterative risk indicator data, please refer to fig. 4, in which the iterative risk indicator data (such as the functional period change rate, the code line change rate, the functional influence range, the test non-coverage rate, and the personnel change rate) of the two functional points of the user list and the user details are visually displayed in a histogram. In addition to histograms, pie charts, scatter charts, and the like may be used that may exhibit iterative risk indicator data changes.
And obtaining the weight of each iteration risk index by using a hierarchical analysis method based on the iteration history record and the project factors. In the analysis process, the data with stronger correlation with the function of the iteration, more code changes and more defects in the iteration history record can be referred to, so that the accuracy of the obtained weight is improved. For example, assuming that the correlation between the function of one iteration process iteration in the iteration history record and the function of the current iteration is strong, and the code of the current iteration in the iteration history record is changed more, defects generated after the iteration are also more, the weights of the indexes in the current iteration process and the like can be determined based on the weights of the indexes in the iteration history record at the time of the iteration. The analytic hierarchy process calculates the weight of the periodic change rate of the function of the embodiment to be 0.35, the weight of the code line change rate to be 0.2, the weight of the functional influence range to be 0.30, the weight of the test non-coverage to be 0.1, and the weight of personnel change to be 0.05.
Next, a risk value is calculated. Specifically, based on the iteration risk index data and the weights, the risk value of the user list function point is obtained to be 0.15, and the risk value of the user detail function point is obtained to be 0.11. And visually displaying the risk values of the two functional points. Referring to fig. 5, a line graph is exemplarily used in fig. 5 to visually demonstrate risk values of the above two functional points, so as to facilitate user identification. In the specific implementation process, other graphs such as bar graphs and the like which can be used for displaying the risk value can be adopted, and are not repeated here.
And finally, determining a target risk area, namely a place needing to be subjected to important test in the iteration. Specifically, based on the risk values, the function points with higher risk values are obtained as user list function points. By combining the function correlation data in the item data, it is known that the user list function point is directly related to the user detail function point, and the user detail function point is directly related to the other three function points, so that the user list function point is directly or indirectly related to the other four function points. Therefore, the codes corresponding to the user list function point, the user detail function point and the three function points directly related to the user detail function point are the target risk areas, and important attention is needed in the regression test.
The iterative defect risk assessment system provided by the invention is described below, and the iterative defect risk assessment system described below and the iterative defect risk assessment method described above can be referred to correspondingly.
Referring to fig. 6, an iterative defect risk assessment system provided in this embodiment includes:
A data obtaining module 610, configured to obtain iteration risk indicator data of at least two target function points of target software, where the target software is software performing function iteration, and the iteration risk indicator data includes data of multiple iteration risk indicators of the target function points;
the weight obtaining module 620 is configured to obtain a weight of each iteration risk indicator according to a preset project factor;
the risk value obtaining module 630 is configured to perform a weighting process on the data of the iteration risk indicator of the target function point based on the weight of the iteration risk indicator, so as to obtain a risk value of each target function point;
The target risk area determining module 640 is configured to determine a target risk area, where the target risk area refers to a code risk area of the target software, based on the risk value, and the target risk area is used to determine a software testing key area. The data acquisition module 610, the weight acquisition module 620, the risk value acquisition module 630, and the target risk area determination module 640 are connected. The iteration defect risk assessment system in the embodiment can better obtain the target risk area of the code of the target software, namely the area with higher risk of generating the code defect after iteration, is convenient for the subsequent related personnel to pay attention to and test the area so as to avoid the situations of code defect identification or examination errors and the like, and has stronger feasibility and lower cost.
In some embodiments, the data obtaining module 610 is specifically configured to obtain the iteration number of the target function point in a preset iteration period of the target software, and the total iteration number of the target software in the iteration period;
And determining the ratio of the iteration times of the target functional point to the total iteration times as the functional period change rate data of the current target functional point.
In some embodiments, the data obtaining module 610 is specifically configured to obtain a number of code change lines of the target function point in a current software function iteration process, and a total number of code lines currently corresponding to the target function point;
And determining the ratio of the code change line number to the corresponding total code line number as code line change rate data of the current target function point.
In some embodiments, the data obtaining module 610 is specifically configured to obtain, based on the association relationship of each function point in the target software, a function point directly associated with the target function point;
determining the number of function points directly related to the target function point as a first number;
Determining the number of all the function points in the target software as a second number;
And determining the ratio between the first quantity and the second quantity as the function influence range data of the current target function point.
In some embodiments, the data obtaining module 610 is specifically configured to determine a code corresponding to the target function point as a target code;
determining the ratio of the number of lines of the target code covered by the last test to the total number of lines of the target code as a test coverage rate, wherein the last test is an automatic test and/or a unit test, the automatic test refers to code analysis and test by utilizing a preset automatic test tool, and the unit test refers to test of code units which are functions or methods in the code of the target software;
And determining the complement of the test coverage rate as test non-coverage rate data of the current target functional point.
In some embodiments, the iterative defect risk assessment system further comprises a risk view module for constructing a risk view based on the iterative risk indicator data of the target function point;
And visually displaying the risk view, wherein the iteration risk index data of the target function point in the risk view are updated periodically according to a data acquisition period, and the data acquisition period refers to the period of acquiring the iteration risk index data.
In some embodiments, the target risk area determining module 640 is specifically configured to rank the target function points from large to small based on the risk values of all the target function points, so as to determine one or more target function points that are ranked earlier as risk function points;
Acquiring association relations of all function points in the target software;
based on the association relation, obtaining function points which are directly associated and/or indirectly associated with the risk function points;
determining a function point which is directly or indirectly related to the risk function point as a risk related point;
and determining the target risk area based on the risk function points and the corresponding risk association points.
In some embodiments, the weight obtaining module 620 is specifically configured to construct a hierarchical structure model based on the project factors and the iteration risk indexes, where the hierarchical structure model includes a target layer, a criterion layer and a scheme layer, the content of the target layer is an optimal scheme for obtaining weights of the iteration risk indexes, the criterion layer includes a plurality of the project factors, and the scheme layer includes a plurality of the iteration risk indexes;
the first weight of each item factor is obtained by comparing the item factors in the criterion layer in pairs;
Based on the scheme layer, constructing a judgment matrix to compare iteration risk indexes in the scheme layer in pairs to obtain a second weight of the iteration risk indexes relative to each project factor;
Determining a product between the second weight and the corresponding first weight as an intermediate weight;
determining the sum of all the intermediate weights of the iteration risk indexes as the synthesis weight of the iteration risk indexes;
and obtaining the weight of each iteration risk index based on the synthetic weight ratio of all the iteration risk indexes.
In some embodiments, the data obtaining module 610 is further specifically configured to obtain a current defect number and a total code line number of the target function point;
Determining a ratio between the defect number and the total code line number as an intermediate value;
the product of the intermediate value and 1000 is determined as legacy problem rate data.
In some embodiments, an electronic device is also provided, and the electronic device may be a service end, and an internal structure diagram of the electronic device is shown in fig. 7. The electronic device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes non-volatile and/or volatile storage media and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external client through a network connection. The computer program, when executed by a processor, performs the functions or steps of the method on the server side.
In some embodiments, an electronic device is provided, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to achieve the following steps of obtaining iterative risk index data of at least two target function points of target software, wherein the target software is software performing function iteration, the iterative risk index data comprise data of a plurality of iterative risk indexes of the target function points, obtaining weight of each iterative risk index according to a preset project factor, weighting the iterative risk index data of the target function points based on the weight of the iterative risk index to obtain a risk value of each target function point, and determining a target risk area based on the risk value, wherein the target risk area refers to a code risk area of the target software, and the target risk area is used for determining a software testing key area.
In some embodiments, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor, implements the steps of obtaining iteration risk index data of at least two target function points of target software, the target software being software undergoing function iteration, the iteration risk index data including data of a plurality of iteration risk indexes of the target function points, obtaining a weight of each iteration risk index according to a preset project factor, weighting the iteration risk index data of the target function points based on the weights of the iteration risk indexes to obtain a risk value of each target function point, and determining a target risk area based on the risk values, the target risk area referring to a code risk area of the target software, the target risk area being used for determining a software test key area.
It should be noted that, the functions or steps that can be implemented by the computer readable storage medium or the electronic device may correspond to the descriptions of the server side and the client side in the foregoing method embodiments, and are not described herein one by one for avoiding repetition.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. Accordingly, it is intended that all equivalent modifications and variations of the invention be covered by the claims, which are within the ordinary skill of the art, be within the spirit and scope of the present disclosure.