Database testing method, database system, electronic device, and storage medium

By acquiring data mutation guidance files and mutation rules to generate test case messages, and combining fuzz testing techniques and effective test case set extraction algorithms, the problems of high resource consumption and low efficiency in distributed database system testing are solved, achieving high efficiency and comprehensiveness in automated testing.

CN116089275BActive Publication Date: 2026-03-31JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Distributed database systems suffer from high resource consumption and a lack of comprehensive and effective test case identification mechanisms during testing, resulting in low testing efficiency.

Method used

By obtaining the data mutation guide file, each field in the test message is mutated using mutation rules, and the mutated fields are combined into test case messages. Automated testing is then performed using fuzz testing techniques, and an effective test case set extraction algorithm is designed to automatically filter effective test cases.

Benefits of technology

It automates the generation, execution, and analysis of test cases, reduces the generation of invalid test cases, improves testing efficiency and coverage, and ensures the comprehensiveness of test data and the diversity of scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089275B_ABST
    Figure CN116089275B_ABST
Patent Text Reader

Abstract

The application discloses a database testing method, a database system, an electronic device and a storage medium. The method comprises the following steps: obtaining a data variation guide file; the data variation guide file comprises the composition, field type, range and check value information of a test message; based on the data variation guide file, each field in the test message is varied by using a variation rule; each field after variation is combined to obtain a test case message; and the distributed database is tested by using the test case message. The scheme provided by the application models the test message, so that the data variation is miniaturized and comprehensive, the generation of invalid test case messages is reduced, the combined test case message can be applied to different test scenes, the comprehensiveness of the test data is ensured, and the diversification of the test scene is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and in particular to a database testing method, a database system, an electronic device, and a storage medium. Background Technology

[0002] Distributed database systems typically consist of multiple modules, and the coordination between these modules requires extensive message exchange. Before a distributed database system can be used normally, each module must be tested, and only after all modules have passed the tests can it be put into production.

[0003] In distributed database systems, many problems remain unsolved. Two prominent issues are as follows:

[0004] First, simply performing fuzzy data mutation can generate millions of test cases for a single message through fuzz testing. Executing so many test cases once would require a server to run continuously for several days or even dozens of days, which greatly consumes resources.

[0005] Second, after a large number of test cases are executed, there is a lack of a comprehensive and effective test case discrimination mechanism. Simply performing simple result verification or coverage comparison cannot effectively improve the efficiency of automated testing of distributed database systems. Summary of the Invention

[0006] To address the technical problems of high resource consumption and simple test discrimination mechanisms in existing distributed database system testing processes, embodiments of the present invention provide a database testing method, a database system, an electronic device, and a storage medium.

[0007] The technical solution of this invention is implemented as follows:

[0008] This invention provides a database testing method, the method comprising:

[0009] Obtain the data mutation guidance file; the data mutation guidance file contains the composition, field types, ranges, and verification value information of the test message;

[0010] Based on the data mutation guide file, each field in the test message is mutated using mutation rules;

[0011] Combine each mutated field to obtain the test case message;

[0012] The distributed database is tested using the aforementioned test case messages.

[0013] In one embodiment, the attributes of the test message include: message field level, message field name, field type, field type length, minimum normal value of the field, maximum normal value of the field, type of field mutation rule, and list of return values ​​after message execution.

[0014] In one embodiment, the step of mutating each field in the test message using mutation rules based on the data mutation guide file includes:

[0015] For each field in the test message that is of integer type, mutate it based on range boundary values, type boundary values, and five special values;

[0016] For each field in the test message that is a string field, the length of each field is varied, shortened, and / or some special characters are added to mutate it.

[0017] For each field in the test message that is a special field, mutate it according to the special field mutation rules.

[0018] In one embodiment, combining each mutated field to obtain a test case message includes: 0. Combining abnormal result messages in the test case message using at least one of the following methods: combining the edges of each field...

