A functional testing method and a functional testing device

The method and device streamline functional testing by calculating parameter distances and using a filter to verify parameter combinations, addressing inefficiencies and errors in manual testing of configurable applications.

CN114817066BActive Publication Date: 2025-07-15AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when there are a large number of parameters that can be configured by users, the test method for manually setting and verifying whether it is effective is cumbersome and inefficient, and it is prone to omissions and duplicate parameter combinations, which poses a risk of insufficient verification of business logic branches.

Method used

By obtaining all the configuration parameters and their database information of the application system, calculating the distance value between parameters, dividing the subject domain according to the distance value, generating parameter combinations, and using parameter filters to verify whether the combination is effective, avoid manual settings and improve testing efficiency.

Benefits of technology

It effectively avoids the tedious operation of manually setting parameters, improves testing efficiency, reduces omissions and duplication combinations, and ensures comprehensive verification of business logic branches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817066B_ABST
    Figure CN114817066B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a function testing method and a function testing device. Among them, in a function testing method, all multiple configurable parameters of an application system and the database information corresponding to the multiple parameters respectively are obtained; according to the database information, the distance values between the multiple parameters are calculated, and the multiple parameters are divided into subject domains according to the distance values to obtain multiple parameter combinations corresponding to the multiple subject domains. The parameter combination to be tested is selected from the parameter combinations corresponding to the subject domains, all the parameters in the parameter combination to be tested are input into a parameter filter, and whether the parameter combination to be tested takes effect is verified according to the execution result returned by the parameter filter until all the parameter combinations to be tested are verified. Through the above method, the cumbersome process of manually setting and verifying the configurable parameters of the application system can be avoided. At the same time, by dividing all the parameters into subject domains and then combining them, unreasonable test combinations are trimmed, and the test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly to a function testing method and a function testing device. Background Art

[0002] In order to solve the problem of modifying code and changing programs due to changes in business rules, application systems provide a configurable function. Parameters involved in business rules are stripped out and placed on the system page for users to visually configure and save relevant configurations. The background system executes different business processing logics by obtaining different configurations. However, when the number of parameters available for user configuration reaches dozens or even hundreds, it is an extremely cumbersome and inefficient testing method for testers to manually set and verify the effectiveness of all possible configurations one by one. Moreover, the manual method is prone to omissions and duplicate parameter combinations, and there is a risk of insufficient verification of business logic branches. Summary of the Invention

[0003] The purpose of the embodiments of the present invention is to provide a function testing method and a function testing device. This method avoids the cumbersome process of manually setting and verifying configurable parameters of the test application system. At the same time, by dividing all parameters into theme domains and then combining them, unreasonable test combinations are trimmed, and the testing efficiency is improved.

[0004] To achieve the above purpose, the embodiments of the present invention disclose the following technical solutions:

[0005] A function testing method includes:

[0006] Obtain all configurable parameters of the application system and the database information corresponding to the multiple parameters respectively;

[0007] Calculate the distance values between the multiple parameters according to the database information corresponding to the multiple parameters respectively;

[0008] Divide the multiple parameters into theme domains according to the distance values between the multiple parameters to obtain multiple parameter combinations corresponding to multiple theme domains, where each parameter combination includes multiple parameters whose distance values meet a preset distance condition;

[0009] Select a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple theme domains, input all the parameters in the parameter combination to be tested into a parameter filter, and verify whether the parameter combination to be tested is effective according to the execution result returned by the parameter filter until all the parameter combinations to be tested are verified.

[0010] Optionally, the database information corresponding to the multiple parameters respectively includes: the database table fields corresponding to the multiple parameters, the database table structure information corresponding to the multiple parameters, and the foreign key association relationship between database tables.

[0011] Optionally, calculating the distance value between the parameters according to the database information corresponding to the parameters includes:

[0012] When two parameters are in the same database table, determining that the distance value between the parameters in the same database table is 0;

[0013] When there is a foreign key association relationship between two database tables, determining that the distance value between the parameters in the two database tables with the foreign key association relationship is 1;

