Test case generation method based on classification tree and related device

By using a test case generation method based on classification trees, the display information configuration page receives the requirements document, parses and partitions it into equivalence classes, generates test cases, and automates the entire process through mind mapping. This solves the problem of excessive test cases in complex business systems and improves testing efficiency and coverage.

CN122332291APending Publication Date: 2026-07-03GUANGZHOU FUTURES EXCHANGE TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU FUTURES EXCHANGE TECHNOLOGY CO LTD
Filing Date
2026-05-27
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In the testing of complex business systems, existing technologies using classification tree-based test case generation methods result in an excessive number of parameter units and test cases, impacting testing efficiency and requiring significant manual intervention.

Method used

By using a test case generation method based on classification trees, the display information configuration page receives the requirements document, parses and partitions it into equivalence classes, generates test cases, and automates the entire process through mind mapping. It also supports manual intervention and correction on the configuration page to optimize the number and coverage of test cases.

Benefits of technology

The entire process of test case generation has been automated, reducing manual intervention, optimizing the number of test cases, ensuring test coverage, and improving testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122332291A_ABST
    Figure CN122332291A_ABST
Patent Text Reader

Abstract

This application relates to the field of software testing technology, and in particular to a test case generation method and related equipment based on a classification tree. The method includes: displaying a first information configuration page including a requirements document upload area; receiving a requirements document through the requirements document upload area; parsing the requirements document to obtain input parameter items and output parameter items; performing equivalence class partitioning on the input parameter items and output parameter items; displaying a second information configuration page including the input parameter items and output parameter items; combining the input parameter items and output parameter items according to the types of the equivalence class partitioning to obtain parameter value combinations; generating several test cases based on the parameter value combinations; and generating a first mind map from the several test cases. This application can automate the entire test case generation process, supports manual intervention and correction on the configuration page, and can ensure test case coverage while optimizing the number of test cases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing technology, and in particular to a test case generation method and related equipment based on classification trees. Background Technology

[0002] In related technologies, there are methods for automatically generating test cases. These methods use classification trees to structurally decompose the input and output space of the object under test, extracting parameters and representative values ​​for combined testing. The classification tree categorizes the object under test according to different dimensions and decomposes it layer by layer until the smallest input parameter is extracted. This smallest parameter unit can then be used as structured data input to the test case generation tool, allowing the tool to combine these parameter units to form test cases. However, in practical applications, it has been found that when this method is applied to complex business system testing scenarios such as finance and telecommunications, where the completeness of test coverage is extremely important, the number of parameter units obtained from the decomposition is too large, resulting in an excessive number of generated test cases. Furthermore, many scenarios require manual intervention, impacting the testing efficiency of the application. Summary of the Invention

[0003] The main objective of this application is to propose a test case generation method and related equipment based on a classification tree, which can automate the entire process of test case generation, support manual intervention and correction through the configuration page, and ensure the coverage of test cases while optimizing the number of test cases.

[0004] To achieve the above objectives, one aspect of this application proposes a test case generation method based on a classification tree, the method comprising the following steps: Display a first information configuration page including a requirement document upload area, receive requirement documents through the requirement document upload area, and in response to a requirement document parsing request, parse the requirement document to obtain the input parameter items and the output parameter items; In response to the request to build a classification tree, the input parameter items and the output parameter items are divided into equivalence classes to obtain the input parameter items of valid equivalent input type, the input parameter items of invalid equivalent input type, the output parameter items of valid equivalent input type, and the output parameter items of invalid equivalent input type; Display a second information configuration page including the input parameter items and the output parameter items. In response to a parameter combination request, combine the input parameter items and the output parameter items according to the types divided by equivalence classes to obtain parameter value combinations. Several test cases are generated based on the combination of the parameter values, and a first mind map is generated from the several test cases.

[0005] In some embodiments, the step of performing equivalence class partitioning on the input parameter items and the output parameter items in response to a request to construct a classification tree includes: Configure the value range of the input parameter item and the output parameter item to obtain the valid value range and invalid value range of each input parameter item, and the valid value range and invalid value range of each output parameter item; The valid equivalent input value and invalid equivalent input value of the input parameter item are determined based on the valid value range and the invalid value range of the input parameter item; The valid equivalent output value and invalid equivalent output value of the input parameter item are determined based on the valid value range and the invalid value range of the output parameter item.

