An intelligent use case recommendation method and system based on link blood relationship

Through the intelligent use case recommendation method based on link blood ties, the software code calls link dynamically, the key code segments are determined and the test cases are recommended, which solves the problem of repeated test cases and heavy workload after system upgrade and transformation under the microservice architecture, and achieves efficient and reliable test case recommendations.

CN119396741BActive Publication Date: 2025-07-01HANGYIN CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411989934.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-07-01
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Under the microservice architecture, after the system is upgraded and transformation, the old test cases are abandoned and the test cases under the new architecture need to be re-recorded, resulting in a large workload and time-consuming and labor-intensive, and the difficulty of testing cases design and the demand for covering scenarios has increased exponentially.

Method used

Based on the intelligent use case recommendation method of link blood relationship, we analyze the software code calling link, determine the key code segment and its type, combine the changing data of the code segment, dynamically recommend test cases, and use link blood relationship data and call data to recommend test cases.

Benefits of technology

It realizes accurate evaluation and efficient recommendation of test cases, avoids insufficient stability of test cases, ensures the reliability and efficiency of test processing, and reduces the workload of manual recording.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396741B_ABST
    Figure CN119396741B_ABST
Patent Text Reader

Abstract

The present invention provides an intelligent test case recommendation method and system based on link blood relationship, belonging to the technical field of data management. Specifically, it includes: determining the types of different key code segments according to the functions of the key code segments; when determining that the change processing of test cases needs to be performed based on the code change data of key code segments of different types, taking the code segments with code changes as the changed code segments; determining the matching test cases in the test cases based on the call data of the changed code segments and the key code segments in the changed code segments; determining the link blood relationship data between different matching test cases based on the call data of the test cases; and using the link blood relationship data and the call data of the code segments to determine the recommendation processing result of the test cases for the software code, and modifying the recommendation processing result to perform the recommendation processing of the test cases for the software code, thereby improving the reliability of the test analysis and processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data management, and particularly relates to an intelligent use case recommendation method and system based on link lineage. Background Art

[0002] While the microservices architecture obtains advantages such as greater flexibility and scalability of the system, it increases the complexity between systems. This makes the difficulty of designing corresponding test cases and the number of test cases required to cover scenarios increase exponentially, consuming a lot of time and effort. At the same time, after the system is upgraded and refactored, old test cases are discarded due to link differences, parameter differences, etc., and new test cases under the new architecture need to be re-recorded. When the data volume reaches a certain level, the workload cannot be ignored.

[0003] In view of the above technical problems, for the system upgrade and transformation scenario under the microservices architecture, the present application provides a new link intelligent use case recommendation system, which can dynamically recommend and update use cases without manual recording. Specifically, the present invention provides an intelligent use case recommendation method and system based on link lineage. Summary of the Invention

[0004] To achieve the object of the present invention, the present invention adopts the following technical solutions:

[0005] According to one aspect of the present invention, an intelligent use case recommendation method based on link lineage is provided.

[0006] An intelligent use case recommendation method based on link lineage specifically includes:

[0007] S1 Based on the analysis result of the call link of software code, determine the historical call data of different code segments in different business processes, and determine the key code segments in the code segments in combination with the link association relationship between the code segments and other code segments;

[0008] S2 Determine the types of different key code segments according to the functions of the key code segments. When it is determined that the change data of different types of key code segments requires test case change processing, proceed to the next step;

[0009] S3 Use the code segment where the code has changed as the changed code segment, and determine the matching test cases in the test cases based on the call data of the changed code segment and the key code segments in the changed code segment;

[0010] S4 Based on the call data of the test cases, determine the link lineage data between different matching test cases, and use the link lineage data and the call data of the code segments to determine the recommendation processing result of the test cases of the software code, and modify the recommendation processing result and then perform the recommendation processing of the test cases of the software code.

[0011] The beneficial effects of the present invention are as follows:

[0012] Based on the code change data of different types of key code segments, it is determined whether it is necessary to perform change processing on test cases, thereby realizing an accurate evaluation of the adaptation situation of test cases from the code change situation of key code segments. This not only avoids the technical problem of insufficient stability of test cases caused by frequent modification of test cases, but also ensures accurate test analysis when software code changes by further combining the code change situation of key code segments.