[0019] Boundary values ​​are combined according to the rules of the columns, the variant data of adjacent fields are combined into messages, and all fields are combined in a full permutation manner.

[0020] In one embodiment, testing the distributed database using the test case messages includes:

[0021] Obtain the test scenario;

[0022] 5. Determine the corresponding test case messages based on the test scenario;

[0023] Use the corresponding test case messages to test the distributed database.

[0024] In one embodiment, after testing the distributed database using the test case messages, the process includes:

[0025] Extract the valid use case set according to the valid use case set extraction rules;

[0026] The effective use case set is organized and summarized;

[0027] 0. Connect the compiled and summarized set of valid test cases to DailyCI for daily testing.

[0028] In one embodiment, the step of extracting a valid use case set according to the valid use case set extraction rules includes:

[0029] Check if the test case messages were executed successfully;

[0030] Perform integrity analysis in the event that test case messages fail to execute;

[0031] If the integrity analysis is correct, proceed with the results analysis;

[0032] 5. If the results analysis is correct, perform core analysis;

[0033] If a core file exists, add the current test case message to the set of valid test cases;

[0034] Perform coverage analysis if the test case messages are executed successfully;

[0035] With improved coverage, add the current test case message to the set of valid test cases;

[0036] Check if the memory is out of bounds;

[0037] 0. If there is a memory overflow, add the current test case message to the valid test case set;

[0038] Perform illegal memory read / write analysis when memory access is not exceeded;

[0039] In the event of an illegal memory read / write operation, the current test case message is added to the valid test case set.

[0040] This invention also provides a database system, the database system comprising:

[0041] The acquisition module is used to acquire the data mutation guidance file; the data mutation guidance file contains the composition, field types, ranges and verification value information of the test message;

[0042] The test case generation module is used to mutate each field in the test message based on the data mutation guide file and using mutation rules.

[0043] The test case combination module is used to combine each mutated field to obtain test case messages;

[0044] The test case execution module is used to test the distributed database using the test case messages.

[0045] This invention also provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor; wherein,

[0046] When the processor is used to run a computer program, it performs the steps of any of the methods described above.

[0047] This invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above methods.

[0048] This invention provides a database testing method, database system, electronic device, and storage medium. The method involves obtaining a data mutation guidance file, which includes the composition, field types, ranges, and checksum information of test messages. Based on the guidance file, each field in the test message is mutated using mutation rules. The mutated fields are then combined to obtain test case messages. These test case messages are then used to test a distributed database. This invention models the test messages, thereby minimizing and comprehensively implementing data mutation, reducing the generation of invalid test case messages, and ensuring that the combined test case messages are applicable to different testing scenarios. This guarantees both the comprehensiveness of the test data and the diversity of the testing scenarios. Attached Figure Description

[0049] Figure 1 This is a flowchart illustrating the database testing method according to an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram illustrating message attribute classification in an embodiment of the present invention;

[0051] Figure 3 This is a schematic diagram of the integer field variation framework according to an embodiment of the present invention;

[0052] Figure 4 This is a schematic diagram of the string field variation framework in an embodiment of the present invention;

[0053] Figure 5 This is a schematic diagram of the field combination architecture in an embodiment of the present invention;

[0054] Figure 6 This is a schematic diagram of the test analysis file generation process according to an embodiment of the present invention;

[0055] Figure 7 This is a schematic diagram of the effective use case set extraction process in an embodiment of the present invention;

[0056] Figure 8 This is a schematic diagram of the distributed database system architecture according to an embodiment of the present invention;

[0057] Figure 9 This is an internal structural diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0058] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.

[0059] This invention provides a database testing method, such as... Figure 1 As shown, the method includes:

[0060] Step 101: Obtain the data mutation guidance file; the data mutation guidance file contains the composition, field types, ranges, and checksum information of the test message;

[0061] Step 102: Based on the data mutation guide file, mutate each field in the test message using mutation rules;

[0062] Step 103: Combine each mutated field to obtain the test case message;