[0006] In some embodiments, the method further includes: displaying constraint items on the second information configuration page, the constraint items being used to configure the constraint relationships between the input parameter items and the output parameter items; The step of combining the input parameter items and the output parameter items according to the types of equivalence class partitioning includes: The constraint relationship is determined, and the input parameter item and the output parameter item are selected and combined according to the constraint relationship to obtain the parameter value combination.

[0007] In some embodiments, the second information configuration page displays a parameter combination strength item, and the input parameter item further includes key parameter types and non-key parameter types. The step of combining the input parameter items and the output parameter items according to the types of equivalence class partitioning includes: The type of the input parameter term is determined based on the input of the combined strength term of the parameters; The input parameter items of the critical parameter type are combined in a covering combination manner, and the input parameter items of the non-critical parameter type are combined in a sampling combination manner to obtain the parameter value combination.

[0008] In some embodiments, the method further includes: In response to the constraint update request, the second information configuration page with the said constraint item is displayed again; In response to the constraint update request, the new constraint item is obtained, and the execution steps are returned: select the parameters in the configuration parameter set according to the constraint item to determine the parameter value combination.

[0009] In some embodiments, after responding to a constraint update request, obtaining a new constraint item, and returning to the execution step: selecting parameters from the configuration parameter set based on the constraint item to determine the parameter value combination, the method further includes: Obtain several updated test cases, and update each branch of the functional verification node of the first mind map using the updated test cases to obtain the second mind map.

[0010] In some embodiments, parsing the requirement document to obtain the input parameter items and the output parameter items includes: The requirement document is parsed based on the mind map structure information. Structured text is extracted from the requirement document according to the mind map structure information. The descriptive text of each node in the first mind map is determined. The first mind map includes a preceding node and a verification function node. The branches connecting the verification function nodes include several test cases.

[0011] To achieve the above objectives, another aspect of this application proposes a test case generation apparatus based on a classification tree, the apparatus comprising: The requirement document parsing module is used to display a first information configuration page including a requirement document upload area, receive requirement documents through the requirement document upload area, and in response to a requirement document parsing request, parse the requirement document to obtain the input parameter items and the output parameter items. A classification tree construction module is used to respond to a classification tree construction request by performing equivalence class partitioning on the input parameter items and the output parameter items to obtain the input parameter items of valid equivalent input type, the input parameter items of invalid equivalent input type, the output parameter items of valid equivalent input type, and the output parameter items of invalid equivalent input type; The parameter value combination determination module is used to display a second information configuration page including the input parameter items and the output parameter items, and in response to the parameter combination request, combines the input parameter items and the output parameter items according to the type of equivalence class division to obtain the parameter value combination; The test case determination module is used to generate several test cases based on the parameter values, and to generate a first mind map using the several test cases.

[0012] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.

[0013] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0014] The embodiments of this application include at least the following beneficial effects: This application provides a test case generation method and related equipment based on a classification tree. This solution displays a first information configuration page including a requirement document upload area, receives requirement documents through the requirement document upload area, and in response to a requirement document parsing request, parses the requirement document to obtain the input parameter items and the output parameter items. In response to a classification tree construction request, it performs equivalence class partitioning on the input parameter items and the output parameter items to obtain the input parameter items of valid equivalent input types, the input parameter items of invalid equivalent input types, the output parameter items of valid equivalent input types, and the invalid equivalent input types. The input type's output parameter item displays a second information configuration page including the input parameter item and the output parameter item. In response to a parameter combination request, the input parameter item and the output parameter item are combined according to the type of equivalence class partitioning to obtain parameter value combinations. Several test cases are generated based on the parameter value combinations, and a first mind map is generated from the several test cases. In this way, the classification tree construction, test case generation, and mind map generation all achieve fully automated execution. Each step can be manually corrected through the configuration page, and the equivalence class partitioning method can ensure the coverage of test cases while optimizing the number of test cases. Attached Figure Description