[0013] By using link blood relationship data and call data of code segments, the determination result of the recommended processing of test cases for software code is obtained. This not only takes into account the difference in the degree of duplication between test cases due to the difference in link blood relationship, but also considers the difference in the test matching situation of test cases due to the difference in call data of code segments, realizing the determination of the recommended processing result of test cases for software code from multiple perspectives, ensuring both the efficiency of test processing and the reliability of test processing.

[0014] A further technical solution lies in that the analysis result of the call link is determined according to the call link of software code in the call process of the business process.

[0015] A further technical solution lies in that the historical call data of the code segment in different business processes includes the historical call times in different business processes.

[0016] A further technical solution lies in that the method for determining the key code segment in the code segment is as follows:

[0017] Based on the historical call data of the code segment in different business processes, determine the business processes in which the call situation of the code segment exists, and use it as the matching business process;

[0018] According to the historical call data in different matching business processes, determine other code segments that have link associations in different matching business processes, and use them as associated code segments;

[0019] Based on the total number of associated code segments in the matching business process, determine whether the code segment is a key code segment.

[0020] A further technical solution lies in that when the total number of associated code segments in the matching business process is greater than the preset code segment number threshold, it is determined that the code segment is a key code segment.

[0021] A further technical solution lies in that the method for determining the key code segment in the code segment is as follows:

[0022] Determine the business processes in which the code segments are called based on the historical call data of the code segments in different business processes, and use them as matching business processes;

[0023] Determine other code segments with link associations in different matching business processes based on the historical call data in different matching business processes, and use them as associated code segments, and determine the screening business processes in the matching business processes based on the number of associated code segments;

[0024] Determine whether the code segment is a critical code segment based on the number of the screening business processes.

[0025] A further technical solution lies in that the screening business process is a business process in which the number of associated code segments is within a preset code segment number range. A further technical solution lies in that the recommended processing result is modified and then the recommended processing of the test cases of the software code is performed, specifically including:

[0026] Automatically modify the recommended processing result according to the change data of the code segment to obtain a modified result;

[0027] Perform the recommended processing of the test cases of the software code on the modified result.

[0028] In a second aspect, the present invention provides a computer system, including: a memory and a processor connected by communication, and a computer program stored on the memory and capable of running on the processor, and when the processor runs the computer program, it executes the above-mentioned intelligent use case recommendation method based on link blood relationship.

[0029] Other features and advantages will be described in the subsequent description, and the purpose and other advantages of the present invention are realized and obtained by the structure specifically pointed out in the description and the drawings.

[0030] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, the following specifically gives preferred embodiments and, in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings

[0031] By referring to the accompanying drawings and describing its exemplary embodiments in detail, the above and other features and advantages of the present invention will become more obvious.

[0032] Figure 1 is a flowchart of an intelligent use case recommendation method based on link blood relationship;

[0033] Figure 2 is a flowchart of a method for determining critical code segments in code segments;

[0034] Figure 3It is a flowchart for determining whether change processing of test cases is required;

[0035] Figure 4 It is a flowchart of a method for determining matching test cases in test cases;

[0036] Figure 5 It is a framework diagram of a computer system. Detailed implementation manners

[0037] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this specification.

[0038] While the microservice architecture obtains advantages such as greater flexibility and scalability of the system, it increases the complexity between systems. As a result, the difficulty of designing corresponding test cases and the number of test cases required to cover scenarios show an exponential growth, which is time-consuming and laborious.

[0039] After the system is upgraded and refactored, the old test cases are discarded due to differences in links, parameters, etc. At the same time, new test cases under the new architecture need to be re-recorded. When the data volume reaches a certain level, the workload cannot be ignored. Therefore, for the system upgrade and transformation scenario under the microservice architecture, a new type of link intelligent use case recommendation system needs to be provided, which can recommend and update use cases dynamically without manual recording.

[0040] The present invention dynamically generates and recommends test cases based on link blood relationship, code coloring, and intelligent recommendation. Its core principles and functions are as follows:

[0041] Analysis of the execution path of the code link:

[0042] By capturing the information during software operation, deeply analyzing and recording the code call link structure, constructing a function call graph, a module dependency graph, etc., so as to clarify the positions and functions of each function, module, and custom transaction code in the business process.

[0043] Application of code coloring technology:

[0044] Color and mark the code according to the business logic or specific requirements. For example, highlight the code segments involving key paths such as important transaction processing, risk control, and exception handling, so as to intuitively identify the test key points.

[0045] Analysis of dynamic blood relationship:

[0046] Combined with the code link information, dynamically analyze the lineage relationship between test cases at different levels (such as function level, module level, and custom transaction code level) to form a complete test case impact scope map.

[0047] Data cleaning and noise reduction:

[0048] Use machine learning algorithms to preprocess a large amount of runtime data collected, eliminate irrelevant noise data, extract useful features, and optimize the lineage relationship network to ensure the accuracy of subsequent recommendations.

[0049] Intelligent test case recommendation:

[0050] Based on the above analysis results and the optimized lineage relationship data, use intelligent algorithm models to recommend test cases. When the code changes or a new transaction code is added, the system can quickly locate the affected links and generate corresponding test case suggestions.

[0051] Visualization display and interaction:

[0052] Visualize the intelligent recommended test cases and their lineage characteristics in the form of charts, which is convenient for testers to understand and evaluate the effectiveness and coverage of the recommended cases. At the same time, provide a friendly user interface to support interactive adjustment and optimization of test strategies.

[0053] Key code segments in the code segment: Take the business process with calls to the code segment as the called business process, determine the key coefficient of the code segment according to the proportion of the number of called business processes, and take the code segment with a key coefficient greater than 0.6 as the key code segment.

[0054] Determine the need for test case change processing: Use the proportion of the number of key code segments with code changes in the key code segments to determine whether test case change processing is required. Specifically, if the proportion is greater than 0.4, it is determined that test case change processing is required.

[0055] Matching test cases in test cases: Use the proportion of the number of calls to the changed code segment in the test cases to determine the matching coefficient of the test cases, and take the test cases with a matching coefficient greater than 0.6 as the matching test cases.

[0056] Determine the recommended processing result of the test case for software code: Take the matching test cases that have no link lineage relationship with other test cases and have a relatively large matching coefficient as the recommended processing result of the test case for software code.

[0057] Embodiment 1 To solve the above problems, according to one aspect of the present invention, as Figure 1 shown, provide an intelligent test case recommendation method based on link lineage, specifically including:

[0058] S1 determines the historical call data of different code segments in different business processes based on the analysis result of the call link of the software code, and determines the key code segments in the code segments in combination with the link association relationship between the code segments and other code segments;

[0059] S2 determines the types of different key code segments according to the functions of the key code segments. When it is determined that the change processing of test cases is required based on the code change data of different types of key code segments, proceed to the next step;

[0060] S3 takes the code segment with code changes as the changed code segment, and determines the matching test cases in the test cases based on the call data of the changed code segment and the key code segments in the changed code segment;

[0061] S4 determines the link blood relationship data between different matching test cases based on the call data of the test cases, and determines the recommended processing result of the test cases of the software code by using the link blood relationship data and the call data of the code segments, and modifies the recommended processing result and then performs the recommended processing of the test cases of the software code.

[0062] Further, the analysis result of the call link is determined according to the call link of the software code in the call process of the business process.

[0063] Specifically, the historical call data of the code segments in different business processes includes the historical call times in different business processes.

[0064] It should be noted that as Figure 2 shown, the method for determining the key code segments in the code segments is as follows:

[0065] Determine the business processes where the call situation of the code segment exists based on the historical call data of the code segment in different business processes, and use it as the matching business process;

[0066] Determine other code segments with link associations in different matching business processes based on the historical call data in different matching business processes, and use them as associated code segments;

[0067] Determine whether the code segment is a key code segment based on the total number of associated code segments in the matching business process.

[0068] It can be understood that when the total number of associated code segments in the matching business process is greater than the preset code segment quantity threshold, it is determined that the code segment is a key code segment. Additionally, it should be noted that the method for determining the key code segments in the code segments is as follows:

[0069] Determine the business processes where the call situation of the code segment exists based on the historical call data of the code segment in different business processes, and use them as matching business processes;

[0070] Determine other code segments with link associations in different matching business processes based on the historical call data in different matching business processes, and use them as associated code segments, and determine the filtered business processes in the matching business processes based on the number of associated code segments;

[0071] Determine whether the code segment is a critical code segment based on the number of the filtered business processes.

[0072] Furthermore, the filtered business process is a business process where the number of associated code segments is within a preset code segment number range.