[0063] Step 104: Use the test case messages to test the distributed database.

[0064] The embodiments of the present invention can be used in distributed database systems, specifically in scenarios where FT testing and fuzz testing are performed between multiple modules of a distributed database system.

[0065] Function Test (FT) is a method of interface testing between modules that require message interaction, based on the concept of contract testing. FT testing allows for better testing of the internal functionality of a module during the requirements development and integration testing phases, without depending on the existence of another module requiring message interaction or whether its corresponding functionality has been developed. This significantly improves testing efficiency and allows for the early detection of defects in the internal functionality of the module under test, making it a common method for multi-module message testing in large companies.

[0066] Fuzz testing is a technique that tests software programs by generating a large number of input messages. Its purpose is to bypass the program's conventional message validation and interception, generate specific error messages to reach the program's error branches, and discover hidden defects in the program early.

[0067] This invention can combine fuzz testing technology with the FT testing process of a distributed database system to achieve full-process automation, namely automatic generation of test cases, automatic execution of test cases, automatic analysis of test cases, and automatic extraction of effective test case sets, which greatly improves testing efficiency.

[0068] In this embodiment, the following models are mainly applied: data mutation guidance model, data mutation model, and message combination model.

[0069] The data mutation guidance model can write and generate data mutation guidance files; the data mutation model can combine the characteristics of the database system and error-prone scenarios to mutate as much test data as possible for all scenarios; the message combination model can combine the mutated data into test cases suitable for different test scenarios.

[0070] In one embodiment, the attributes of the test message include: message field level, message field name, field type, field type length, minimum normal value of the field, maximum normal value of the field, type of field mutation rule, and list of return values ​​after message execution.

[0071] Specifically, see Figure 2 The following is the content regarding the data mutation-guided model:

[0072] The data mutation bootstrap model is the basis for generating the data mutation bootstrap file. The basic attributes of this model message, and the meanings of each attribute, may include the following:

[0073] 1) var_level: Message field level. In order to represent each field, this model needs to expand the message. Multiple fields in a message are at the same level. If a field is a composite type such as a struct, class, vector, or list, then the expanded field of the composite type is at the next level, and so on.

[0074] 2) var_name: Message field name. Refers to the name in the message interface definition.

[0075] 3) var_type: Field type. There are four specific types: 0-int, 1-uint, 2-string, 3-struct, 4-other.

[0076] 4) var_length: Field type length. The length of int and uint types can only be 1, 2, 4, or 8, representing the number of bytes; the length of string type represents the length of the string; the length of composite types represents the number of first-level variables under this structure.

[0077] 5) var_min: The minimum normal value of the field.

[0078] 6) var_max: The maximum value of the normal value of the field.

[0079] 7) variation: The type of field variation rule. 0 - no variation, 1 - regular variation, 2 - special variation.

[0080] 8) check_value: A list of return values ​​after message execution.

[0081] In one embodiment, the step of mutating each field in the test message using mutation rules based on the data mutation guide file includes:

[0082] For each field in the test message that is of integer type, perform mutation based on range boundary values, type boundary values, and special values;

[0083] For each field in the test message that is a string field, the length of each field is varied, shortened, and / or some special characters are added to mutate it.

[0084] For each field in the test message that is a special field, mutate it according to the special field mutation rules.

[0085] This embodiment mainly uses a data mutation model for mutation.

[0086] See Figure 3 and Figure 4 Each field in the message, after processing, can ultimately be converted into integer and string types. In addition, there is some data that requires special handling. The mutation rules are mainly divided into three categories, as follows:

[0087] (1) Integer field variation rules: For integer fields, in addition to the boundary values ​​of the field type, some boundary values ​​and special values ​​that often cause errors are added as the basis for verifying messages.

[0088] (2) String field mutation rules: The mutation of string type is mainly based on the length of the original data type, which is changed to be longer or shorter, and some error-prone special characters are added to mutate the data.

