Software analysis method and electronic equipment
Through software analysis methods, the target object affected by the software package is quickly found using the preset influence relationship, which solves the problem of low efficiency of software testing and abnormal positioning in the existing technology, and realizes efficient testing and abnormal positioning.
Patent Information
- Application Number
- CN202411624494.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, software testing and abnormal positioning are relatively low efficiency, and supplementary testing and target object determination are required manually.
Provide a software analysis method. By determining the impact relationship between the software package to be analyzed and the preset, quickly find the target object to be analyzed that will affect the running or the target object to be analyzed, and perform target operations to improve the efficiency of testing and exception positioning.
Through preset impact relationships, quickly and accurately find the target objects that the software package to be analyzed or the target objects that will affect, avoid manual supplementary testing and target object determination, and significantly improve the efficiency of testing and abnormal positioning.
Smart Images

Figure CN119557189A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software technology, and in particular to a software analysis method and electronic equipment. Background Art
[0002] In the field of software technology, almost every software involves testing and abnormality location. In the related technology, after the code of the software package is modified, the smoke test + manual supplementary test method is used to test whether the code modification will cause abnormalities. Since manual supplementary testing is required, the test efficiency is relatively low. In the related technology, after the software has an abnormality, the technicians rely on their experience and intuition to find the objects that may cause the abnormality, and then further investigate the cause of the abnormality from these objects, that is, locate the abnormality. Since the objects that may cause the abnormality need to be manually determined, there is also a problem of low efficiency. Summary of the invention
[0003] The embodiments of the present application provide a software analysis method and an electronic device to solve the problem of low efficiency of software testing and abnormality location in the related art.
[0004] In a first aspect, an embodiment of the present application provides a software analysis method, comprising:
[0005] Identify the software packages to be analyzed;
[0006] According to the software package to be analyzed and the preset influence relationship, a target object having an influence relationship with the software package to be analyzed is determined; wherein,
[0007] The software package to be analyzed is a software package whose code has been modified, and the impact relationship means that the software package to be analyzed will affect the operation of the target object; or
[0008] The software package to be analyzed is a software package that has an abnormality, and the impact relationship means that the target object will affect the operation of the software package to be analyzed;
[0009] A target operation is performed based on the software package to be analyzed and the target object.
[0010] In the embodiment of the present application, after determining the software package to be analyzed with code modification, the target object that the software package to be analyzed will affect is determined according to the preset impact relationship, and then, based on the software package to be analyzed and the target object, the target operation is performed. In this way, with the help of the preset impact relationship, the target object that the software package to be analyzed will affect can be found quickly and accurately, without the need for manual supplementary testing, so the test efficiency can be improved. In addition, after determining the software package to be analyzed with an abnormality, the target object that will affect the operation of the software package to be analyzed is determined according to the preset impact relationship, and then, based on the software package to be analyzed and the target object, the target operation is performed. In this way, with the help of the preset impact relationship, the target object that will affect the operation of the software package to be analyzed can be found quickly, without the need for manual determination of the target object, so the efficiency of abnormal location can be improved.
[0011] In some embodiments, there are multiple objects that have an influence relationship with the software package to be analyzed, and the multiple objects are divided into multiple levels according to the strength of the influence relationship with the software package to be analyzed;
[0012] When the software package to be analyzed is a software package whose code has been modified, the following further includes:
[0013] Obtaining the analysis level requirement for the software package to be analyzed;
[0014] Determining a target object having an influence relationship with the software package to be analyzed according to the software package to be analyzed and a preset influence relationship includes:
[0015] According to the software package to be analyzed and the preset influence relationship, the objects in the first N layers matching the analysis level requirement are determined as the target objects, where N is a positive integer greater than zero.
[0016] In some embodiments, the target object includes one or more of a dependent software package, software, and a test project.
[0017] In some embodiments, the preset influence relationship includes a code dependency relationship and / or an empirical influence relationship. The code dependency relationship is determined by target fields of multiple software packages in a source code repository, and the target field is used to indicate the software packages that a software package depends on in code; the empirical influence relationship is determined by the influence relationship between the multiple software packages input by a user.
[0018] In some embodiments, the code dependency relationship includes a plurality of code dependency relationships with different influence strengths, and the experience influence relationship includes a plurality of experience influence relationships with different influence strengths.
[0019] In some embodiments, when the software package to be analyzed is a software package whose code has been modified, if the preset influence relationship includes a code dependency relationship and an experience influence relationship, it also includes:
[0020] For each of the multiple software packages, a first object and a second object having the same impact relationship strength corresponding to the software package are merged to obtain objects of multiple impact levels of the software package, wherein the first object has a code dependency relationship with the software package having the impact relationship strength, and the second object has an experience dependency relationship with the software package having the impact relationship strength.
[0021] In some embodiments, the multiple code dependencies with different influence strengths are determined according to the following steps:
[0022] Determining, according to the extraction results of the target fields in the multiple software packages, software packages that the multiple software packages depend on in terms of code;
[0023] Based on the software packages that the multiple software packages depend on in code, the software package dependencies are sorted to obtain a plurality of code dependencies with different influence strengths.
[0024] In some embodiments, the software package to be analyzed is a software package whose code has been modified, and based on the software package to be analyzed and the target object, performing a target operation includes:
[0025] Obtain the software package to be analyzed and the test case corresponding to the target object;
[0026] Run the test case.
[0027] In some embodiments, the software package to be analyzed is an abnormal software package, and the target object includes multiple objects, and the multiple objects are divided into multiple levels according to the strength of the influence relationship with the software package to be analyzed;
[0028] Based on the software package to be analyzed and the target object, a target operation is performed, including:
[0029] When no anomaly is located in the software package to be analyzed, the anomaly is located for the multiple objects layer by layer according to the rule of influence relationship from strong to weak.
[0030] In a second aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein:
[0031] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor can perform any of the above-mentioned software analysis methods.
[0032] In a third aspect, an embodiment of the present application provides a storage medium. When a computer program in the storage medium is executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned software analysis methods.
[0033] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any of the above-mentioned software analysis methods when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0035] Figure 1 A test scenario diagram provided for an embodiment of the present application;
[0036] Figure 2 A flowchart of a software analysis method provided in an embodiment of the present application;
[0037] Figure 3 An abnormality positioning scene diagram provided in an embodiment of the present application;
[0038] Figure 4 A flowchart of another software analysis method provided in an embodiment of the present application;
[0039] Figure 5 A schematic diagram of a software analysis process provided in an embodiment of the present application;
[0040] Figure 6 A dependency network between software packages provided in an embodiment of the present application;
[0041] Figure 7 A schematic diagram of a software testing process provided by an embodiment of the present application;
[0042] Figure 8 A schematic diagram of an abnormality location process provided in an embodiment of the present application;
[0043] Fig. 9 A schematic diagram of the structure of a software analysis device provided in an embodiment of the present application;
[0044] Fig.10 A schematic diagram of the hardware structure of an electronic device for implementing a software analysis method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to solve the problem of low efficiency of software testing and anomaly location in the related art, an embodiment of the present application provides a software analysis method and an electronic device.
[0046] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0047] First of all, it should be noted that in the embodiments of the present application, software such as the Linux operating system may include multiple software packages, each of which is used to perform one or more specific functions, and the functions corresponding to these multiple software packages constitute the functions of this software.
[0048] See also Figure 1 , Figure 1 A test scenario diagram provided for an embodiment of the present application includes a server 10 and a test device 20, and the server 10 and the test device 20 can be connected by wire or wirelessly, wherein an operating system such as a Linux operating system can be installed in the server 10, and the test device 20 such as a server, a desktop computer, a laptop computer, etc., can deploy a test platform, and the test platform can be used to test whether the Linux operating system in the server 10 is running normally.
[0049] After introducing the test scenario in the embodiment of the present application, the test process in the embodiment of the present application is introduced in combination with the embodiment. Figure 2 , Figure 2 A flowchart of a software analysis method provided in an embodiment of the present application, the method is applied to Figure 1 In the testing device 20, the method includes the following steps.
[0050] In step 201, a software package to be analyzed is determined, where the software package to be analyzed is a software package whose code has been modified.
[0051] The software package to be analyzed may be input by a user.
[0052] In step 202, according to the software package to be analyzed and the preset influence relationship, a target object having an influence relationship with the software package to be analyzed is determined, where the influence relationship means that the software package to be analyzed will affect the operation of the target object.
[0053] The target object may include one or more of dependent software packages, software, and test items, such as performance testing, stability testing, etc.
[0054] In actual applications, there may be multiple objects that have an impact relationship with the software package to be analyzed, and the multiple objects are divided into multiple levels according to the strength of the impact relationship with the software package to be analyzed. In this way, each level corresponds to an impact relationship strength, and the level is negatively correlated with the impact relationship strength, that is, the lower the level, the stronger the impact relationship strength, and the higher the level, the weaker the impact relationship strength.
[0055] In some embodiments, according to the software package to be analyzed and the preset impact relationship, all objects that the software package to be analyzed will affect can be used as target objects, that is, objects of all levels corresponding to the software package to be analyzed can be used as target objects. In this way, missing objects can be avoided, thereby improving the coverage of subsequent tests.
[0056] In some embodiments, the user may also input the analysis level requirements of the software package to be analyzed, such as the number of impact levels. In this case, the first N layers of objects that match the analysis level requirements may be determined as target objects based on the software package to be analyzed and the preset impact relationship, that is, the objects within a certain impact range of the software package to be analyzed are used as target objects. In this way, the objects affected by the software package to be analyzed may be controlled by the analysis level requirements, thereby controlling the scope of subsequent tests, achieving the purpose of controlling the test granularity, and providing better test flexibility.
[0057] The preset influence relationships are introduced below.
[0058] In the first case, the preset impact relationship includes code dependency.
[0059] Here, code dependencies refer to other software packages required by a software package when it is compiled, run, or works normally. Code dependencies can be determined through the target fields of multiple software packages in the source code repository, such as requests. The target field is used to indicate the software packages that a software package depends on in code.
[0060] For example, based on the extraction results of the target fields in the multiple software packages, the software packages that the multiple software packages depend on in code are determined, and then, based on the software packages that the multiple software packages depend on in code, the software package dependencies are sorted to obtain multiple code dependencies with different influence strengths. In other words, the code dependency may include multiple code dependencies with different influence strengths.
[0061] Assume that it has been determined that software package 1 depends on software package 2 in terms of code, software package 2 depends on software package 3 in terms of code, and software package 3 depends on software package 4 in terms of code. Then, it can be determined that software package 1 also depends on software packages 3 and 4 in terms of code, and the code dependencies of software package 1 on software package 2, software package 3, and software package 4 become weaker in sequence. Similarly, it can be determined that software package 2 also depends on software package 4 in terms of code, and the code dependencies of software package 2 on software packages 3 and software packages 4 become weaker in sequence.
[0062] In this way, the dependencies between massive software packages can be automatically analyzed to efficiently determine a variety of code dependencies with different strengths of impact relationships among multiple software packages.
[0063] In the second case, the preset influence relationship includes the experience influence relationship.
[0064] The empirical influence relationship is determined by the influence relationship between multiple software packages input by the user.
[0065] In practical applications, for each software package, the object having an experience influence relationship with the software package may be other objects such as software, test items, etc. In addition, the experience influence relationship may include multiple experience influence relationships with different strengths.
[0066] Here, users refer to developers. In this way, the developers' accumulated understanding of the impact relationships between software packages can be converted into a variety of storable empirical impact relationships with different strengths, which can not only ensure the accuracy of the empirical impact relationships, but also reduce the impact of changes in R&D personnel on testing.
[0067] In the third case, the preset influence relationships include code dependency relationships and experience influence relationships.
[0068] When the code dependency relationship includes multiple code dependency relationships with different influence relationship strengths, and the experience influence relationship also includes multiple experience influence relationships with different influence relationship strengths, for each software package in the multiple software packages, the first object and the second object with the same influence relationship strength corresponding to the software package can be merged to obtain objects of multiple influence levels of the software package, wherein the first object has a code dependency relationship with the software package having a corresponding influence relationship strength, and the second object has an experience dependency relationship with the software package having a corresponding influence relationship strength.
[0069] In this way, by combining the code dependencies between software packages and the experience influence relationships accumulated by developers over the years, a preset influence relationship can be formed, which can obtain a more comprehensive and accurate influence relationship. A more comprehensive and accurate influence relationship can better provide guidance for testing and greatly improve test accuracy.
[0070] In step 203, a target operation is performed based on the software package to be analyzed and the target object.
[0071] Among them, the target operation is such as testing.
[0072] In specific implementation, test cases corresponding to the software package to be analyzed and the target object can be obtained, and these test cases can be executed to test whether code modification of the software package to be analyzed will affect the operation of the target object.
[0073] In the embodiment of the present application, after the software package to be analyzed whose code has been modified is determined, the target object to be affected by the software package to be analyzed is determined based on the preset impact relationship, and then the software package to be analyzed and the target object are tested. In this way, with the help of the preset impact relationship, the target object to be affected by the software package to be analyzed can be found quickly and accurately and tested, without the need for manual supplementary testing, so the test efficiency can be improved.
[0074] See also Figure 3 , Figure 3 An exception location scenario diagram provided for an embodiment of the present application includes a server 10, in which an operating system such as a Linux operating system and an exception location tool can be installed. When an exception occurs in the Linux operating system, the exception location tool can be used to locate where the exception occurs in the Linux operating system.
[0075] After introducing the abnormality location scenario in the embodiment of the present application, the abnormality location process in the embodiment of the present application is introduced in combination with the embodiment. Figure 4 , Figure 4 A flowchart of another software analysis method provided in an embodiment of the present application, wherein the execution subject of the method is a server 10, and the method includes the following steps.
[0076] In step 401, a software package to be analyzed is determined, where the software package to be analyzed is a software package with an abnormality.
[0077] Generally, if an exception occurs in the software, the code segment where the exception occurs can be found. The software package to which the code segment belongs is the software package to be analyzed. After that, the exception can be located in the software package to be analyzed. If the exception is not located, subsequent operations can be performed.
[0078] In step 402, according to the software package to be analyzed and the preset influence relationship, a target object having an influence relationship with the software package to be analyzed is determined, where the influence relationship means that the target object will affect the operation of the software package to be analyzed.
[0079] The target object may include one or more of dependent software packages, software, and test items, such as performance testing, stability testing, etc.
[0080] Here, according to the software package to be analyzed and the preset influence relationship, all objects that may affect the operation of the software package to be analyzed may be determined as target objects, so that relatively comprehensive objects may be determined, thereby improving the accuracy of subsequent abnormality positioning.
[0081] The preset influence relationships are introduced below.
[0082] In the first case, the preset impact relationship includes code dependency.
[0083] Here, code dependencies refer to other software packages required by a software package when it is compiled, run, or works normally. Code dependencies can be determined through the target fields of multiple software packages in the source code repository, such as requests. The target field is used to indicate the software packages that a software package depends on in code.
[0084] For example, based on the extraction results of the target fields in the multiple software packages, the software packages that the multiple software packages depend on in code are determined, and then, based on the software packages that the multiple software packages depend on in code, the software package dependencies are sorted to obtain multiple code dependencies with different influence strengths. In other words, the code dependency may include multiple code dependencies with different influence strengths.
[0085] In this way, the dependencies between massive software packages can be automatically analyzed to efficiently determine a variety of code dependencies with different strengths of impact relationships among multiple software packages.
[0086] In the second case, the preset influence relationship includes the experience influence relationship.
[0087] The empirical influence relationship is determined by the influence relationship between multiple software packages input by the user.
[0088] In practical applications, for each software package, the object having an experience influence relationship with the software package may be other objects such as software, test items, etc. In addition, the experience influence relationship may include multiple experience influence relationships with different strengths.
[0089] Here, users refer to developers. In this way, the developers' accumulated understanding of the impact relationships between software packages can be converted into a variety of storable empirical impact relationships with different strengths. This can not only ensure the accuracy of the empirical impact relationships, but also reduce the impact of changes in R&D personnel on anomaly location.
[0090] In the third case, the preset influence relationships include code dependency relationships and experience influence relationships.
[0091] When the code dependency includes multiple code dependency relationships with different influence strengths, and the experience influence relationship includes multiple experience influence relationships with different influence strengths, for each software package in the multiple software packages, the first object and the second object with the same influence strength corresponding to the software package can be merged to obtain objects of multiple influence levels of the software package, wherein the first object has a code dependency relationship with the software package having a corresponding influence strength, and the second object has an experience dependency relationship with the software package having a corresponding influence strength.
[0092] In this way, by combining the code dependencies between software packages and the experience influence relationships accumulated by developers over the years, a preset influence relationship can be formed, which can obtain a more comprehensive and accurate influence relationship. A more comprehensive and accurate influence relationship can better provide guidance for anomaly location and greatly improve the accuracy of anomaly location.
[0093] In step 403, a target operation is performed based on the software package to be analyzed and the target object.
[0094] Among them, the target object is such as anomaly positioning.
[0095] In some embodiments, the target object includes multiple objects, and these multiple objects are divided into multiple levels according to the strength of the influence relationship with the software package to be analyzed. Then, when no anomaly is located in the software package to be analyzed, the anomaly of these multiple objects can be located layer by layer according to the rule of influence relationship from strong to weak.
[0096] In this way, exception location is performed layer by layer, which complies with the exception nesting logic and can improve the efficiency of exception location.
[0097] In the embodiment of the present application, after determining that the software package to be analyzed has an abnormality, the target object that will affect the operation of the software package to be analyzed is determined according to the preset influence relationship, and then the abnormality of the target object is located. In this way, with the help of the preset influence relationship, the target object that will affect the operation of the software package to be analyzed can be quickly found and the abnormality can be located, without manually determining the target object, so the efficiency of abnormality location can be improved.
[0098] The following is an introduction to the solution of the embodiment of the present application by taking the analysis of the Linux operating system as an example.
[0099] See also Figure 5 , Figure 5 A schematic diagram of a software analysis process provided for an embodiment of the present application, wherein the source code of all software packages of the Linux operating system is stored in the source code warehouse, and the dependency analyzer can scan the source code of each software package in the source code warehouse, extract the field value of the requests field from the source code (the field value is the package name of the software package that this software package depends on), thereby determining the software package that this software package depends on in code, and then, based on the software packages that each software package depends on in code, sort the software package dependencies to obtain a dependency network between the software packages, and the dependency network stores a variety of code dependencies with different influence strengths. Based on the dependency network between the software packages, a first dependency table and a second dependency table can be generated, the first dependency table is used to store objects of different levels that each software package will affect, and the second dependency table is used to store objects of different levels that will affect each software package. Considering that the dependencies will change in the future, the first dependency table and the second dependency table can also be updated regularly.
[0100] In addition, developers can enter objects of different levels that each software package will affect according to certain format requirements based on their own experience to obtain an experience dependency table.
[0101] Afterwards, the impact range list generator may merge and remove duplicate objects at the same level in the first dependency table and the experience dependency table to obtain an impact object table, and use the second dependency table as an impact source table.
[0102] Subsequently, the affected object table can be imported into the test platform to guide the test, and the affected source table can also be introduced into the anomaly location tool to guide anomaly location.
[0103] The above process is introduced below with examples.
[0104] First, the process of generating the impact object table and the impact source table is introduced with examples.
[0105] Assume that the dependency network obtained by scanning the software package is as follows Figure 6 As shown, in Figure 6 In the example, package B depends on package A in code, and is depended on by packages C and D. Package E depends on package C in code.
[0106] Assume that the code dependencies are divided into two levels: direct dependency L1 and indirect dependency L2 (only one other software package in between). Then, according to Figure 6 The dependency network shown in the figure can generate the first dependency table as shown in Table 1. Similarly, assuming that the experience influence relationship is divided into two levels: direct influence relationship M1 and indirect influence relationship M2 (only through another software package in the middle). Then, according to Figure 6 The dependency network shown in FIG. 1 and FIG. 2 shows, the second dependency table generated can be shown in Table 2. In Table 1 and Table 2, there is no intersection between different columns of each row, that is, a software package can only exist in one dependency level or impact level of another software package.
[0107] Table 1
[0108] Package Name L1 L2 B C.D E C E -
[0109] Table 2
[0110] Package Name M1 M2 B A - C B A
[0111] Assuming that the empirical dependency table is as shown in Table 3, for the data in a row, there is no intersection between different levels, that is, an impact object can only exist in one impact range level of another software package.
[0112] Table 3
[0113] Package Name L1 L2 B E performance C File System F
[0114] The impact scope list generator takes the union of each object corresponding to L1 for the first dependency table and the experience dependency table to form an L1-level object, and then takes the union of each object corresponding to L2, deletes the determined L1-level objects from the union, and obtains the L2-level objects. The final impact object table is shown in Figure 4. The second dependency table is directly used as the impact source table. For the data in a certain row, there is no intersection between different levels, that is, an impact object can only exist in an impact scope level of another software package.
[0115] Table 4
[0116] Package Name L1 L2 B C, D, E performance C E. File system F
[0117] Next, the test process after the impact object table is introduced into the test platform is introduced.
[0118] See also Figure 7 , Figure 7 A schematic diagram of a software testing process provided by an embodiment of the present application. Assuming that the code of software package B is modified, in order to test whether the code modification will cause anomalies, the tester can choose which test granularity to perform on software package B through the test platform. If L1 is selected, the L1-level objects of software package B can be queried to obtain software packages C, D, and E, and then the test cases of software packages B, C, D, and E are selected, and these test cases are executed to obtain the test results and output; and if L2 is selected, the L2-level objects of software package B can be queried to obtain software packages C, D, E and performance, and then the test cases of software packages B, C, D, and E, as well as the test cases of performance-specific tests, are selected, and the test results are obtained and output.
[0119] Finally, the anomaly location process after introducing the impact source table into the location tool is introduced.
[0120] See also Figure 8 , Figure 8 A schematic diagram of an exception location process provided by an embodiment of the present application. When an exception occurs during the execution of a code segment, the software package to which the code segment belongs can be determined. Assuming it is software package B, the code of software package B can be checked. If the cause of the exception is found, the problem point causing the exception can be locked. If the cause of the exception is not found, the objects of different levels corresponding to software package B can be determined according to the impact source table, and then the problem points of the objects of different levels corresponding to software package B can be checked level by level, thereby locking the problem point causing the exception. Generally, for objects of different levels corresponding to software package B, the objects with the most recent code changes can be checked first. If the problem is not found, other objects can be checked in order from small to large levels.
[0121] It should be noted that the above is an introduction based on the application of the method of the embodiment of the present application to the Linux operating system. In fact, the method of the embodiment of the present application can also be applied to other scenarios, and other scenarios are introduced as examples below.
[0122] 1. Internal software development.
[0123] When an enterprise develops its own software, it can optimize the testing process and improve the efficiency of anomaly location by using the method of the embodiment of the present application.
[0124] 2. Continuous Integration (CI) / Continuous Delivery (CD) process.
[0125] In an automated CI / CD process, after submitting a software version and before deploying the software, the method of the embodiment of the present application can be used for testing to quickly identify potential problems caused by code changes, thereby shortening the development to deployment cycle.
[0126] 3. Cloud services and microservices architecture.
[0127] In cloud services or systems based on microservice architecture, the dependencies between software packages and the interactions between services are more complex. The method of the embodiment of the present application can also optimize the testing process and the exception location process.
[0128] 4. Internet of Things (IoT) device management.
[0129] IoT devices usually require remote updates and maintenance. For each software package corresponding to the device firmware, the method of the embodiment of the present application can also optimize the testing process and abnormal location process during the device firmware update process.
[0130] 5. Big data analysis platform.
[0131] When processing large amounts of data and complex analysis tasks, the method of the embodiments of the present application can help determine the dependencies between software packages corresponding to each link in the data processing flow and quickly locate anomalies when they occur.
[0132] 6. Security vulnerability management.
[0133] For identified security vulnerabilities, the method of the embodiment of the present application can be used to quickly determine the scope of the affected software packages and accelerate the abnormality location and repair process.
[0134] The beneficial effects of the embodiments of the present application are as follows:
[0135] 1. Combining the code dependencies between software packages and the experience impact relationships between software packages accumulated by developers, a more accurate and comprehensive impact object table and impact source table are constructed. In addition, different levels of objects are constructed for each software package, with a more detailed division.
[0136] 2. When the impact object table is applied to the test process, limited and accurate impact objects can be quickly identified, which not only improves test efficiency but also avoids missing objects. In addition, different test granularities can be achieved by selecting the level. In this way, a coarser test granularity can be selected when resources and time are limited, and a finer test granularity can be selected when resources and time are sufficient, which provides better test flexibility.
[0137] 3. When the impact source table is applied to anomaly location, the object scope (i.e., potential fault area) can be quickly narrowed down, saving developers time in troubleshooting anomalies.
[0138] Based on the same technical concept, the embodiment of the present application also provides a software analysis device. The principle of solving the problem by the software analysis device is similar to that of the above-mentioned software analysis method. Therefore, the implementation of the software analysis device can refer to the implementation of the software analysis method, and the repeated parts will not be repeated.
[0139] Fig. 9 A schematic diagram of the structure of a software analysis device provided in an embodiment of the present application includes:
[0140] A first determining module 901 is used to determine a software package to be analyzed;
[0141] The second determining module 902 is used to determine a target object having an impact relationship with the software package to be analyzed according to the software package to be analyzed and a preset impact relationship; wherein the software package to be analyzed is a software package whose code has been modified, and the impact relationship means that the software package to be analyzed will affect the operation of the target object; or the software package to be analyzed is a software package with an abnormality, and the impact relationship means that the target object will affect the operation of the software package to be analyzed;
[0142] The processing module 903 is used to perform a target operation based on the software package to be analyzed and the target object.
[0143] In some embodiments, there are multiple objects that have an influence relationship with the software package to be analyzed, and the multiple objects are divided into multiple levels according to the strength of the influence relationship with the software package to be analyzed;
[0144] When the software package to be analyzed is a software package whose code has been modified, the first determining module 901 is further used to obtain the analysis level requirement for the software package to be analyzed;
[0145] The first determination module 901 is specifically configured to determine the objects in the first N layers matching the analysis level requirement as the target objects according to the software package to be analyzed and the preset influence relationship, where N is a positive integer greater than zero.
[0146] In some embodiments, the target object includes one or more of a dependent software package, software, and a test project.
[0147] In some embodiments, the preset influence relationship includes a code dependency relationship and / or an empirical influence relationship. The code dependency relationship is determined by target fields of multiple software packages in a source code repository, and the target field is used to indicate the software packages that a software package depends on in code; the empirical influence relationship is determined by the influence relationship between the multiple software packages input by a user.
[0148] In some embodiments, the code dependency relationship includes a plurality of code dependency relationships with different influence strengths, and the experience influence relationship includes a plurality of experience influence relationships with different influence strengths.
[0149] In some embodiments, when the software package to be analyzed is a software package whose code has been modified, if the preset influence relationship includes a code dependency relationship and an experience influence relationship, then:
[0150] For each of the multiple software packages, a first object and a second object having the same impact relationship strength corresponding to the software package are merged to obtain objects of multiple impact levels of the software package, wherein the first object has a code dependency relationship with the software package having the impact relationship strength, and the second object has an experience dependency relationship with the software package having the impact relationship strength.
[0151] In some embodiments, the multiple code dependencies with different influence strengths are determined according to the following steps:
[0152] Determining, according to the extraction results of the target fields in the multiple software packages, software packages that the multiple software packages depend on in terms of code;
[0153] Based on the software packages that the multiple software packages depend on in code, the software package dependencies are sorted to obtain a plurality of code dependencies with different influence strengths.
[0154] In some embodiments, the software package to be analyzed is a software package whose code has been modified, and the processing module 903 is specifically used to:
[0155] Obtain the software package to be analyzed and the test case corresponding to the target object;
[0156] Run the test case.
[0157] In some embodiments, the software package to be analyzed is an abnormal software package, the target object includes multiple objects, and the multiple objects are divided into multiple levels according to the strength of the influence relationship with the software package to be analyzed. The processing module 903 is specifically used to:
[0158] When no anomaly is located in the software package to be analyzed, the anomaly is located for the multiple objects layer by layer according to the rule of influence relationship from strong to weak.
[0159] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, the functional modules in the embodiments of the present application may be integrated in a processor, or may exist physically separately, or two or more modules may be integrated in one module. The coupling between the modules may be achieved through some interfaces, which are usually electrical communication interfaces, but it is not excluded that they may be mechanical interfaces or other forms of interfaces. Therefore, the modules described as separate components may or may not be physically separated, and may be located in one place or distributed to different locations of the same or different devices. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0160] After introducing the software analysis method and device according to the exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.
[0161] Refer to the following Fig.10 The electronic device 100 implemented according to this embodiment of the present application is described below. The electronic device 100 may be a server 10 or a test device 20. Fig.10 The electronic device 100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0162] like Fig.10 As shown, the electronic device 100 is in the form of a general electronic device. The components of the electronic device 100 may include but are not limited to: at least one processor 101, at least one memory 102, and a bus 103 connecting different system components (including the memory 102 and the processor 101).
[0163] Bus 103 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, and a processor or local bus using any of a variety of bus architectures.
[0164] The memory 102 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1021 and / or a cache memory 1022 , and may further include a read-only memory (ROM) 1023 .
[0165] Memory 102 may also include a program / utility 1025 having a set (at least one) of program modules 1024, such program modules 1024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0166] The electronic device 100 may also communicate with one or more external devices 104 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 100, and / or communicate with any device that enables the electronic device 100 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 105. Furthermore, the electronic device 100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 106. As shown, the network adapter 106 communicates with other modules for the electronic device 100 via a bus 103. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0167] In an exemplary embodiment, a storage medium is also provided, and when the computer program in the storage medium is executed by a processor of an electronic device, the electronic device can perform the above-mentioned software analysis method. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0168] In an exemplary embodiment, the electronic device of the present application may include at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor may execute the steps of any software analysis method provided in the embodiments of the present application.
[0169] In an exemplary embodiment, a computer program product is also provided. When the computer program product is executed by an electronic device, the electronic device can implement any exemplary method provided in the present application.
[0170] Furthermore, the computer program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0171] The program product for software analysis in the embodiment of the present application may adopt a CD-ROM and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0172] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0173] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0174] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network such as a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0175] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0176] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0177] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0178] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0179] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0181] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0182] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application also includes these modifications and variations.
Claims
1. A software analysis method, characterized in that: include: Identify the software packages to be analyzed; According to the software package to be analyzed and the preset influence relationship, a target object having an influence relationship with the software package to be analyzed is determined; wherein, The software package to be analyzed is a software package whose code has been modified, and the impact relationship means that the software package to be analyzed will affect the operation of the target object; or The software package to be analyzed is a software package that has an abnormality, and the impact relationship means that the target object will affect the operation of the software package to be analyzed; A target operation is performed based on the software package to be analyzed and the target object.
2. The method according to claim 1, characterized in that There are multiple objects that have an influence relationship with the software package to be analyzed, and the multiple objects are divided into multiple levels according to the strength of the influence relationship with the software package to be analyzed; When the software package to be analyzed is a software package whose code has been modified, the following further includes: Obtaining the analysis level requirement for the software package to be analyzed; Determining a target object having an influence relationship with the software package to be analyzed according to the software package to be analyzed and a preset influence relationship includes: According to the software package to be analyzed and the preset influence relationship, the objects in the first N layers matching the analysis level requirement are determined as the target objects, where N is a positive integer greater than zero.
3. The method according to claim 1, characterized in that The target object includes one or more of a dependent software package, software, and a test project.
4. The method according to claim 1, characterized in that The preset influence relationship includes a code dependency relationship and / or an experience influence relationship, wherein the code dependency relationship is determined by target fields of multiple software packages in a source code repository, wherein the target field is used to indicate a software package that a software package depends on in terms of code; The empirical influence relationship is determined by the influence relationship among the multiple software packages input by the user.
5. The method according to claim 4, characterized in that The code dependency relationship includes a plurality of code dependency relationships with different influence strengths, and the experience influence relationship includes a plurality of experience influence relationships with different influence strengths.
6. The method according to claim 5, characterized in that When the software package to be analyzed is a software package whose code has been modified, if the preset influence relationship includes a code dependency relationship and an experience influence relationship, the following further includes: For each of the multiple software packages, a first object and a second object having the same impact relationship strength corresponding to the software package are merged to obtain objects of multiple impact levels of the software package, wherein the first object has a code dependency relationship with the software package having the impact relationship strength, and the second object has an experience dependency relationship with the software package having the impact relationship strength.
7. The method according to claim 5, characterized in that Determine the multiple code dependencies with different impact strengths according to the following steps: Determining, according to the extraction results of the target fields in the multiple software packages, software packages that the multiple software packages depend on in terms of code; Based on the software packages that the multiple software packages depend on in code, the software package dependencies are sorted to obtain a plurality of code dependencies with different influence strengths.
8. The method according to claim 1, characterized in that The software package to be analyzed is a software package whose code has been modified. Based on the software package to be analyzed and the target object, a target operation is performed, including: Obtain the software package to be analyzed and the test case corresponding to the target object; Run the test case.
9. The method according to claim 1, characterized in that The software package to be analyzed is a software package that has an abnormality, and the target object includes a plurality of objects, and the plurality of objects are divided into a plurality of levels according to the strength of the influence relationship with the software package to be analyzed; Based on the software package to be analyzed and the target object, a target operation is performed, including: When no anomaly is located in the software package to be analyzed, the anomaly is located for the multiple objects layer by layer according to the rule of influence relationship from strong to weak.
10. An electronic device, characterized in that: include: at least one processor, and a memory communicatively connected to the at least one processor, wherein: The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and system of regression testing
CN103176895A
A method and apparatus for locate software defects
CN109308262A
Software modification performance test method, system and equipment and storage medium
CN116225952A
Cited By
TBOX integrated vehicle-mounted anomaly detection early warning method and system
CN120215472A