[0014] When two parameters are not in the same database table and there is no foreign key association relationship between the database tables where the parameters are located, determining that the distance value between the two parameters is 2.

[0015] Optionally, dividing the parameters into subject domains according to the distance value includes:

[0016] Obtaining all parameters with distance values of 0 and 1 from the distance values between the multiple parameters;

[0017] Dividing all parameters with distance values of 0 and 1 into the same subject domain, and adding all parameters with distance values of 0 and 1 to the parameter combination corresponding to the same subject domain.

[0018] Optionally, inputting all parameters in the to-be-tested parameter combination into a parameter filter, and verifying whether the to-be-tested parameter combination takes effect according to the execution result returned by the parameter filter includes:

[0019] Obtaining all to-be-tested parameters in the to-be-tested parameter combination through the parameter filter, and generating an SQL query statement according to the to-be-tested parameters;

[0020] Obtaining the execution result by executing the SQL query statement;

[0021] Verifying whether the to-be-tested parameter combination takes effect according to the execution result and the function return result of the application system.

[0022] A function testing device includes: a data acquisition unit for acquiring all configurable multiple parameters of an application system and the database information corresponding to the multiple parameters respectively;

[0023] A calculation unit for calculating the distance value between the multiple parameters according to the database information corresponding to the multiple parameters respectively;

[0024] A theme domain division unit, configured to divide the multiple parameters according to the distance values between the multiple parameters to obtain multiple parameter combinations corresponding to multiple theme domains, where each parameter combination includes multiple parameters whose distance values meet a preset distance condition;

[0025] A verification unit, configured to select a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple theme domains, input all the parameters in the parameter combination to be tested into a parameter filter, and verify whether the parameter combination to be tested is effective according to the execution result returned by the parameter filter until all the parameter combinations to be tested are verified.

[0026] Optionally, the database information corresponding to the multiple parameters respectively includes: the database table fields corresponding to the multiple parameters, the database table structure information corresponding to the multiple parameters, and the foreign key association relationship between database tables.

[0027] Optionally, the calculation unit is further configured to, when two parameters are in the same database table, determine that the distance value between the parameters in the same database table is 0;

[0028] When there is a foreign key association relationship between two database tables, determine that the distance value between the parameters in the two database tables with the foreign key association relationship is 1;

[0029] When two parameters are not in the same database table and there is no foreign key association relationship between the database tables where the parameters are located, determine that the distance value between the two parameters is 2.

[0030] A function test device, comprising:

[0031] A memory, configured to store a computer program;

[0032] A processor, configured to execute the computer program stored in the memory to implement the steps of any one of the above function test methods.

[0033] A computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the steps of any one of the above function test methods.

[0034] It can be seen that the embodiment of the present invention discloses a function testing method, which includes: obtaining all configurable parameters of an application system and the database information corresponding to the multiple parameters respectively; calculating the distance values between the multiple parameters according to the database information, and dividing the multiple parameters into subject domains according to the distance values to obtain multiple parameter combinations corresponding to the multiple subject domains; selecting a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple subject domains, inputting all the parameters in the parameter combination to be tested into a parameter filter, and verifying whether the parameter combination to be tested takes effect according to the execution result returned by the parameter filter until all the parameter combinations to be tested are verified. Through the above method, the cumbersome process of manually setting and verifying the configurable parameters of the application system can be avoided. At the same time, by dividing all the parameters into subject domains and then combining them, unreasonable test combinations are trimmed, and the test efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings according to these drawings without creative efforts.

[0036] Figure 1 It is a flowchart of a function testing method provided by an embodiment of the present invention;

[0037] Figure 2 It is a schematic diagram of configurable parameters in an application system provided by an embodiment of the present invention;

[0038] Figure 3 It is a structural diagram of a function testing device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0040] As Figure 1 shown, it shows a flowchart of a function testing method provided by an embodiment of the present invention, and the method may include:

[0041] S101, obtaining all configurable parameters of an application system and the database information corresponding to the multiple parameters respectively.