[0015] Figure 1 This is an optional flowchart of the test case generation method based on classification tree provided in the embodiments of this application; Figure 2 A schematic diagram of the first information configuration page provided in an embodiment of this application; Figure 3 Another schematic diagram of the second information configuration page provided in the embodiments of this application; Figure 4 A flowchart of the response constraint update request method provided in the embodiments of this application; Figure 5 A flowchart illustrating the method for determining parameter value combinations provided in this application embodiment; Figure 6 This is a schematic diagram of a mind map in an embodiment of this application; Figure 7 This is a schematic diagram of the device provided in an embodiment of this application. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.

[0017] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”

[0018] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0020] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.

[0021] 1) A test case is a logical unit used to verify the functionality of a System Under Test (SUT). It typically includes an input vector, execution preconditions, expected output, and evaluation criteria. Mind maps are commonly used for expert review in test case evaluation. In the system constructed in this invention, test cases exist as structured nodes in the mind map and maintain a bidirectional traceability relationship with equivalence class nodes in the classification tree.

[0022] 2) Classification tree is a graphical modeling tool used for black-box testing. It is a visual tree model that uses a structured partitioning method to logically decompose and organize all input parameters and output results of the function under test after accurately analyzing the requirements document and module functions.

[0023] In related technologies, there are methods for automatically generating test cases. These methods use classification trees to structurally decompose the input and output space of the object under test, extracting parameters and representative values ​​for combined testing. The classification tree categorizes the object under test according to different dimensions and decomposes it layer by layer until the smallest input parameter is extracted. This smallest parameter unit can then be used as structured data input to a test case generation tool, allowing the tool to combine these parameter units to form test cases. However, in practical applications, it has been found that when this method is applied to complex business system testing scenarios such as finance and telecommunications, where the completeness of test coverage is extremely important, the number of parameter units obtained from the decomposition is too large, resulting in an excessive number of generated test cases and impacting the testing efficiency of the application.

[0024] In view of this, this application provides a test case generation method based on a classification tree. The method displays a mind map configuration page including mind map input items, where each input item includes information about various functional levels for a test scenario, and the mind map includes verification function information; displays a parameter information configuration page including a configuration parameter set, where the configuration parameter set includes input parameter items and output parameter items; in response to configuration operations on the input parameter items and output parameter items, constructs a classification tree based on the input parameter items and output parameter items; selects parameters from the configuration parameter set to determine parameter value combinations, and generates several test cases based on the parameter value combinations.

[0025] The test case generation method based on classification trees provided in this application relates to the field of information technology. This method can be applied to terminals, servers, or software running on either a terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the test case generation method based on classification trees, but is not limited to the above forms.

[0026] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0027] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.

[0028] Figure 1 This is an optional flowchart of the test case generation method based on classification tree provided in the embodiments of this application.

[0029] Figure 2 This is a schematic diagram of the parameter information configuration page provided in an embodiment of this application.

[0030] See Figure 1 , Figure 1 The method may include, but is not limited to, steps 101 to 103.

[0031] Step 101: Display a first information configuration page including a requirement document upload area; receive a requirement document through the requirement document upload area; respond to a requirement document parsing request; parse the requirement document to obtain the input parameter items and the output parameter items. See Figure 2Specifically, the front-end first information configuration page displays a requirement document upload area. The requirement document is uploaded to the requirement document upload area. The back-end receives the text description of the requirement document and parses out each verification point that needs to be tested, as well as the input and output space corresponding to the verification point, to form structured data.

[0032] It is understood that the parsing of the requirement document can call the API interface of the large language model, set prompt words, and extract the structured information of each verification function recorded in the requirement document. The parsing of the requirement document can also be performed using a preset rule base to extract the structured information of each verification function recorded in the requirement document according to the rules. The requirement document can also be a document containing structured information.

[0033] Step 102: In response to the request to build a classification tree, perform equivalence class partitioning on the input parameter items and the output parameter items to obtain the input parameter items of valid equivalent input type, the input parameter items of invalid equivalent input type, the output parameter items of valid equivalent input type, and the output parameter items of invalid equivalent input type; See Figure 2 The second parameter configuration page is used to configure the input and output parameters of the application's verification function. On this page, the input and output parameter items for the current verification function are obtained from the requirements document. When the user clicks the "Build Classification Tree" button, a request is sent to the backend. The backend performs equivalence class partitioning on the input and output parameter items, and displays the valid and invalid equivalence types of input and output parameter items respectively.