[0073] It can be understood that when the number of the filtered business processes corresponding to the code segment is greater than the preset process number, it is determined that the code segment is a critical code segment.

[0074] Optionally, the method for determining the critical code segment in the code segment is as follows:

[0075] S11 Determine the business processes where the call situation of the code segment exists based on the historical call data of the code segment in different business processes, and use them as matching business processes. Determine other code segments with link associations in different matching business processes based on the different historical call data, and use them as associated code segments;

[0076] S12 Obtain the number of associated code segments and the link association relationships between the different associated code segments and the code segment in the matching business processes, and determine the correlation coefficients of the different matching business processes in combination with the proportion of the call times of the code segment in the execution process of the matching business processes;

[0077] S13 Determine the weight coefficients of the different matching business processes based on the execution data of the different matching business processes, and determine the influence correlation coefficient of the code segment in combination with the correlation coefficients of the different matching business processes. Determine whether the code segment is a critical code segment based on the influence correlation coefficient.

[0078] Optionally, the following content is included in the above step S11:

[0079] S111 Determine the business processes where the call situation of the code segment exists based on the historical call data of the code segment in different business processes, and use them as matching business processes. When the number of the matching business processes is greater than the preset business process number, go to step S112. When the number of the matching business processes is not greater than the preset business process number, go to step S113;

[0080] S112 determines other code segments with link associations in different matching business processes according to different historical call data, and uses them as associated code segments. Based on the number of associated code segments in different matching business processes, the total number of associated code segments is determined. When the total number of the associated code segments is greater than a preset associated quantity threshold, it is determined that the code segment is a key code segment. When the total number of the associated code segments is not greater than the preset associated quantity threshold, step S113 is entered;

[0081] S113 Based on the number of associated code segments in different matching business processes, when the number of matching business processes where the number of associated code segments is greater than a preset code segment quantity threshold does not meet the requirements, it is determined that the code segment is a key code segment. When the number of matching business processes where the number of associated code segments is greater than the preset code segment quantity threshold meets the requirements, step S12 is entered.

[0082] Optionally, the following content is included in the above step S12:

[0083] S121 Obtain the number of associated code segments and the link association relationships between different associated code segments and the code segment in the matching business process, and determine the correlation coefficients of different matching business processes by combining the call ratio of the code segment during the execution of the matching business process. When the correlation coefficients of different matching business processes are all less than a preset correlation coefficient threshold, step S122 is entered. When there are matching business processes with correlation coefficients not less than the preset correlation coefficient threshold, step S123 is entered;

[0084] S122 When the number of the matching business processes and the number of the associated code segments are both within a preset quantity range, it is determined that the code segment does not belong to the key code segment. When any one of the number of the matching business processes and the number of the associated code segments is not within the preset quantity range, step S123 is entered;

[0085] S123 When the number of matching business processes with correlation coefficients not less than the preset correlation coefficient threshold is greater than a preset matching process quantity threshold, it is determined that the code segment does not belong to the key code segment. When the number of matching business processes with correlation coefficients not less than the preset correlation coefficient threshold is not greater than the preset matching process quantity threshold, step S13 is entered.

[0086] Further, the types of the key code segments include transaction processing, risk control, and exception handling.

[0087] Specifically, as Figure 3 shown, determining whether change processing of test cases is required specifically includes:

[0088] Determine the proportion of the number of changes in critical code segments of different types based on the code change data of critical code segments of different types;

[0089] Determine the change coefficient of critical code segments of different types based on the proportion;

[0090] Determine the change type in critical code segments of different types based on the change coefficient, and use the number of the change type to determine whether to perform change processing on test cases.

[0091] Furthermore, the change type in the critical code segment is the type with a change coefficient greater than a preset change coefficient.

[0092] It should be noted that when the number of the change type is greater than a preset change type number threshold, it is determined that change processing on test cases needs to be performed.

[0093] Optionally, determining whether to perform change processing on test cases specifically includes:

[0094] Determine the code change situation of critical code segments of different types based on the code change data of critical code segments of different types; determine the critical code segments with changes in critical code segments of different types based on the code change situation;

[0095] Use the number of the critical code segments with changes to determine whether to perform change processing on test cases.

[0096] It should be noted that the critical code segments with changes are the critical code segments with a code change proportion greater than a preset code change proportion.