[0042] In the embodiments of the present invention, first obtain all the configurable parameters of the application system and the database information corresponding to the multiple parameters respectively. The database information corresponding to the multiple parameters respectively includes the database table fields corresponding to the multiple parameters, the database table structure information corresponding to the multiple parameters, and the foreign key association relationship between the database tables.

[0043] S102. Calculate the distance values between the multiple parameters according to the database information corresponding to the multiple parameters respectively.

[0044] In the embodiments of the present invention, after obtaining the database information corresponding to the multiple parameters respectively, when two parameters are in the same database table, it can be determined that the distance value between the parameters in the same database table is 0; when there is a foreign key association relationship between two database tables, it can be determined that the distance value between the parameters in the two database tables with the foreign key association relationship is 1; when two parameters are not in the same database table and there is no foreign key association relationship between the database tables where the parameters are located, it can be determined that the distance value between the two parameters is 2. Through this process, the distance values between the multiple parameters can be calculated.

[0045] For ease of understanding, refer to Figure 2 the schematic diagram of the configurable parameters in the application system shown in the figure. Among them, there are configurable parameters a and b in database table A, configurable parameters a, c, and d in database table B, and configurable parameters e, f, and g in database table C.

[0046] The distance value between the parameters in the same database table is 0, that is, the distance value between parameter a and b in database table A is 0, the distance values between parameters a, c, and d in database table B are 0, and the distance values between parameters e, f, and g in database table C are 0.

[0047] The distance value between the parameters in two database tables with a foreign key association relationship is 1. That is, there is a foreign key association relationship between database table A and database table B. Therefore, the distance value between parameter a and b in database table A and parameters c and d in database table B is 1.

[0048] The parameters in database table C are in different database tables from the parameters in database A and database B, and there is no foreign key association relationship between database table C and database tables A and B. Therefore, the distance between parameters e, f, and g in database table C and parameter a and b in database table A is 2, and the distance from parameters a, c, and d in database table B is also 2.

[0049] S103. Perform topic domain division on the multiple parameters according to the distance values between the multiple parameters to obtain multiple parameter combinations corresponding to multiple topic domains, where each parameter combination includes multiple parameters whose distance values meet the preset distance conditions.

[0050] In the embodiments of the present invention, all parameters with distance values of 0 and 1 can be obtained from the distance values between multiple parameters; all parameters with distance values of 0 and 1 are divided into the same subject domain, and all parameters with distance values of 0 and 1 are added to the parameter combination corresponding to the same subject domain, so that each parameter combination corresponding to the subject domain can include all parameters with distance values of 0 and 1.

[0051] For ease of understanding, reference may also be made to Figure 2 As shown, all parameters with distance values of 0 and 1, that is, parameter a, b in database table A and parameter c, d in database table B can be divided into the same subject domain, and parameter e, f, g in database C can be divided into the same subject domain. After division, one of the subject domains corresponds to the parameter combination {a, b, c, d}, and the other subject domain corresponds to the parameter combination {e, f, g}.

[0052] S104. Select a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple subject domains, input all parameters in the parameter combination to be tested into a parameter filter, and verify whether the parameter combination to be tested is effective according to the execution result returned by the parameter filter until all parameter combinations to be tested are verified.

[0053] In the embodiments of the present invention, a parameter combination to be tested can be selected from the multiple parameter combinations corresponding to the multiple subject domains, and all parameters in the parameter combination to be tested are input into the parameter filter. It can be understood that a parameter combination can include one or more parameter combinations to be tested.

[0054] For example, in the parameter combination {e, f, g} corresponding to the subject domain as described above, multiple parameter combinations to be tested such as {e, g}, {e, f}, {e, f, g} can be selected.

[0055] Input all parameters in the parameter combination to be tested into the parameter filter. All parameters to be tested in the parameter combination to be tested can be obtained through the parameter filter, an sql query statement is generated according to the parameters to be tested, and by executing the sql query statement, an execution result is obtained, so as to verify whether the parameter combination to be tested is effective according to the execution result and the function return result of the application system. Through the sql query statement, the query verification is performed in the database. The function return result of the application system refers to in the front-end page, through input and output, and then verify whether the function is realized.