[0089] (3) Special Field Mutation Rules: The special mutation model is mainly for performing special mutations on some data with special meanings. The rules are as follows:

[0090] Specifically change the suffix of strings that end with ".";

[0091] Perform appropriate mutations on the numbers in the string;

[0092] The underscore becomes a short horizontal line;

[0093] Unregulated enumeration type mutation;

[0094] Mutate an array of irregular strings.

[0095] In one embodiment, combining each mutated field to obtain a test case message includes:

[0096] For abnormal result messages in test case messages, combine them in at least one of the following ways: combine the boundary values ​​of each field according to the rules of the columns, combine the mutated data of adjacent fields, or combine all fields in a permutation manner.

[0097] This embodiment mainly uses a message composition model for composition.

[0098] See Figure 5 In distributed database systems, messages consist of multiple fields, each of which can mutate into multiple values. If these values ​​are combined in all possible permutations, a single message can generate tens of millions of messages, inevitably increasing time and resource costs. Therefore, this embodiment establishes a message combination model, categorizing messages into normal and abnormal results based on their returned outcomes. Abnormal results messages, depending on the test scenario, can be further divided into the following three algorithm models:

[0099] (1) Boundary value algorithm model: This model combines the boundary values ​​of each field according to the rules of the vertical column, covers the abnormal branches of program boundary values, reduces the remaining messages to ensure test time, and is suitable for iterative forward testing and smoke testing scenarios.

[0100] (2) Binary algorithm model: Combine the mutated data of adjacent fields into messages, and achieve 70% of the test scenarios with 1% of the test data. It is suitable for general routine testing.

[0101] (3) Full permutation algorithm model: All fields are combined into a message in a full permutation manner. The message is tested over a long period of time through a dedicated server. It is suitable for the first test. The effective test cases are extracted and integrated into DailyCI for daily testing.

[0102] By using the above mutation and combination rules, test case messages can be obtained, and these messages can be used to test the distributed database system.

[0103] Based on the above, the process of generating the test analysis file will be described below.

[0104] See Figure 6 The generation of the test analysis file includes the following:

[0105] (1) The program reads the mutation guide file, parses whether the mutation guide file exists, and whether the values ​​of the model in the file meet the requirements. If it fails, it exits the process directly.

[0106] (2) Parse the mutated boot file and store the attribute information of each field in the message;

[0107] (3) Mutate each field according to the mutation rules to generate a field set;

[0108] (4) Combine the fields into a set of test case messages suitable for different scenarios based on the message combination model;

[0109] (5) Execute the test cases and generate a valid test case set according to the valid test case set extraction rules;

[0110] (6) Generate test analysis files; process ends.

[0111] In one embodiment, testing the distributed database using the test case messages includes:

[0112] Obtain the test scenario;

[0113] Based on the test scenario, determine the corresponding test case message;

[0114] Use the corresponding test case messages to test the distributed database.

[0115] In this embodiment, the synthesized test case messages can be applied to different test scenarios, ensuring the comprehensiveness of test data and the diversity of test scenarios.

[0116] In one embodiment, after testing the distributed database using the test case messages, the process includes:

[0117] Extract the valid use case set according to the valid use case set extraction rules;

[0118] The effective use case set is organized and summarized;

[0119] The compiled and summarized set of valid test cases will be integrated into DailyCI for daily testing.

[0120] In one embodiment, the step of extracting the valid use case set according to the valid use case set extraction rules includes:

[0121] Check if the test case messages were executed successfully;

[0122] Perform integrity analysis in the event that test case messages fail to execute;

[0123] If the integrity analysis is correct, proceed with the results analysis;

[0124] If the results analysis is correct, perform core analysis;

[0125] If a core file exists, add the current test case message to the set of valid test cases;

[0126] Perform coverage analysis if the test case messages are executed successfully;

[0127] With improved coverage, add the current test case message to the set of valid test cases;

[0128] Check if the memory is out of bounds;

[0129] If there is a memory overflow, add the current test case message to the valid test case set;

