Test Method, System and Medium for Intelligent Analysis of Function Intervals

Through static function analysis and the establishment of the interface-function identification correlation library, the redundant test problem caused by uncertain test scope is solved, and accurate testing results are achieved.

CN115587033BActive Publication Date: 2025-08-05IND BANK CO +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211221375.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-08
Publication Date
2025-08-05
Estimated Expiration
2042-10-08

AI Technical Summary

Technical Problem

The prior art cannot determine the test range, resulting in a large number of redundant tests.

Method used

Obtain function identification information through static function analysis, establish an interface-function identification correlation library, combine function change intervals and interface coverage intervals, and recommend the influence interface list.

Benefits of technology

Accurate testing is realized, automatic analysis of the minimum impact range and reduce redundant testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115587033B_ABST
    Figure CN115587033B_ABST
Patent Text Reader

Abstract

This invention provides a testing method, system, and medium for intelligent function interval analysis. The method comprises the following steps: Step S1: Obtaining and storing function identification information through static function analysis; Step S2: Obtaining code line coverage interval information through interface training, and combining this with the function identification information to obtain the interface-function identification correlation; Step S3: Recommending a list of impacted interfaces based on the function change interval, interface coverage interval, and function correlation. This invention primarily addresses the current problem of testing unable to determine test scope, resulting in a large amount of redundant testing. During precision testing, the invention automatically establishes an interface-function identification correlation library. Through effective change interval analysis, it can automatically analyze the minimum impact range at the code line interval level and automatically perform interface convergence based on the function interval correlation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of function interval testing, and specifically to a testing method, system, and medium for intelligent analysis of function intervals, and more particularly to a precise testing method for intelligent analysis of function intervals. Background Art

[0002] Current testing work is unable to determine the test scope, resulting in a large amount of redundant testing; a software testing method using cross-function analysis is disclosed in the patent document with publication number CN101894064A. By defining function summary information and its pre-information, post-information, constraint information and feature information, a judgment method is correspondingly specified for different types of defect detection in the program; and during the software testing process, function summary information is collected and applied to the statement nodes of the control flow graph and in the defect pattern judgment process, and summary information of all functions in the tested program is output after the test is completed.

[0003] Therefore, it is necessary to propose a new technical solution to improve the above technical problems. Summary of the Invention

[0004] In view of the deficiencies in the prior art, the present invention aims to provide a testing method, system and medium for intelligent analysis of function intervals.

[0005] According to the present invention, a method for testing function interval intelligent analysis is provided, the method comprising the following steps:

[0006] Step S1: Obtain and store function identification information through static function analysis;

[0007] Step S2: Obtain code line coverage interval information through interface training, and combine it with function identification information to obtain the interface-function identification correlation degree;

[0008] Step S3: Recommend a list of affected interfaces based on the function change interval, interface coverage interval, and function correlation.

[0009] Preferably, step S1 includes the following steps:

[0010] Step S1.1: Perform static function code analysis on the code base;

[0011] Step S1.2: Record the function path, module-package name-class name-function;

[0012] Step S1.3: Record function code line interval information;

[0013] Step S1.4: Generate a function key identifier using the function path + code line interval information.

[0014] Preferably, step S2 includes the following steps:

[0015] Step S2.1: Execute the interface call, obtain the code line coverage information, and record the interface coverage interval information;

[0016] Step S2.2: Calculate the function association according to the number of matching rows and function intervals, and establish an interface-function identifier association library;

[0017] Step S2.3: De-duplicate the interface training list according to the relevance.

[0018] Preferably, step S3 includes the following steps:

[0019] Step S3.1: Obtain the effective code line change information between different versions;

[0020] Step S3.2: Obtain the relative position of the code line through the function identifier, and calculate the actual change range of the function based on the relative position;

[0021] Step S3.3: Calculate the affected interfaces by matching the actual function change range, interface coverage range, and function correlation.

[0022] Step S3.4: Recommend a list of impacted interfaces.

[0023] The present invention also provides a test system for intelligent analysis of function intervals, the system comprising the following modules:

[0024] Module M1: Obtain and store function identification information through static function analysis;

[0025] Module M2: Obtain code line coverage interval information through interface training, and combine it with function identification information to obtain the interface-function identification correlation;

[0026] Module M3: Recommends a list of affected interfaces based on function change intervals, interface coverage intervals, and function correlation.

[0027] Preferably, the module M1 includes the following modules:

[0028] Module M1.1: Perform static function code analysis on the code base;

[0029] Module M1.2: record function path, module-package name-class name-function;

[0030] Module M1.3: Record function code line interval information;

[0031] Module M1.4: Generate function key identifiers using function path + code line interval information.

[0032] Preferably, the module M2 includes the following modules:

[0033] Module M2.1: Execute interface calls, obtain code line coverage information, and record interface coverage interval information;

[0034] Module M2.2: Calculate function association according to the number of matching rows and function intervals, and establish an interface-function identifier association library;

[0035] Module M2.3: De-duplicate interface training list according to relevance.

[0036] Preferably, the module M3 includes the following modules:

[0037] Module M3.1: Get the effective code line change information between different versions;

[0038] Module M3.2: Obtain the relative position of the code line through the function identifier, and calculate the actual change range of the function based on the relative position;

[0039] Module M3.3: Calculates the affected interfaces by matching the actual function change range, interface coverage range, and function correlation.

[0040] Module M3.4: Recommended list of impacted interfaces.

[0041] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] 1. The present invention mainly solves the problem that the current testing work cannot determine the test scope, resulting in a large number of redundant tests;

[0044] 2. When performing precise testing, the present invention automatically establishes an interface-function identifier correlation library. Through effective change interval analysis, it can automatically analyze the minimum impact range from the code line interval level and automatically perform interface convergence according to the function interval correlation. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:

[0046] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0047] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.

[0048] Example 1:

[0049] According to the present invention, a method for testing function interval intelligent analysis includes the following steps:

[0050] Step S1: Obtain and store function identification information through static function analysis;

[0051] Step S1.1: Perform static function code analysis on the code base;

[0052] Step S1.2: Record the function path, module-package name-class name-function;

[0053] Step S1.3: Record function code line interval information;

[0054] Step S1.4: Generate a function key identifier using the function path + code line interval information.

[0055] Step S2: Obtain code line coverage interval information through interface training, and combine it with function identification information to obtain the interface-function identification correlation degree;

[0056] Step S2.1: Execute the interface call, obtain the code line coverage information, and record the interface coverage interval information;

[0057] Step S2.2: Calculate the function association according to the number of matching rows and function intervals, and establish an interface-function identifier association library;

[0058] Step S2.3: De-duplicate the interface training list according to the relevance.

[0059] Step S3: Recommend a list of affected interfaces based on the function change interval, interface coverage interval, and function correlation.

[0060] Step S3.1: Obtain the effective code line change information between different versions;

[0061] Step S3.2: Obtain the relative position of the code line through the function identifier, and calculate the actual change range of the function based on the relative position;

[0062] Step S3.3: Calculate the affected interfaces by matching the actual function change range, interface coverage range, and function correlation.

[0063] Step S3.4: Recommend a list of impacted interfaces.

[0064] The present invention also provides a computer-readable storage medium storing a computer program, which implements the steps of the above method when executed by a processor.

[0065] Example 2:

[0066] Example 2 is a preferred example of Example 1 and is used to illustrate the present invention in more detail.

[0067] The present invention also provides a test system for intelligent analysis of function intervals, which includes the following modules:

[0068] Module M1: Obtain and store function identification information through static function analysis;

[0069] Module M1.1: Perform static function code analysis on the code base;

[0070] Module M1.2: record function path, module-package name-class name-function;

[0071] Module M1.3: Record function code line interval information;

[0072] Module M1.4: Generate function key identifiers using function path + code line interval information.

[0073] Module M2: Obtain code line coverage interval information through interface training, and combine it with function identification information to obtain the interface-function identification correlation;

[0074] Module M2.1: Execute interface calls, obtain code line coverage information, and record interface coverage interval information;

[0075] Module M2.2: Calculate function association according to the number of matching rows and function intervals, and establish an interface-function identifier association library;

[0076] Module M2.3: De-duplicate interface training list according to relevance.

[0077] Module M3: Recommends a list of affected interfaces based on function change intervals, interface coverage intervals, and function correlation.

[0078] Module M3.1: Get the effective code line change information between different versions;

[0079] Module M3.2: Obtain the relative position of the code line through the function identifier, and calculate the actual change range of the function based on the relative position;

[0080] Module M3.3: Calculates the affected interfaces by matching the actual function change range, interface coverage range, and function correlation.

[0081] Module M3.4: Recommended list of impacted interfaces.

[0082] Example 3:

[0083] Example 3 is a preferred example of Example 1 and is used to illustrate the present invention in more detail.

[0084] This invention discloses a precision testing method using intelligent function interval analysis, primarily addressing the current problem of being unable to determine test scope, resulting in a large number of redundant tests. During precision testing, the invention automatically establishes an interface-function identifier correlation library. Through effective change interval analysis, it can automatically analyze the minimum impact range at the code line interval level and automatically perform interface convergence based on function interval correlation. Compared with existing methods, this invention achieves better precision testing results.

[0085] The implementation process of the present invention is mainly divided into three steps: function analysis, interface training, and intelligent recommendation. The implementation process is as follows:

[0086] Step 1: Obtain and store the key identification information of the function through static function analysis.

[0087] Step 2: Obtain code line coverage interval information through interface training, and combine it with the function identifier to obtain the interface-function identifier correlation.

[0088] Step 3: Intelligently recommend a list of affected interfaces based on the function change range, interface coverage range, and function correlation.

[0089] The step 1 comprises the following steps:

[0090] Step 1.1: Perform static function code analysis on the code base;

[0091] Step 1.2: Record the function path, module-package name-class name-function;

[0092] Step 1.3: Record function code line interval information;

[0093] Step 1.4: Generate function key identifier using function path + code line interval information;

[0094] The step 2 comprises the following steps:

[0095] Step 2.1: Execute the interface call, obtain the code line coverage information, and record the interface coverage interval information;

[0096] Step 2.2: Calculate the function correlation based on the number of matching rows and function intervals, and establish an interface-function identifier correlation library;

[0097] Step 2.3: Remove duplicate interface training lists according to relevance;

[0098] The step 3 comprises the following steps:

[0099] Step 3.1: Get the effective code line change information between different versions;

[0100] Step 3.2: Obtain the relative position of the code line through the function identifier, and calculate the actual change range of the function based on the relative position;

[0101] Step 3.3: Calculate the affected interfaces by matching the actual function change range, interface coverage range, and function correlation.

[0102] Step 3.4: Recommend a list of affected interfaces.

[0103] The present invention discloses a precise testing method for intelligent analysis of function intervals, which mainly solves the problem that current testing work cannot determine the test range, resulting in a large number of redundant tests.

[0104] Those skilled in the art may understand this embodiment as a more specific description of Embodiment 1 and Embodiment 2.

[0105] Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, and units provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same functions of the system and its various devices, modules, and units provided by the present invention in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; the devices, modules, and units for implementing various functions can also be considered as both software modules implementing the method and structures within the hardware component.

[0106] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.

Claims

1. A test method for intelligent analysis of function intervals, characterized in that: The method comprises the following steps: Step S1: Obtain and store function identification information through static function analysis; Step S2: Obtain code line coverage interval information through interface training, and combine it with function identification information to obtain the interface-function identification correlation degree; Step S3: Recommend a list of affected interfaces based on the function change range, interface coverage range, and function correlation; The step S2 comprises the following steps: Step S2.1: Execute the interface call, obtain the code line coverage information, and record the interface coverage interval information; Step S2.2: Calculate the function association according to the number of matching rows and function intervals, and establish an interface-function identifier association library; Step S2.3: De-duplicate the interface training list according to the relevance; The step S3 comprises the following steps: Step S3.1: Obtain the effective code line change information between different versions; Step S3.2: Obtain the relative position of the code line through the function identifier, and calculate the actual change range of the function based on the relative position; Step S3.3: Calculate the affected interfaces by matching the actual function change range, interface coverage range, and function correlation. Step S3.4: Recommend a list of impacted interfaces.

2. The function interval intelligent analysis testing method according to claim 1, characterized in that: The step S1 comprises the following steps: Step S1.1: Perform static function code analysis on the code base; Step S1.2: Record the function path, module-package name-class name-function; Step S1.3: Record function code line interval information; Step S1.4: Generate a function key identifier using the function path + code line interval information.

3. A test system for intelligent analysis of function intervals, characterized in that: The system includes the following modules: Module M1: Obtain and store function identification information through static function analysis; Module M2: Obtain code line coverage interval information through interface training, and combine it with function identification information to obtain the interface-function identification correlation; Module M3: recommends a list of affected interfaces based on function change intervals, interface coverage intervals, and function correlations; The module M2 includes the following modules: Module M2.1: Execute interface calls, obtain code line coverage information, and record interface coverage interval information; Module M2.2: Calculate function association according to the number of matching rows and function intervals, and establish an interface-function identifier association library; Module M2.3: De-duplicate interface training list according to relevance; The module M3 includes the following modules: Module M3.1: Get the effective code line change information between different versions; Module M3.2: Obtain the relative position of the code line through the function identifier, and calculate the actual change range of the function based on the relative position; Module M3.3: Calculates the affected interfaces by matching the actual function change range, interface coverage range, and function correlation. Module M3.4: Recommended list of impacted interfaces.

4. The function interval intelligent analysis test system according to claim 3, characterized in that: The module M1 includes the following modules: Module M1.1: Perform static function code analysis on the code base; Module M1.2: record function path, module-package name-class name-function; Module M1.3: Record function code line interval information; Module M1.4: Generate function key identifiers using function path + code line interval information.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • Method for testing software by applying across function analysis

    CN101894064A

  • System and method of testing and evaluating mathematical functions

    CA2452274A1

  • Data processing method and device, storage medium and electronic device

    CN115129584A