[0034] The classification tree not only displays the hierarchical affiliation, but also determines the parameter values ​​of each input and output by forcing equivalence partitioning, eliminating parameter value combinations with logical conflicts. This ensures both the coverage of test cases and optimizes the number of test cases.

[0035] It is understood that the classification tree determines several input values ​​and several output values ​​for the current input and output parameter items based on valid and invalid value ranges. Valid and invalid value ranges can be configured by calling the large language model API, using a preset rule base, or by manually inputting text.

[0036] Step 103: Display a second information configuration page including the input parameter items and the output parameter items. In response to the parameter combination request, combine the input parameter items and the output parameter items according to the type of equivalence class division to obtain parameter value combinations.

[0037] In step 103, the "invalid equivalence class" parameter value of the input parameter and the output parameter equal to "success" are logically conflicting combinations, because the "invalid equivalence class" parameter value will definitely generate an abnormal test case, which will definitely lead to the output parameter equal to "failure". Based on the aforementioned steps of equivalence partitioning of input and output parameter items, combining them according to the type of equivalence class partitioning can reduce the generation of useless test cases when using the combination algorithm.

[0038] Step 104: Generate several test cases based on the parameter value combination, and generate a first mind map using the several test cases.

[0039] In step 104, after determining several test cases, these test cases are inserted as branches of the last level of the first mind map to generate the first mind map. The text descriptions of the preceding topology nodes of the first mind map can be determined by parsing information from the requirements document, or by obtaining user input from a mind map configuration page.

[0040] Steps 101 to 104 as illustrated in this embodiment involve displaying a first information configuration page including a requirement document upload area, receiving a requirement document through the requirement document upload area, parsing the requirement document to obtain the input parameter items and the output parameter items in response to a requirement document parsing request, performing equivalence class partitioning on the input parameter items and the output parameter items in response to a classification tree construction request to obtain input parameter items of valid equivalent input types, input parameter items of invalid equivalent input types, output parameter items of valid equivalent input types, and output parameter items of invalid equivalent input types, displaying a second information configuration page including the input parameter items and the output parameter items, and combining the input parameter items and the output parameter items according to the equivalence class partitioning type in response to a parameter combination request to obtain parameter value combinations, generating several test cases based on the parameter value combinations, and generating a first mind map through the several test cases. In this way, the classification tree construction, test case generation, and mind map generation all achieve fully automated execution, and each step can be manually corrected through the configuration page. Moreover, the equivalence class partitioning method can ensure the coverage of test cases while optimizing the number of test cases.

[0041] In some embodiments, the step of performing equivalence class partitioning on the input parameter items and the output parameter items in response to a request to construct a classification tree specifically includes steps 201 to 204: Step 201: Configure the value range of the input parameter item and the output parameter item to obtain the valid value range and invalid value range of each input parameter item, and the valid value range and invalid value range of each output parameter item; Step 202: Determine the valid equivalent input value and invalid equivalent input value of the input parameter item based on the valid value range and the invalid value range of the input parameter item; Step 203: Determine the valid equivalent output value and invalid equivalent output value of the input parameter item based on the valid value range and invalid value range of the output parameter item.

[0042] In an example of the validation function for the "Current Price" field in a futures exchange's monitoring dashboard, the equivalence class partitioning results for the input and output parameters are as follows: 1. Query Date (D): Valid equivalence classes: D1 the current day, the latest transaction; D2 historical transaction days, the last transaction; Invalid equivalence classes: D3 non-trading days (such as weekends); D4 future dates.

[0043] 2. Contract Type (C): Effective Equivalent Classes: C1 Regular Contract; C2 Main Futures Contract; C3 Continuous Futures Contract; C4 Futures Index Contract.

[0044] 3. Current Price Display Results: Valid Equivalence Classes: R1 Current price is the corresponding transaction price, and the current price is greater than the previous closing price, displayed in red; R2 Current price is the corresponding transaction price, and the current price is equal to the previous closing price, displayed in gray; R3 Current price is the corresponding transaction price, and the current price is less than the previous closing price, displayed in green; Invalid Equivalence Classes: R4 displays "-".