[0056] In the embodiment of the present invention, after obtaining all the configurable parameters of the application system and the database information corresponding to the multiple parameters respectively; calculating the distance values between the multiple parameters according to the database information, and partitioning the multiple parameters into subject domains according to the distance values to obtain multiple parameter combinations corresponding to multiple subject domains, selecting a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple subject domains, inputting all the parameters in the parameter combination to be tested into a parameter filter, and verifying whether the parameter combination to be tested takes effect according to the execution result returned by the parameter filter until all the parameter combinations to be tested are verified. Through the above method, the cumbersome process of manually setting and verifying the configurable parameters of the application system can be avoided. At the same time, by partitioning all the parameters into subject domains and then combining them, unreasonable test combinations are trimmed, improving the test efficiency.

[0057] The embodiment of the present invention can also effectively avoid the situation of missing and duplicate parameter combinations due to manual verification of configuration parameters, and avoid the risk of insufficient verification of business logic branches existing in manual verification.

[0058] The following introduces a function testing device disclosed in the embodiment of the present invention. Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a function testing device disclosed in the embodiment of the present invention. The device includes:

[0059] A data acquisition unit 301, configured to acquire all the configurable parameters of the application system and the database information corresponding to the multiple parameters respectively;

[0060] A calculation unit 302, configured to calculate the distance values between the multiple parameters according to the database information corresponding to the multiple parameters;

[0061] A subject domain partitioning unit 303, configured to partition the multiple parameters into subject domains according to the distance values between the multiple parameters to obtain multiple parameter combinations corresponding to multiple subject domains, where each parameter combination includes multiple parameters whose distance values meet a preset distance condition;

[0062] A verification unit 304, configured to select a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple subject domains, input all the parameters in the parameter combination to be tested into a parameter filter, and verify whether the parameter combination to be tested takes effect according to the execution result returned by the parameter filter until all the parameter combinations to be tested are verified.

[0063] In a possible implementation manner, the database information corresponding to the multiple parameters respectively includes: the database table fields corresponding to the multiple parameters, the database table structure information corresponding to the multiple parameters, and the foreign key association relationship between database tables.

[0064] In a possible implementation manner, the computing unit is further configured to determine that the distance value between the parameters in the same database table is 0 when the two parameters are from the same database table;

[0065] When there is a foreign key association relationship between two database tables, determine that the distance value between the parameters in the two database tables with the foreign key association relationship is 1;

[0066] When the two parameters are not from the same database table and there is no foreign key association relationship between the database tables where the parameters are located, determine that the distance value between the two parameters is 2.

[0067] In a possible implementation manner, the subject domain division unit further includes obtaining all parameters with distance values of 0 and 1 from the distance values between the multiple parameters;

[0068] Divide all the parameters with distance values of 0 and 1 into the same subject domain, and add all the parameters with distance values of 0 and 1 to the parameter combination corresponding to the same subject domain.

[0069] In a possible implementation manner, the verification unit further includes obtaining all the to-be-tested parameters in the to-be-tested parameter combination through the parameter filter, and generating an sql query statement according to the to-be-tested parameters;

[0070] Execute the sql query statement to obtain the execution result;

[0071] Verify whether the to-be-tested parameter combination takes effect according to the execution result and the function return result of the application system.

[0072] An embodiment of the present invention also discloses a function testing device, including:

[0073] A memory for storing a computer program;

[0074] A processor for executing the computer program stored in the memory to implement the steps of the function testing method mentioned in any one of the above embodiments.

[0075] It should be noted that the function testing device provided by the embodiment of the present invention has the technical effects of any one of the above embodiments, and the embodiment of the present invention will not elaborate herein.

[0076] To better understand this solution, an embodiment of the present invention discloses a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the method steps of function testing mentioned in any one of the above embodiments.

[0077] It should be noted that a computer-readable storage medium provided by an embodiment of the present invention has the technical effects of any one of the above embodiments, and the embodiments of the present invention will not be elaborated herein.

Claims