[0097] Optionally, determining whether to perform change processing on test cases specifically includes:

[0098] S21 Determine the critical code segments with code changes in different types based on the code change data of critical code segments of different types, and determine the code change coefficient of different critical code segments by using the code change amount and the code change proportion of different critical code segments;

[0099] S22 Obtain the proportion of the number of code changes in critical code segments of different types, and determine the code segment change coefficient of different types by combining the code change coefficients of different critical code segments in different types;

[0100] S23 Determine the change weight coefficient of critical code segments of different types, and determine the comprehensive change coefficient by combining the code segment change coefficients of different types, and use the comprehensive change coefficient to determine whether to perform change processing on test cases.

[0101] It should be noted that the change weight coefficients of the different types of key code segments are determined according to the functions of the different types of key code segments in the software code.

[0102] Furthermore, when the comprehensive change coefficient does not meet the requirements, it is determined that the test cases need to be changed.

[0103] Optionally, the above step S21 includes the following content:

[0104] S211 determines the key code segments with code changes in different types based on the code change data of the different types of key code segments. When the number of key code segments with code changes does not meet the requirements, it is determined that the test cases need to be changed. When the number of key code segments with code changes meets the requirements, it proceeds to step S212;

[0105] S212 determines the code change coefficients of the different key code segments using the code change amounts and the proportions of the code change amounts of the different key code segments. When there are key code segments with code change coefficients greater than the preset change coefficient threshold, it proceeds to step S213. When there are no key code segments with code change coefficients greater than the preset change coefficient threshold, it proceeds to step S22;

[0106] S213 takes the key code segments with code change coefficients greater than the preset change coefficient threshold as the screened change code segments. When the number of screened change code segments does not meet the requirements, it is determined that the test cases need to be changed. When the number of screened change code segments meets the requirements, it proceeds to step S214;

[0107] S214 determines the screening change coefficient using the code change coefficients of the different screened change code segments. When the screening change coefficient does not meet the requirements, it is determined that the test cases need to be changed. When the screening change coefficient meets the requirements, it proceeds to step S22. Optionally, the above step S22 includes the following content:

[0108] S221 obtains the proportion of the number of key code segments with code changes in different types. When there are types with the proportion of the number of code changes greater than the preset number proportion, it proceeds to step S223. When there are no types with the proportion of the number of code changes not greater than the preset number proportion, it proceeds to step S222;

[0109] S222 takes the types with the proportion of the number of code changes greater than the preset number proportion as the change types. When the number of the change types does not meet the requirements, it is determined that the test cases need to be changed. When the number of the change types meets the requirements, it proceeds to step S223;

[0110] S223 determines the change coefficients of different types of code segments based on the proportion of the number of code changes occurring in different types of key code segments and the code change coefficients of the key code segments. When there is a type with a code segment change coefficient not meeting the requirements, it is determined that the test cases need to be changed. When there is no type with a code segment change coefficient not meeting the requirements, it proceeds to step S224;

[0111] S224 determines the types of code segments whose change coefficients are within the preset change coefficient range based on the change coefficients of different types of code segments. When the number of types with code segment change coefficients within the preset change coefficient range is within the preset type number range, it is determined that the test cases need to be changed. When the number of types with code segment change coefficients within the preset change coefficient range is not within the preset type number range, it proceeds to step S23.

[0112] Specifically, as Figure 4 shown, the method for determining the matching test cases in the test cases is as follows:

[0113] Based on the call data of the changed code segments in the test cases, determine the changed code segments with calls in the test cases and use them as the call changed code segments;

[0114] Obtain the key code segments in the call changed code segments, and determine the key code quantity proportion based on the proportion of the key code segments in the call changed code segments in the key code segments;

[0115] Determine the changed code quantity proportion based on the proportion of the call changed code segments in the changed code segments, determine the use case matching coefficient based on the changed code quantity proportion and the key code quantity proportion, and determine whether the test case is a matching test case according to the use case matching coefficient.

[0116] Furthermore, the use case matching coefficient is determined based on the average value of the changed code quantity proportion and the key code quantity proportion.

[0117] In addition, it should be noted that determining whether the test case is a matching test case according to the use case matching coefficient specifically includes:

[0118] When the use case matching coefficient is greater than the preset matching coefficient threshold, it is determined that the test case is a matching test case. Furthermore, the link blood relationship data between the matching test cases includes the code segments where the call links between the matching test cases are associated and the similarity degree of the call relationships of the code segments.

[0119] Specifically, the method for determining the recommended processing result of the test cases of the software code is as follows:

[0120] Based on the key code segments in the call variation code segments and in combination with the call data of the code segments of the test cases, and based on all the key code segments being tested, divide the test cases into available use case groups;

[0121] Based on the analysis result of the link lineage data, determine the code segments where there is an association in the call link between the matching test case and other matching test cases in the available use case group, and use the code segments where the call link is associated to determine the correlation coefficient between the matching test case and other matching test cases in the available use case group;

[0122] By varying the call data of the variation code segments in the test cases, determine the variation code segments that are called in the test cases, and use them as call variation code segments to obtain the key code segments in the call variation code segments. Determine the key code quantity ratio based on the proportion of the key code segments in the call variation code segments among the key code segments, and determine the variation code quantity ratio based on the proportion of the call variation code segments among the variation code segments. Based on the variation code quantity ratio and the key code quantity ratio, determine the use case matching coefficient of the matching test case;

[0123] Based on the correlation coefficient between the matching test case and other matching test cases in the available use case group and the use case matching coefficient of the matching test case, determine the recommended matching coefficient of the available use case group, and use the recommended matching coefficient to determine the recommended processing result of the test cases for the software code.

[0124] Further, the recommended processing result of the test cases for the software code is the available use case group with the largest recommended matching coefficient.

[0125] In addition, it should be noted that when the recommended processing result is modified and then the recommended processing of the test cases for the software code is performed, it specifically includes:

[0126] Automatically modify the recommended processing result according to the variation data of the code segments to obtain the modification result;

[0127] Perform the recommended processing of the test cases for the software code on the modification result.

[0128] Embodiment 2 Second aspect, as Figure 5 shown, the present invention provides a computer system, including: a memory and a processor connected by communication, and a computer program stored on the memory and capable of running on the processor. When the processor runs the computer program, it executes the above-mentioned intelligent use case recommendation method based on link lineage.

[0129] Optionally, the method for determining the matching test cases in the test cases is:

[0130] Determine the changed code segments called in the test case based on the call data of the changed code segments in the test case, and use them as the called changed code segments. When the number of called changed code segments in the test case does not meet the requirements, it is determined that the test case does not belong to the matching test case;

[0131] When the number of called changed code segments in the test case meets the requirements:

[0132] Obtain the key code segments in the called changed code segments. When there are no key code segments in the called changed code segments, it is determined that the test case does not belong to the matching test case;

[0133] When there are key code segments in the called changed code segments:

[0134] Obtain the number of called changed code segments in the test case. When the number of called changed code segments in the test case is greater than the preset call number threshold, it is determined that the test case belongs to the matching test case;

[0135] When the number of called changed code segments in the test case is not greater than the preset call number threshold:

[0136] Based on the number of called changed code segments in the test case and the proportion of the number in the changed code segments, determine the change matching coefficient. When the change matching coefficient is greater than the preset matching coefficient threshold, it is determined that the test case belongs to the matching test case;

[0137] When the change matching coefficient is not greater than the preset matching coefficient threshold:

[0138] Obtain the key code segments in the called changed code segments. Determine the key code matching coefficient based on the number of key code segments in the called changed code segments and the proportion of the number in the key code segments. When the key code matching coefficient is greater than the preset coefficient threshold, it is determined that the test case belongs to the matching test case;

[0139] When the key code matching coefficient is not greater than the preset coefficient threshold:

[0140] Determine the use case matching coefficient based on the key code matching coefficient and the change matching coefficient, and determine whether the test case is a matching test case according to the use case matching coefficient.

[0141] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the embodiments of devices, apparatuses, and non-volatile computer storage media, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for relevant details.

[0142] The specific embodiments of this specification have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0143] The above description is only for one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various modifications and changes can be made to one or more embodiments of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of one or more embodiments of this specification shall be included within the scope of the claims of this specification.

Claims