[0045] Figure 3 A schematic diagram illustrating the second information configuration page in another embodiment is shown.

[0046] See Figure 3 The method further includes: displaying constraint items on the second information configuration page, wherein the constraint items are used to configure the constraint relationships between the input parameter items and the output parameter items; In this embodiment, combining the input parameter items and the output parameter items according to the type of equivalence class division includes: determining the constraint relationship, selecting the input parameter items and the output parameter items to combine according to the constraint relationship, and obtaining the parameter value combination.

[0047] For example, in the current price display verification example shown above, the constraint relationship is as follows: If [Contract Type C] = "Futures Index" then [Value and Color R] = "-"; if [query date D] in("non-trading days (e.g., weekends)" "future dates")then[value and color R]="-"; If [value and color R] = "-" then [query date D] in("non-trading days (e.g., weekends)", "future date"); In this embodiment, the constraint can be a constraint between input parameters or a constraint between input parameters and output parameters. By adding constraint relationships, unnecessary test cases can be avoided when generating test cases, thereby further optimizing the number of test cases.

[0048] In existing testing methods, mind maps are often lost to maintenance as requirements change, resulting in significant differences between the mind maps used in the design phase and the actual test documentation.

[0049] See Figure 4 In some embodiments, after step 104, the method further includes: Step 401: In response to the constraint update request, the second information configuration page with the constraint item is displayed again; Step 402: In response to the constraint update request, obtain the new constraint item and return to the execution step: select the parameters in the configuration parameter set according to the constraint item to determine the parameter value combination.

[0050] In this embodiment, when the requirements change and the futures main contract is required to also display "-", it is only necessary to change the constraint condition of "futures main contract" and "value and color" in the classification tree in the tool to the constraint condition statement of "futures main contract and - appear at the same time". At this time, only the constraint relationship between the input parameter value or the output parameter value changes, and the structure of the classification tree does not change. The backend automatically updates the test cases and synchronizes the updated test cases to the mind map and classification tree, realizing efficient synchronous maintenance of mind map, classification tree and test document.

[0051] In this embodiment, by adding an update request in the configuration page, when the requirements change, if only the constraint relationship item changes, a configuration entry point for the constraint relationship is provided to the user, supporting the user to reconfigure the constraint relationship.

[0052] In some embodiments, a pairing combination algorithm is run to generate a set of test cases that cover all pairwise interactions between parameters.

[0053] See Figure 5 In some embodiments, the second information configuration page displays a parameter combination strength item, and the input parameter item further includes key parameter types and non-key parameter types. The step of combining the input parameter item and the output parameter item according to the equivalence class partitioning to obtain a parameter value combination, in response to a parameter combination request, further includes steps 501 to 502: Step 501: Determine the type of the input parameter item based on the input of the parameter combination intensity item; Step 502: Combine the input parameter items of the key parameter type in a covering combination manner, and combine the input parameter items of the non-key parameter type in a sampling combination manner to obtain the parameter value combination.

[0054] In this embodiment, to balance coverage and the number of test cases, more test cases are generated for the input parameter items of the critical parameter type, while for parameters of non-critical parameter type, the number of test cases generated is reduced by sampling combination.

[0055] In one specific implementation, the value for key parameter types is defined as 1, and the value for non-key parameter types is defined as 2. A "mixed combination" strength is selected, with "{Contract Type, Query Date}@1, {Number and Color}@1". The strength within a group is 1, and the strength between groups defaults to 2. For example, in a user login scenario, "Login Method" (password login, verification code login) and the "Mobile Number" field (Chinese mobile number, US mobile number, empty mobile number, incorrectly formatted mobile number) are key parameters, and they are fully combined. "Network Type" (4G, 5G, WiFi) and "Login Device Brand" (Huawei mobile phone, Apple mobile phone, Xiaomi mobile phone) are non-key parameters, and they are either sampled or combined with a strength of 1. Finally, key and non-key parameters are combined with the default strength of 2 to generate test cases. This ensures that the test... Figure 6 This is a schematic diagram illustrating the mind map in the embodiments of this application.

[0056] See Figure 6 In some embodiments, parsing the requirement document to obtain the input parameter items and the output parameter items includes: The requirement document is parsed based on the mind map structure information. Structured text is extracted from the requirement document according to the mind map structure information. The descriptive text of each node in the first mind map is determined. The first mind map includes a preceding node and a verification function node. The branches connecting the verification function nodes include several test cases.