[0130] Perform illegal memory read / write analysis when memory access is not exceeded;

[0131] In the event of an illegal memory read / write operation, the current test case message is added to the valid test case set.

[0132] Specifically, see Figure 7 The process of extracting the valid use case set is as follows:

[0133] (1) The program executes test cases from the test case set in a loop and checks whether the test cases are executed successfully;

[0134] (2) If a test case fails to execute, perform an integrity analysis. If the test case is incomplete, discard it and continue to execute the next test case.

[0135] (3) If the integrity analysis is correct, perform result analysis; if the result is incorrect, continue to execute the next test case.

[0136] (4) If the result analysis is correct, then perform core analysis. If the program has no core file, continue to execute the next test case.

[0137] (5) If a core file exists, analyze it and add it to the set of valid test cases, then continue to execute the next test case;

[0138] (6) If the test cases are executed successfully, perform coverage analysis. If the coverage is improved, record the set of valid test cases.

[0139] (7) If coverage does not improve, check if memory is out of bounds. If it is out of bounds, record the set of valid test cases.

[0140] (8) If the memory is not out of bounds, perform memory illegal read / write analysis; if there is illegal read / write, record the set of valid test cases.

[0141] (9) If there is no illegal memory read / write, continue to execute the next test case;

[0142] (10) The process ends when all test cases in the test case set have been executed.

[0143] Based on the above, this implementation plan has the following characteristics:

[0144] First, a data mutation guidance model was designed. Considering common faults in distributed database systems, this embodiment of the invention designed a data mutation guidance file, modeling the input messages to make data mutation smaller and more comprehensive, greatly reducing the generation of invalid test cases.

[0145] Second, a data mutation model and a data combination model were designed. This embodiment of the invention combines the characteristics of database systems and error-prone scenarios to design and implement a data mutation model. The data mutation model generates as much test data as possible across all scenarios. Then, the data combination model combines the mutated data into test cases suitable for different test scenarios, ensuring both the comprehensiveness of the test data and the diversity of the test scenarios.

[0146] Third: An algorithm for extracting valid test cases was invented. Most fuzz tests produce invalid test cases. This invention provides an automatic algorithm for extracting valid test cases, which can filter out qualified test cases and automatically integrate them into CI for daily protection testing.

[0147] The method proposed in this invention establishes a specific data mutation guidance model, enabling data generation to mutate according to the characteristics of a distributed database system. Then, through different message combination strategies, test cases suitable for different testing scenarios can be generated. Finally, during test execution, an effective test case set extraction algorithm is used to automatically extract effective test cases, which can be integrated with dailyCI for daily program testing.

[0148] This invention establishes a message-guided mutation model for distributed database systems. This model is applicable to messages in distributed database systems and can effectively display the fields in the message and the hierarchical relationships between fields. Different attributes are defined for each field, and test data suitable for various scenarios in distributed database systems can be generated based on these attributes. This data mutation-guided model reduces a large amount of invalid mutation data, ensuring that more mutated data reaches the internal logic of the program under test, thus saving testing time and resources.

[0149] This invention features a self-developed mutation algorithm, which is divided into a field-level mutation model and a message-level combination model. According to the specific algorithm, normal mutation of a message can produce a maximum of 8 normal messages; abnormal mutation of a message can produce a maximum of 18 abnormal messages. By combining the mutated data into messages, full coverage of branches within a message can be achieved. The proposed message combination model generates different test message sets according to different test scenarios of the distributed database system, making testing more flexible and comprehensive.

[0150] The embodiments of this invention can be widely applied to functional testing between multiple modules of a distributed database system; it enables automated FT fuzz testing to achieve feasibility, configurability, and flexibility, greatly reducing the time spent manually writing FT test cases, deeply exploring vulnerabilities in software message communication, and discovering and eliminating them during the testing phase, thereby improving the stability of the distributed database system.