1. An intelligent use case recommendation method based on link lineage, characterized in that: Specifically include: Based on the analysis results of the call link of the software code, determine the historical call data of different code segments in different business processes, and determine the key code segments in the code segments in combination with the link association relationship between the code segments and other code segments; Determine different types of key code segments according to their functions, and proceed to the next step when it is determined that test case changes need to be made based on code change data of different types of key code segments; The code segment in which the code is changed is taken as the changed code segment, and the calling data of the changed code segment and the key code segment in the changed code segment in different test cases are used to determine the matching test case in the test case; Based on the call data of the test case, link lineage data between different matching test cases are determined, and the link lineage data and the call data of the code segment are used to determine the recommended processing results of the test case of the software code, and the recommended processing of the test case of the software code is performed after modifying the recommended processing results; The method for determining the key code segment in the code segment is: Based on the historical call data of the code segment in different business processes, determine the business process in which the code segment is called, and use it as the matching business process; According to the historical call data in different matching business processes, other code segments associated with links in different matching business processes are determined, and used as associated code segments; When the total number of associated code segments of the matching business process is greater than a preset code segment number threshold, the code segment is determined to be a key code segment; The method for determining the matching test case in the test case is: Using the calling data of the variable code segment in the test case, determining that there is a called variable code segment in the test case, and using it as the called variable code segment; Obtaining the key code segments in the calling change code segment, and determining the key code quantity ratio according to the quantity ratio of the key code segments in the calling change code segment to the key code segments; Determine the proportion of the number of changed codes by the proportion of the number of called changed code segments in the number of changed code segments, determine the use case matching coefficient based on the proportion of the number of changed codes and the proportion of the number of key codes, and determine whether the test case is a matching test case according to the use case matching coefficient; The method for determining the recommended processing result of the test case of the software code is: Based on the key code segments in the calling change code segments, combined with the calling data of the code segments of the test cases, and based on the fact that all the key code segments are tested, the test cases are divided into available case groups; Based on the analysis result of the link lineage data, determine the code segments associated with the call links between the matching test case and other matching test cases in the available test case group, and use the code segments associated with the call links to determine the correlation coefficient between the matching test case and other matching test cases in the available test case group; Determine the called changed code segment in the test case through the calling data of the changed code segment in the test case, and use it as the called changed code segment to obtain the key code segment in the called changed code segment, determine the key code quantity ratio by the quantity ratio of the key code segments in the called changed code segment in the key code segment, determine the changed code quantity ratio by the quantity ratio of the called changed code segment in the changed code segment, and determine the case matching coefficient of the matching test case based on the changed code quantity ratio and the key code quantity ratio; Based on the correlation coefficient between the matching test case and other matching test cases in the available use case group and the use case matching coefficient of the matching test case, the recommended matching coefficient of the available use case group is determined, and the recommended processing result of the test case of the software code is the available use case group with the largest recommended matching coefficient.

2. The intelligent use case recommendation method based on link lineage as claimed in claim 1, characterized in that: The analysis result of the call link is determined according to the call link of the software code in the calling process of the business process.

3. The intelligent use case recommendation method based on link lineage as claimed in claim 1, characterized in that: The historical call data of the code segment in different business processes includes the historical call times in different business processes.

4. The intelligent use case recommendation method based on link lineage as claimed in claim 1, characterized in that: Determine whether the test case needs to be changed, including: Using the code change data of different types of key code segments, determine the percentage of key code segments that have changed in different types; Determine the coefficient of variation of key code segments in different types based on the quantity proportions; Based on the variation coefficient, the variation type in the key code segments of different types is determined, the variation type in the key code segments is the type with a variation coefficient greater than a preset variation coefficient, and the number of variation types is used to determine whether change processing of the test case is required.

5. The intelligent use case recommendation method based on link lineage as claimed in claim 4, characterized in that: When the number of the change types is greater than a preset change type number threshold, it is determined that a change process of the test case needs to be performed.

6. The intelligent use case recommendation method based on link lineage as claimed in claim 1, characterized in that: The recommended processing result is modified and then the recommended processing of the test case of the software code is performed, specifically including: Automatically modifying the recommended processing result according to the changed data of the code segment to obtain a modified result; The modification results are used for recommendation processing of test cases of the software code.

7. A computer system comprising: A memory and a processor in communication connection, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes a link lineage-based intelligent use case recommendation method as described in any one of claims 1-6 when running the computer program.

Citation Information

Patent Citations

  • Test case precise recommendation method, device and system, equipment and storage medium

    CN107515826A

  • Test case processing method and equipment

    CN115981987A