[0057] In this embodiment, by parsing the systems and modules in the requirements document, a standardized pre-order topology node is first established, from the requirement name to the system, module, and then to the first-level, second-level, and third-level functions. This structured constraint aims to establish a unified test asset index in the financial software field, ensuring that test models for different requirements are mergingable in both physical and logical dimensions, thereby constructing a global regression test resource pool. Then, test scenario (operation timing, permission verification, format verification, function implementation, and effective timing) nodes and specific verification point nodes corresponding to the requirements document in the test scenario are established, forming the first eight levels of node content in an XMind mind map format. By fully decomposing and refining the requirements document, the effectiveness and completeness of the test analysis are ensured, preventing "blind design" that deviates from the requirements document.

[0058] When test requirements change, the classification tree node information is updated, triggering automatic updates of test cases and synchronous backfilling to Xmind, ensuring consistency between the test design document and test cases. For example, in a user login test scenario, the original requirement stipulated that "password length is 6-12 characters," and the corresponding valid nodes in the classification tree were [6, 12]. When the requirement changes to "password length increased to 8-16 characters," the automatic change process is as follows: technical personnel only need to modify the parameter values ​​in the classification tree interface, and the system will automatically perform the following operations: 1. Node Correction: The parameter value node attribute for "Password" in the classification tree has been automatically updated from [6, 12] to [8, 16]. The parameter value branches for existing parameters such as "Login Method" and "Mobile Number" remain unchanged.

[0059] 2. Test Case Recalculation: The system recalculates the parameter values ​​of parameters such as "password", "login method" and "mobile phone number" to generate multiple new combined test cases.

[0060] 3. Mind Map Update: Through the API interface, the original test cases in XMind are updated to the latest combined test cases, and the branch is highlighted as "changed", ensuring the consistency between the design document and the latest requirements.

[0061] The following is a detailed explanation of the invention using the "current price" field in the market data display on the monitoring screen of a futures exchange as an example.

[0062] Step S1: Input / output space analysis of deep correlation requirements Step 1: Review the "Market Data Display Requirements Document" to determine the first eight levels of nodes in the mind map. The requirement name is "Market Data Display Requirements", the system is "Monitoring 2.0", the module is "Intelligent Application", the first-level function is "Market Data Display", the second-level function is "Futures Contract Market Data Summary", the test scenario is "Contract List", and the verification point is "Current Price".

[0063] Step 2: Review the "Market Data Display Requirements Document" to clarify the display logic of the "Current Price" field: Output parameters include one value and color (red indicates a price higher than yesterday's closing price, green indicates a price lower than yesterday's closing price); input parameters include two values: the query date and the contract type, both derived from the requirements. 1) Query Date: Depending on the needs, the large screen can display "real-time market data for the day" and "market data for a specific trading day in history".

[0064] 2) Contract Types: According to business rules, there are different contract types, including regular contracts, main futures contracts, continuous futures contracts, and futures indices. Their price display formats may differ and require additional constraints.

[0065] 3) Define the output: current price value and color. The current price is compared with the previous settlement price, and the result has three states: "greater than", "equal to", and "less than". The three states are represented by different colors.

[0066] Step S2: Constructing a classification tree based on equivalence class partitioning The above input and output parameters are divided into equivalence classes, and a classification tree is drawn: Query date (D): Valid equivalence classes: D1 is the latest transaction on the current day; D2 is the last transaction on a historical trading day.

[0067] Invalid equivalence classes: D3 Non-trading days (such as weekends); D4 Future dates.

[0068] Contract type (C): Effective equivalence classes: C1 Regular contracts; C2 Main futures contracts; C3 Continuous futures contracts; C4 Futures index contracts. Current price display results: Valid equivalence classes: R1 is the corresponding transaction price and is shown in red if the current price is greater than the previous closing price; R2 is the corresponding transaction price and is shown in gray if the current price is equal to the previous closing price; R3 is the corresponding transaction price and is shown in green if the current price is less than the previous closing price.

[0069] Invalid equivalence class: R4 displays "-".