[0151] The database testing method provided in this invention involves obtaining a data mutation guidance file. This file contains the composition, field types, ranges, and checksum information of test messages. Based on the guidance file, each field in the test message is mutated using mutation rules. The mutated fields are then combined to obtain test case messages. These test case messages are then used to test a distributed database. This invention models the test messages, thereby minimizing and comprehensively implementing data mutations, reducing the generation of invalid test case messages, and ensuring that the combined test case messages are applicable to different testing scenarios. This guarantees both the comprehensiveness of the test data and the diversity of the testing scenarios.

[0152] To implement the method of the embodiments of the present invention, the embodiments of the present invention also provide a database system, the database system comprising:

[0153] The acquisition module is used to acquire the data mutation guidance file; the data mutation guidance file contains the composition, field types, ranges and verification value information of the test message;

[0154] The test case generation module is used to mutate each field in the test message based on the data mutation guide file and using mutation rules.

[0155] The test case combination module is used to combine each mutated field to obtain test case messages;

[0156] The test case execution module is used to test the distributed database using the test case messages.

[0157] See Figure 8 In one embodiment, the modules and functions of the distributed database system can be as follows:

[0158] (1) Data mutation guide file: The original message file generated according to the data mutation guide model. This file describes the composition of the message, field types, ranges, check values ​​and other information.

[0159] (2) Visual Management Module: This module is the front-end display module. Loading of boot files, display of mutation data, test control, result analysis, log display, etc. are all managed and displayed through the visual management module.

[0160] (3) Test Case Generation Module: This module mainly uses the data mutation bootstrap file to mutate each field in the message according to the mutation rules of the data mutation model, and then combines the mutated data of each field according to the rules of the message combination model to form the final test case message, waiting for FT testing.

[0161] (4) Test Case Execution Module: Execute test cases one by one according to the selected scenario, simulate component A sending messages to component B under test, and analyze the test results.

[0162] (5) Valid use case extraction module: This module extracts valid use case sets according to the valid use case set extraction rules, organizes and summarizes them, and automatically connects them to DailyCI for daily testing.

[0163] Based on the above framework, the entire process of this embodiment can be described as follows:

[0164] (1) Add test tasks in the visual management interface, load the pre-written data mutation guide file or write the data mutation guide file directly in the interface;

[0165] (2) The test case generation module generates FT test cases according to the data variation model and message combination model. During this process, the progress, results and logs and other relevant information will be displayed in real time on the visual management interface.

[0166] (3) Before the test cases are executed, you can select the test scenario and execute different group test cases according to different test scenarios. During this process, the progress, results and logs and other relevant information will be displayed in real time on the visual management interface.

[0167] (4) During the execution of test cases, the valid test case extraction module will monitor the memory status and running status of the program in real time. After the test cases are executed, the valid test case set will be extracted according to the valid test case set extraction rules and automatically connected to the DailyCI testing platform.

[0168] (5) After all test cases are executed, the visual management interface will display all test result analysis, including the number of test cases executed, success rate, failure analysis, and effective test case rate.

[0169] In practical applications, all of the above modules can be implemented by the processor in the database system.

[0170] It should be noted that the above-described apparatus, when executed, is only illustrated by the division of the program modules described above. In actual applications, the processing can be assigned to different program modules as needed, that is, the internal structure of the terminal can be divided into different program modules to complete all or part of the processing described above. Furthermore, the apparatus and method embodiments described above belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.

[0171] To implement the method of the embodiments of the present invention, the present invention also provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the above-described method.

[0172] Based on the hardware implementation of the above-described program modules, and in order to implement the method of this embodiment of the invention, this embodiment also provides an electronic device (computer device). Specifically, in one embodiment, the computer device may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05, and a memory (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A06. The network interface A02 is used for communication with external terminals via a network connection. When the computer program is executed by the processor A01, it implements the method of any of the above embodiments. The display screen A04 can be a liquid crystal display or an electronic ink display. The input device A05 can be a touch layer covering the display screen, a button, trackball, or touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0173] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0174] The device provided in the embodiments of the present invention includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the method of any of the above embodiments.