1. A functional testing method, characterized in that, Including: Obtain all multiple configurable parameters of the application system and the database information corresponding to each of the multiple parameters; Calculate the distance values between the multiple parameters according to the database information corresponding to each of the multiple parameters, including: when two parameters belong to the same database table, determine that the distance value between the parameters in the same database table is 0; when there is a foreign key association relationship between two database tables, determine that the distance value between the parameters in the two database tables with the foreign key association relationship is 1; when two parameters neither belong to the same database table and there is no foreign key association relationship between the database tables where the parameters are located, determine that the distance value between the two parameters is 2; Perform subject domain division on the multiple parameters according to the distance values between the multiple parameters to obtain multiple parameter combinations corresponding to multiple subject domains, where each parameter combination includes multiple parameters whose distance values meet the preset distance condition; the performing subject domain division on the parameters according to the distance values includes: obtain all parameters with distance values of 0 and 1 from the distance values between the multiple parameters; divide all parameters with distance values of 0 and 1 into the same subject domain, and add all parameters with distance values of 0 and 1 to the parameter combination corresponding to the same subject domain; Select a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple subject domains, input all parameters in the parameter combination to be tested into a parameter filter, and verify whether the parameter combination to be tested is effective according to the execution result returned by the parameter filter until all parameter combinations to be tested are verified.

2. The functional test method according to claim 1, characterized in that The database information corresponding to each of the multiple parameters includes: the database table fields corresponding to the multiple parameters, the database table structure information corresponding to the multiple parameters, and the foreign key association relationship between database tables.

3. The functional test method according to claim 1, wherein Input all parameters in the parameter combination to be tested into a parameter filter, and verify whether the parameter combination to be tested is effective according to the execution result returned by the parameter filter, including: Obtain all parameters to be tested in the parameter combination to be tested through the parameter filter, and generate an SQL query statement according to the parameters to be tested; Obtain the execution result by executing the SQL query statement; Verify whether the parameter combination to be tested is effective according to the execution result and the function return result of the application system.

4. A functional test device, characterized in that, Including: A data acquisition unit for obtaining all multiple configurable parameters of the application system and the database information corresponding to each of the multiple parameters; A calculation unit for calculating the distance values between the multiple parameters according to the database information corresponding to each of the multiple parameters; The calculation unit is further configured to, when two parameters belong to the same database table, determine that the distance value between the parameters in the same database table is 0; when there is a foreign key association relationship between two database tables, determine that the distance value between the parameters in the two database tables with the foreign key association relationship is 1; when two parameters neither belong to the same database table and there is no foreign key association relationship between the database tables where the parameters are located, determine that the distance value between the two parameters is 2; A subject domain division unit, configured to perform subject domain division on the multiple parameters according to the distance values between the multiple parameters, so as to obtain multiple parameter combinations corresponding to multiple subject domains, wherein each of the parameter combinations includes multiple parameters whose distance values meet a preset distance condition; The subject domain division unit is further configured to obtain all the parameters with distance values of 0 and 1 from the distance values between the multiple parameters; divide all the parameters with distance values of 0 and 1 into the same subject domain, and add all the parameters with distance values of 0 and 1 to the parameter combination corresponding to the same subject domain; A verification unit, configured to select a parameter combination to be tested from the multiple parameter combinations corresponding to the multiple subject domains, input all the parameters in the parameter combination to be tested into a parameter filter, and verify whether the parameter combination to be tested is effective according to the execution result returned by the parameter filter until all the parameter combinations to be tested are verified.

5. The functional test device according to claim 4, wherein The database information corresponding to the multiple parameters respectively includes: the database table fields corresponding to the multiple parameters, the database table structure information corresponding to the multiple parameters, and the foreign key association relationship between database tables.

6. A functional test device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program stored in the memory to implement the steps of the function test method according to any one of claims 1 to 3.

7. A computer-readable storage medium, on which a computer program is stored, characterized in that, The computer program is executed by the processor to implement the steps of the function test method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Data opening and sharing-oriented data division and organization method

    CN107908660A

  • Database configuration method and device, computer equipment and storage medium

    CN108509628A