[0070] Step S3: Automated Combination and Mind Map Filling In the integrated tool, the classification tree is graphically drawn according to step S2.

[0071] Step 1: Select the combination strength: To balance coverage and the number of use cases, select the "Mixed Combination" strength, "{Contract Type, Query Date}@1, "{Numbers and Colors}@1" sets the strength within a group to 1, and the strength between groups to 2 by default. It also adds constraints between the parameters; these constraints can be between input parameters or between input and output parameters.

[0072] Step 2: Automatic Tool Generation: The tool runs a pairwise combination algorithm to generate a set of test cases covering all pairwise interactions between parameters. For example, one test case might be: {Query Date: D1 (today), Price Change Direction: S2 (zero), Contract Type: T3 (commodity futures)} -> Expected Result.

[0073] Step 3: Automatic Backfilling to Xmind: The tool automatically creates a "Test Cases" branch in the Xmind file and inserts each generated test case, described in the above format or with more detailed steps, as a child node, alongside the "Classification Tree" branch. Simultaneously, the tool records the relationship between test cases {D1, C3, R1} and the three leaf nodes D1, C3, and R1 of the classification tree in the background (see...). Figure 3 ).

[0074] Step 4: This invention supports requirement-driven incremental updates. When test requirements change, the classification tree node information is updated, triggering automatic updates of test cases and synchronous backfilling to Xmind, ensuring consistency between the test design document and test cases. For example, in a user login test, the original requirement stipulated "password length 6-12 characters," and the corresponding valid nodes in the classification tree were [6, 12]. When the requirement changes to "password length increased to 8-16 characters," the automatic change process is as follows: Technical personnel only need to modify the boundary values ​​in the classification tree interface, and the system will automatically perform the following operations: Node Correction: The parameter value node attribute for "Password" in the classification tree has been automatically updated from [6, 12] to [8, 16]. The parameter value branches for existing parameters such as "Login Method" and "Mobile Number" remain unchanged.

[0075] Test Case Recalculation: The system recalculates the parameter values ​​of parameters such as "password", "login method" and "phone number" to generate multiple new combined test cases.

[0076] Mind map update: Through the API interface, the original test cases in XMind are updated to the latest combined test cases, and the branch is highlighted as "changed", ensuring the consistency between the design document and the latest requirements.

[0077] Maintenance: If requirements change and the futures main contract is required to also display "-", simply change the constraint condition of "futures main contract" and "value and color" in the category tree in the tool to the constraint condition statement of "futures main contract and - appear at the same time". The tool can automatically update the test cases in XMind and prompt testers to update the expected results, thus achieving efficient synchronous maintenance.

[0078] See Figure 7 This application also provides a test case generation device based on a classification tree, the device comprising: The requirement document parsing module is used to display a first information configuration page including a requirement document upload area, receive requirement documents through the requirement document upload area, and in response to a requirement document parsing request, parse the requirement document to obtain the input parameter items and the output parameter items. A classification tree construction module is used to respond to a classification tree construction request by performing equivalence class partitioning on the input parameter items and the output parameter items to obtain the input parameter items of valid equivalent input type, the input parameter items of invalid equivalent input type, the output parameter items of valid equivalent input type, and the output parameter items of invalid equivalent input type; The parameter value combination determination module is used to display a second information configuration page including the input parameter items and the output parameter items, and in response to the parameter combination request, combines the input parameter items and the output parameter items according to the type of equivalence class division to obtain the parameter value combination; The test case determination module is used to generate several test cases based on the parameter values, and to generate a first mind map using the several test cases.

[0079] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0080] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0081] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0082] This application also provides a hardware structure for an electronic device, which includes: The processor can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solutions provided in the embodiments of this application. The memory can be implemented in the form of read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory and called by the processor to execute the methods described in the embodiments of this application. Input / output interfaces are used to implement information input and output; The communication interface is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). A bus is used to transfer information between various components of a device, such as processors, memory, input / output interfaces, and communication interfaces. The processor, memory, input / output interfaces, and communication interfaces communicate with each other within the device via a bus.