[0175] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0176] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0177] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0178] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0179] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0180] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0181] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0182] It is understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or both. Specifically, non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable types of memories.

[0183] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0184] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A database testing method characterized by comprising: The method comprises: acquiring a data variation guide file; the data variation guide file contains the composition, field type, range and check value information of a test message; based on the data variation guide file, using variation rules to vary each field in the test message, wherein, for special fields, variation is performed according to special field variation rules, including changing the suffix of a string ending with a specific suffix, varying the numbers in the string, changing the underscore to a short dash, varying the unregulated enumeration type and varying the unregulated string array; combining each field after variation according to a message combination model to obtain a test case message, wherein the message combination model comprises at least one of a boundary value algorithm model, a binary algorithm model and a full permutation algorithm model; using the test case message to test a distributed database.

2. The method of claim 1, wherein, The attributes of the test message include: message field level, message field name, field type, field type length, minimum value of field normal value, maximum value of field normal value, type of field variation rule, and return value list after message execution.

3. The method of claim 1, wherein, The method comprises: for each field in the test message whose field type is an integer field, variation is performed based on range boundary values, type boundary values and special values; for each field in the test message whose field type is a string field, variation is performed according to the length of each field, including lengthening, shortening and / or adding some special characters; for each field in the test message whose field type is a special field, variation is performed according to special field variation rules.

4. The method of claim 1, wherein, The method comprises: for abnormal result messages in the test case message, at least one of the following methods is used for combination: combining the boundary values of each field according to the rule of vertical column, combining the variation data of adjacent fields, and combining all fields in a full permutation manner.

5. The method of claim 1, wherein, The method comprises: acquiring a test scenario; determining the corresponding test case message according to the test scenario; using the corresponding test case message to test the distributed database.

6. The method of claim 1, wherein, After using the test case message to test the distributed database, the method comprises: extracting an effective use case set according to an effective use case set extraction rule; organizing and summarizing the effective use case set; connecting the organized and summarized effective use case set to DailyCI for daily testing.

7. The method of claim 6, wherein, The method comprises: checking whether the test case message is executed successfully; in the case that the test case message fails to be executed, performing integrity analysis; in the case that the integrity analysis is correct, performing result analysis; in the case that the result analysis is correct, performing core analysis; in the case that there is a core file, adding the current test case message to the effective use case set; in the case that the test case message is executed successfully, performing coverage analysis; In the case of coverage promotion, the current test case message is added to the valid case set; Check if the memory is out of bounds; In the case of memory out of bounds, the current test case message is added to the valid case set; In the case of no memory out of bounds, analyze the memory illegal read and write; In the case of memory illegal read and write, the current test case message is added to the valid case set.

8. A database system, characterized in that The database system comprises: An acquisition module is configured to acquire a data variation guide file; the data variation guide file contains composition, field type, range and check value information of a test message; A case generation module is configured to vary each field in the test message based on the data variation guide file and using variation rules, wherein, for special fields, variation is performed according to special field variation rules, including changing a suffix of a string ending with a specific suffix, varying a number in the string, changing an underscore to a short dash, varying a random enumeration type and varying a random string array; A case combination module is configured to combine each field after variation according to a message combination model to obtain a test case message, wherein the message combination model comprises at least one of a boundary value algorithm model, a binary algorithm model and a full permutation algorithm model; A case execution module is configured to test a distributed database using the test case message.

9. An electronic device, comprising: It comprises: a processor and a memory for storing a computer program capable of running on the processor; wherein, the processor is used to run the computer program, and executes the steps of the method of any one of claims 1 to 7.

10. A storage medium having stored therein a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Service vulnerability test method based on message combination variation

    CN103973511A

  • Method and device for generating test case, computer equipment and storage medium

    CN110221960A

  • Test case variation method with guidance based on type inference

    CN111459808A

  • Fuzzy test method and system for stateful network protocol

    CN114650163A