[0083] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0084] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0085] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0086] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0087] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0088] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0089] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0090] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0091] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0092] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0093] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0095] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0097] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0098] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A test case generation method based on classification trees, characterized in that, The method includes the following steps: Display a first information configuration page including a requirement document upload area, receive requirement documents through the requirement document upload area, and in response to a requirement document parsing request, parse the requirement document to obtain the input parameter items and the output parameter items; In response to the request to build a classification tree, the input parameter items and the output parameter items are divided into equivalence classes to obtain the input parameter items of valid equivalent input type, the input parameter items of invalid equivalent input type, the output parameter items of valid equivalent input type, and the output parameter items of invalid equivalent input type; Display a second information configuration page including the input parameter items and the output parameter items. In response to a parameter combination request, combine the input parameter items and the output parameter items according to the types divided by equivalence classes to obtain parameter value combinations. Several test cases are generated based on the combination of the parameter values, and a first mind map is generated from the several test cases.

2. The test case generation method as described in claim 1, characterized in that, The step of responding to the request to build a classification tree by performing equivalence class partitioning on the input parameter items and the output parameter items includes: Configure the value range of the input parameter item and the output parameter item to obtain the valid value range and invalid value range of each input parameter item, and the valid value range and invalid value range of each output parameter item; The valid equivalent input value and invalid equivalent input value of the input parameter item are determined based on the valid value range and the invalid value range of the input parameter item; The valid equivalent output value and invalid equivalent output value of the input parameter item are determined based on the valid value range and the invalid value range of the output parameter item.

3. The test case generation method as described in claim 1, characterized in that, The method further includes: displaying constraint items on the second information configuration page, wherein the constraint items are used to configure the constraint relationships between the input parameter items and the output parameter items; The step of combining the input parameter items and the output parameter items according to the types of equivalence class partitioning includes: The constraint relationship is determined, and the input parameter item and the output parameter item are selected and combined according to the constraint relationship to obtain the parameter value combination.

4. The test case generation method as described in claim 1 or 3, characterized in that, The second information configuration page displays the parameter combination strength item. The input parameter item also includes key parameter types and non-key parameter types. The step of combining the input parameter items and the output parameter items according to the types of equivalence class partitioning includes: The type of the input parameter term is determined based on the input of the combined strength term of the parameters; The input parameter items of the critical parameter type are combined in a covering combination manner, and the input parameter items of the non-critical parameter type are combined in a sampling combination manner to obtain the parameter value combination.

5. The test case generation method as described in claim 3, characterized in that, The method further includes: In response to the constraint update request, the second information configuration page with the said constraint item is displayed again; In response to the constraint update request, the new constraint item is obtained, and the execution steps are returned: select the parameters in the configuration parameter set according to the constraint item to determine the parameter value combination.

6. The test case generation method as described in claim 1, characterized in that, In response to the constraint update request, after obtaining the new constraint item and returning to the execution step: after determining the parameter value combination by selecting parameters from the configuration parameter set based on the constraint item, the method further includes: Obtain several updated test cases, and update each branch of the functional verification node of the first mind map using the updated test cases to obtain the second mind map.

7. The test case generation method as described in claim 6, characterized in that, The process of parsing the requirement document to obtain the input parameter items and the output parameter items includes: The requirement document is parsed based on the mind map structure information. Structured text is extracted from the requirement document according to the mind map structure information. The descriptive text of each node in the first mind map is determined. The first mind map includes a preceding node and a verification function node. The branches connecting the verification function nodes include several test cases.

8. A test case generation device based on a classification tree, characterized in that, The device includes: The requirement document parsing module is used to display a first information configuration page including a requirement document upload area, receive requirement documents through the requirement document upload area, and in response to a requirement document parsing request, parse the requirement document to obtain the input parameter items and the output parameter items. A classification tree construction module is used to respond to a classification tree construction request by performing equivalence class partitioning on the input parameter items and the output parameter items to obtain the input parameter items of valid equivalent input type, the input parameter items of invalid equivalent input type, the output parameter items of valid equivalent input type, and the output parameter items of invalid equivalent input type; The parameter value combination determination module is used to display a second information configuration page including the input parameter items and the output parameter items, and in response to the parameter combination request, combines the input parameter items and the output parameter items according to the type of equivalence class division to obtain the parameter value combination; The test case determination module is used to generate several test cases based on the parameter values, and to generate a first mind map using the several test cases.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.