Test case generation method and device, electronic equipment and readable storage medium

By acquiring rule text and data test request information, a rule knowledge graph is constructed, and path search and logical deduction are performed to generate test cases. This solves the problem of test dependence on human understanding and achieves more accurate system testing.

CN123138118APending Publication Date: 2026-11-20PING AN HEALTH INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611340374.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing technologies, functional response testing of projects relies on the testers' understanding, which leads to inaccurate testing.

Method used

By acquiring rule text and data test request information, we perform structured extraction and intent recognition to build a rule knowledge graph, perform path search and logical deduction, and generate test cases.

Benefits of technology

It enables intelligent test case generation without relying on testers' experience, improving the accuracy and objectivity of system testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138118A_ABST
    Figure CN123138118A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data testing, is applied to the financial technology and smart medical treatment scenes, and provides a test case generation method and device, an electronic equipment and a computer readable storage medium, the method comprises the following steps: performing structural extraction processing on a rule text to obtain a rule knowledge graph; performing intention recognition processing on data test request information to obtain data test intention information; performing intention analysis processing on the data test intention information to obtain a structured test target; performing path search processing on the rule knowledge graph according to the structured test target to obtain an inference operation path; performing logical deduction processing on the rule knowledge graph according to the structured test target to obtain a verification rule; and performing instantiation processing on the inference operation path and the verification rule to obtain a test case. Through the technical scheme, the test case can be intelligently constructed, the experience of human beings is not needed, and the accuracy of system testing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this application relate to, but are not limited to, the field of data testing technology, and are applied to financial technology and smart healthcare scenarios. In particular, they relate to a test case generation method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] With the continuous advancement of technology, various intelligent systems are increasingly being applied to our daily lives. For example, in the fintech field, various intelligent financial systems are being used to manage and process various financial transactions; similarly, in the smart healthcare field, various intelligent medical systems are being used to manage and coordinate various medical events. However, as society continues to develop, the demand for adding new projects to intelligent systems is also constantly increasing. But before using these projects, it is often necessary to test their functional responses. In the current technology, the generation of test cases for testing the functional responses of projects often relies on the testers' understanding of the project. However, each tester's understanding of the project will differ, which can easily lead to inaccurate testing. Summary of the Invention

[0003] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.

[0004] To address the issue mentioned in the background art that testing the functional response of a project often relies on the tester's understanding of the project, leading to inaccurate testing, this application provides a test case generation method, apparatus, electronic device, and computer-readable storage medium that can intelligently construct test cases without relying on human experience, thus significantly improving the accuracy of system testing.

[0005] In a first aspect, embodiments of this application provide a test case generation method, the test case generation method comprising: Obtain the rule text and data test request information; The rule text is subjected to structured extraction processing to obtain a rule knowledge graph; The data test request information is processed to identify the intent, thereby obtaining data test intent information; The data test intent information is processed by intent parsing to obtain structured test objectives; Based on the structured testing objective, the rule knowledge graph is subjected to path search processing to obtain the reasoning operation path; and based on the structured testing objective, the rule knowledge graph is subjected to logical deduction processing to obtain the verification rule. The inference operation path and the verification rule are instantiated to obtain the test cases.

[0006] Secondly, embodiments of this application also provide a test case generation apparatus, the test case generation apparatus comprising: The acquisition unit is used to acquire rule text and data test request information; An extraction unit is used to perform structured extraction processing on the rule text to obtain a rule knowledge graph; The identification unit is used to perform intent recognition processing on the data test request information to obtain data test intent information; The parsing unit is used to perform intent parsing processing on the data test intent information to obtain structured test targets; The execution unit is configured to perform path search processing on the rule knowledge graph according to the structured test objective to obtain a reasoning operation path; and to perform logical deduction processing on the rule knowledge graph according to the structured test objective to obtain a verification rule. An instantiation unit is used to instantiate the inference operation path and the verification rule to obtain the test case.

[0007] Thirdly, embodiments of this application also provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the test case generation method described in the first aspect above.

[0008] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions for executing the test case generation method described in the first aspect above.

[0009] The test case generation method according to the embodiments provided in this application has at least the following beneficial effects: In the process of generating test cases, rule text and data test request information are first obtained, then the rule text is subjected to structured extraction processing to obtain a rule knowledge graph; then the data test request information is subjected to intent recognition processing to obtain data test intent information; then the data test intent information is subjected to intent parsing processing to obtain a structured test objective; then, according to the structured test objective, the rule knowledge graph is subjected to path search processing to obtain a reasoning operation path; and, according to the structured test objective, the rule knowledge graph is subjected to logical deduction processing to obtain a verification rule; finally, the reasoning operation path and the verification rule are instantiated to obtain the corresponding test cases. The above technical solution, in the process of generating test cases, firstly, generates a rule knowledge graph based on the rule text, then determines the structured test objectives based on the data test request information; next, based on the structured test objectives, performs path search processing on the rule knowledge graph to obtain the inference operation path; according to the structured test objectives, performs logical deduction processing on the rule knowledge graph to obtain the verification rules; finally, instantiates the inference operation path and the verification rules to obtain the test cases. This eliminates the need to rely on testers' experience in the past, enabling intelligent test case generation, making the testing process more objective and reasonable, and significantly improving the accuracy of system testing. Attached Figure Description

[0010] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0011] Figure 1 This is a schematic diagram of an application environment for a test case generation method in one embodiment of this application; Figure 2 This is a flowchart illustrating a test case generation method provided in one embodiment of this application; Figure 3 yes Figure 2 A schematic diagram of a specific implementation method of step S200; Figure 4 yes Figure 2 A schematic diagram of a specific implementation of step S300; Figure 5 Is it completed? Figure 2 A flowchart illustrating a specific implementation method following step S600; Figure 6 yes Figure 5 A schematic diagram of a specific implementation of step S710; Figure 7 yes Figure 5 A schematic diagram of a specific implementation of step S720; Figure 8 yes Figure 7 A schematic diagram of a specific implementation of step S722; Figure 9 This is a schematic diagram of a test case generation apparatus provided in one embodiment of this application; Figure 10 This is a schematic diagram of an electronic device provided in one embodiment of this application. Detailed Implementation

[0012] 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 and not intended to limit the scope of this application.

[0013] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0014] It should be noted that, 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.

[0015] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0016] AI is a new technical science that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. Artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce new intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. Artificial intelligence can simulate the information processes of human consciousness and thought. Furthermore, artificial intelligence utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results—the theories, methods, technologies, and application systems available for use.

[0017] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0018] Artificial intelligence, or AI, is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0019] The servers involved in artificial intelligence technology can be standalone servers or cloud servers that provide 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, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0020] 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.

[0021] The test case generation method provided in this application embodiment can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can obtain rule text and data test request information from the client, then perform structured extraction processing on the rule text to obtain a rule knowledge graph; next, perform intent recognition processing on the data test request information to obtain data test intent information; then, perform intent parsing processing on the data test intent information to obtain structured test objectives; then, based on the structured test objectives, perform path search processing on the rule knowledge graph to obtain inference operation paths; and finally, perform logical deduction processing on the rule knowledge graph based on the structured test objectives to obtain verification rules; finally, instantiate the inference operation paths and verification rules to obtain the corresponding test cases. Through the above technical solution, in the process of generating test cases, firstly, a rule knowledge graph is generated based on the rule text; then, a structured test objective is determined based on the data test request information; next, based on the structured test objective, path search processing is performed on the rule knowledge graph to obtain the inference operation path; according to the structured test objective, logical deduction processing is performed on the rule knowledge graph to obtain the verification rule; finally, the inference operation path and the verification rule are instantiated to obtain the test case. This eliminates the need to rely on the tester's experience in the process of generating test cases, enabling intelligent generation of test cases, making the testing process more objective and reasonable, and significantly improving the accuracy of system testing. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The following detailed description of specific embodiments of this application is provided below.

[0022] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a test case generation method provided in one embodiment of this application. The test case generation method includes the following steps: Step S100: Obtain the rule text and data test request information.

[0023] The test case generation method provided in this application first obtains rule text during data processing, and then performs structured extraction processing on the rule text to obtain a relevant rule knowledge graph. In some embodiments of this application, the rule text is textual information used to represent various rules. For example, in the fintech field, rule text may include loan conditions, loan amount calculation rules, and precautions for purchasing financial products; in the smart healthcare field, rule text may include patient registration regulations on intelligent online registration systems, standardized requirements for hospital drug procurement, and standardized requirements for prescription inpatient management systems; or in the insurance business field, rule text may include insurance product underwriting requirements, relevant regulations for medical insurance reimbursement, and relevant preferential policies for insurance renewal.

[0024] It's worth noting that data testing request information can be text entered by the tester. In the fintech field, a data testing request might be something like, "Help me test if a user has non-performing assets, and be able to automatically identify and refuse their purchase of new financial products"; in the smart healthcare field, a data testing request might be something like, "Help me test if a drug does not meet procurement requirements, and be able to automatically identify and refuse to purchase the relevant drug."

[0025] It is worth noting that during the process of obtaining rule texts and data test request information, when it involves 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 always obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when this application embodiment needs to obtain sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after explicitly obtaining the user's separate permission or consent is the necessary user-related data for the normal operation of this application embodiment obtained.

[0026] Step S200: Perform structured extraction processing on the rule text to obtain a rule knowledge graph.

[0027] The test case generation method provided in this application, after obtaining the rule text and data test request information, can perform structured extraction processing on the rule text to obtain the relevant rule knowledge graph, providing a data foundation for subsequent test case generation.

[0028] It is worth noting that in the process of extracting rule text into a rule knowledge graph through structured extraction, the rule text is first processed by entity recognition to obtain multiple recognized entities; then, the rule text is processed by relation extraction to obtain relevant logical relation information; and finally, the rule text is processed by constraint query to obtain corresponding constraint query information. Finally, based on the multiple recognized entities, logical relation information, and constraint query information, the corresponding rule knowledge graph is constructed, thus preparing for test case generation.

[0029] It is worth noting that the rule knowledge graph is built based on the rule text, so the subsequent generation of test cases can be based on the rule knowledge graph to greatly improve the rationality of the generated test cases.

[0030] like Figure 3 As shown, performing structured extraction processing on the rule text to obtain a rule knowledge graph can include the following steps: Step S210: Perform entity recognition processing on the rule text to obtain multiple recognized entities; perform relation extraction processing on the rule text to obtain logical relation information; and perform constraint query processing on the rule text to obtain constraint query information. Step S220: Based on multiple identified entities, logical relationship information and constraint query information, a rule knowledge graph is constructed.

[0031] For steps S210 to S220, in the process of obtaining the rule knowledge graph by performing structured extraction processing on the rule text, entity recognition processing is performed on the rule text to obtain multiple recognized entities; relation extraction processing is performed on the rule text to obtain relevant logical relation information; constraint query processing is performed on the rule text to obtain corresponding constraint query information; finally, the corresponding rule knowledge graph can be constructed based on the obtained multiple recognized entities, logical relation information and constraint query information, in order to prepare for the subsequent generation of test cases.

[0032] It is worth noting that in the process of constructing a rule knowledge graph, the rule text is first processed by entity recognition to obtain the identified entities in multiple rule texts; then, the rule text is processed by relation extraction to determine the logical relationship information between each identified entity; the rule text also needs to be processed by constraint query to determine the constraint query information; finally, the corresponding rule knowledge graph can be constructed based on the obtained multiple identified entities, logical relationship information and constraint query information, in order to prepare for intelligent generation of test cases.

[0033] For example, in the fintech field, during the response testing of user loan conditions, the rule text stipulates that if a user has an overdue loan, they are not allowed to take out a new loan. Therefore, by performing entity recognition processing on the rule text, we can obtain identified entities such as "loan," "amount," and "repayment time." By performing relation extraction processing on the rule text, we can obtain logical relation information such as "AND," "exceed," and "otherwise." By performing constraint query processing on the rule text, we can obtain constraint query information such as "overdue," "prohibited from borrowing," and "reminder to repay within the deadline." Finally, based on the identified entities, logical relation information, and constraint query information, we can construct the corresponding rule knowledge graph. Alternatively, in the field of smart healthcare, during the review of clinical drug contraindications, the rule text might stipulate that a patient with a history of allergy to a certain type of drug is not allowed to be prescribed that drug. Therefore, entity recognition processing of this rule text can yield identifiable entities such as "patient," "drug," "allergy history," and "prescription." Relational extraction processing of this rule text can yield logical relational information such as "if," "exist," "not allowed," and "prescribe." Constraint query processing of this rule text can yield constraint query information such as "drug allergy," "prescription prohibited," and "alternative drug recommendation." Finally, based on the identified entities, logical relational information, and constraint query information, a corresponding rule knowledge graph can be constructed.

[0034] Step S300: Perform intent recognition processing on the data test request information to obtain data test intent information.

[0035] The test case generation method provided in this application, after performing structured extraction processing on the rule text to obtain a rule knowledge graph, can then perform intent recognition processing on the data test request information to obtain the corresponding data test intent information, thus preparing for subsequent test case generation.

[0036] It is worth noting that in the process of obtaining data test intent information by performing intent recognition processing based on the received data test request information, the data test request information is first segmented to obtain multiple data test request sub-fields; then, the pre-set intent tag set can be matched with the multiple data test request sub-fields to determine the target intent tag; then, the target intent tag can be determined as the corresponding target intent information.

[0037] It is worth noting that the intent tag set contains multiple intent tags. Based on the data test request subfield, the corresponding target intent tag can be matched from the multiple intent tags in the intent tag set. Subsequently, the target intent tag can be used as the data test intent information.

[0038] It is worth noting that receiving data test request information can include receiving test request text from testers. This test request text entered by testers can be used as data test request information to prepare for the subsequent determination of query intent information.

[0039] like Figure 4 As shown, the process of performing intent recognition processing based on the data test request information to obtain query intent information may include the following steps: Step S310: The data test request information is segmented to obtain multiple data test request subfields; Step S320: Perform field matching processing between the preset intent tag set and multiple data test request subfields to determine the target intent tag; Step S330: Determine the target intent label as data test intent information.

[0040] For steps S310 to S330, in the process of obtaining data test intent information through intent recognition processing based on the received data test request information, the data test request information is first segmented to obtain multiple data test request sub-fields; then, a pre-defined intent tag set is matched with the multiple data test request sub-fields to determine the target intent tag; finally, the target intent tag is identified as the corresponding data test intent information. Through the above technical solution, the determination of data test intent information can be made more accurate.

[0041] It is worth noting that the data test request information is segmented to obtain multiple data test request sub-fields, preparing for subsequent field matching processing. These segmented data test request sub-fields are then matched with a pre-defined set of intent tags to determine the corresponding target intent tags, thereby making the determination of the data test intent information more accurate.

[0042] For example, in the fintech field, a data testing request might be "Help me test if a user has non-performing assets, and be able to automatically identify and refuse their purchase of new financial products." In determining the query intent, the data testing request is first segmented to obtain multiple sub-fields. Then, a pre-defined set of intent tags and these sub-fields are matched to determine the target intent tag. Finally, the target intent tag is used as the corresponding data testing intent. Similarly, in the smart healthcare field, a data testing request might be "Help me test if a drug does not meet procurement requirements, and be able to automatically identify and refuse to purchase the relevant drug." In determining the query intent, the data testing request is first segmented to obtain multiple sub-fields. Then, a pre-defined set of intent tags and these sub-fields are matched to determine the target intent tag. Finally, the target intent tag is used as the corresponding data testing intent.

[0043] Step S400: Perform intent parsing processing on the data test intent information to obtain structured test objectives.

[0044] The test case generation method provided in this application performs structured extraction processing on rule text to obtain a rule knowledge graph; receives data test request information and performs intent recognition processing based on the data test request information to obtain data test intent information; then, it performs intent parsing processing on the data test intent information to obtain structured test targets, thereby providing a data foundation for subsequent path search and logical deduction processing of the rule knowledge graph.

[0045] It is worth noting that in the process of generating test cases by reasoning and planning the data test intent information based on the rule knowledge graph, the data test intent information is first parsed to obtain the structured test objective; then, based on the structured test objective, the rule knowledge graph is searched to obtain the reasoning operation path; and then, based on the structured test objective, the rule knowledge graph is logically deduced to obtain the corresponding verification rule; finally, the reasoning operation path and verification rule are instantiated to obtain the corresponding test cases. This technical solution makes the generation of test cases more accurate. Step S500: Based on the structured test objective, the rule knowledge graph is searched to obtain the reasoning operation path; and based on the structured test objective, the rule knowledge graph is logically deduced to obtain the verification rule.

[0046] The test case generation method provided in this application provides that, in the process of generating test cases, after determining the structured test objective, the method can perform path search processing on the obtained rule knowledge graph according to the structured test objective to obtain the corresponding reasoning operation path; and, it can also perform logical deduction processing on the rule knowledge graph according to the structured test objective to obtain the corresponding verification rules, thus preparing for subsequent test case generation.

[0047] It is worth noting that the inference operation path is used to limit the test steps of the subsequently generated test cases, and the verification rules are used to limit the verification rules of the subsequently generated test cases.

[0048] Step S600: Instantiate the inference operation path and verification rules to obtain test cases.

[0049] The test case generation method provided in this application involves performing path search processing on a rule knowledge graph based on structured testing objectives to obtain inference operation paths; and performing logical deduction processing on the rule knowledge graph based on structured testing objectives to obtain verification rules. After these steps, the obtained inference operation paths and verification rules can be instantiated to obtain corresponding test cases. This technical solution makes test case generation more reasonable and accurate.

[0050] It is worth noting that the test cases also include expected results. Based on these expected results, preparations can be made for subsequent result comparisons, making system testing simpler and faster. The expected results are the results expected to be in a normal response, used to prepare for subsequent result comparisons.

[0051] It is worth noting that in the process of generating test cases, the test intent information of the data is first parsed to obtain the structured test objective; then, based on the structured test objective obtained by parsing, the rule knowledge graph is processed by path search to obtain the reasoning operation path; and then, based on the structured test objective, the rule knowledge graph is processed by logical deduction to obtain the corresponding verification rules; finally, the reasoning operation path and verification rules are instantiated to obtain the corresponding test cases. Through the above technical solution, the generation of test cases can be more accurate.

[0052] For example, in the field of smart healthcare, the data test request information is "If a patient has a history of drug allergy, should the automatic prohibition of related drug dispensing be triggered?" In the process of generating corresponding test cases, the data test request information is first processed by intent parsing to obtain the corresponding structured test objective; then, according to the structured test objective, the rule knowledge graph of the medical field is processed by path search to determine the relevant reasoning operation path; and, according to the structured test objective, the rule knowledge graph of the medical field is processed by logical deduction to obtain the corresponding verification rules; finally, the reasoning operation path and verification rules are instantiated to obtain the corresponding test cases. Alternatively, in the fintech field, a data test request might ask, "If a user is added to a credit blacklist, should a loan be automatically blocked?" In generating corresponding test cases, the process begins by parsing the data test request to obtain the corresponding structured test objective. Next, based on the structured test objective, a path search is performed on the financial domain's rule knowledge graph to determine the relevant reasoning operation paths. Then, based on the structured test objective, logical deduction is performed on the financial domain's rule knowledge graph to obtain the corresponding verification rules. Finally, the reasoning operation paths and verification rules are instantiated to obtain the corresponding test cases.

[0053] like Figure 5 As shown, after instantiating the inference operation path and verification rules to obtain test cases, the following steps may also be taken, including but not limited to: Step S710: Construct intelligent test data based on test cases; and input the intelligent test data into a preset test system for test processing to obtain the original response results; wherein, the test cases contain the expected results; Step S720: Compare the original response results with the expected results to obtain the data test results.

[0054] The test case generation method provided in this application, once test cases are determined, can construct corresponding intelligent test data based on the test cases. Then, the obtained intelligent test data can be input into a pre-set test system for testing processing, thereby obtaining the corresponding raw response results. Subsequently, the obtained raw response results can be compared with the expected results in the test cases to obtain the corresponding data test results. Through the above technical solution, system testing becomes simpler, faster, and more accurate.

[0055] It is worth noting that in the process of constructing intelligent test data based on test cases, the test cases are first analyzed and processed to determine the corresponding test preconditions; then, based on the determined test preconditions, the corresponding intelligent test data is constructed from the pre-set test database to prepare for subsequent system testing.

[0056] It is worth noting that by inputting intelligent test data into a pre-set test system for test processing, a complete system test process can be simulated to determine whether the corresponding functional items in the system can respond correctly. By comparing the original response results obtained from the test with the expected results contained in the test cases, the corresponding data test results can be determined, making the testing of the corresponding functional items in the system simpler and faster.

[0057] The test case generation method provided in this application, after obtaining the original response results based on intelligent test data and a preset test system, can compare and process the original response results with the expected results in the test cases to determine the corresponding data test results. This technical solution makes testing the response of system functional items simpler and faster.

[0058] It is worth noting that in the process of comparing the original response result and the expected result to obtain the data test result, if the original response result is consistent with the expected result, the test can be considered normal; if the original response result is inconsistent with the expected result, the test can be considered abnormal. This technical solution makes the testing of system function responses simpler, faster, and more accurate. The expected result is the response result under normal circumstances when testing the system function; therefore, by comparing the obtained original response result with the expected result, the corresponding data test result can be quickly determined.

[0059] like Figure 6 As shown, constructing intelligent test data based on test cases can include the following steps: Step S711: Analyze and process the test cases to obtain the test preconditions; Step S712: Based on the pre-test conditions, construct intelligent test data from the preset test database.

[0060] For steps S711 to S712, in the process of constructing intelligent test data based on test cases, the test cases are first analyzed and processed to determine the corresponding test preconditions; then, based on the determined test preconditions, the corresponding intelligent test data is constructed from the pre-set test database to prepare for the subsequent input of the intelligent test data into the pre-set test system.

[0061] It is worth noting that in the process of constructing intelligent test data, the test cases are first analyzed and processed to determine the preconditions for the test cases; then, based on the preconditions, the corresponding intelligent test data can be constructed from the pre-set test database to provide a data foundation for subsequent simulation testing of system functions.

[0062] For example, in the fintech field, during the testing of a financial system, once test cases in the financial domain are identified, these test cases can be analyzed and processed to obtain pre-test conditions. Then, based on these pre-test conditions, corresponding intelligent data can be constructed from a pre-defined financial test database. Similarly, in the smart healthcare field, during the testing of a medical system, once test cases in the medical domain are identified, these test cases can be analyzed and processed to obtain pre-test conditions. Then, based on these pre-test conditions, corresponding intelligent data can be constructed from a pre-defined medical test database.

[0063] like Figure 7 As shown, comparing the original response results with the expected results to obtain the data test results can include the following steps: Step S721: If the original response result is consistent with the expected result, the test is considered normal as the data test result; Step S722: If the original response result is inconsistent with the expected result, the test anomaly is taken as the data test result.

[0064] For steps S721 to S722, during the process of comparing the original response result and the expected result to obtain the data test result, if the original response result is consistent with the expected result, the test can be considered normal; if the original response result is inconsistent with the expected result, the test can be considered abnormal. This technical solution makes the testing of system functional responses simpler and more accurate.

[0065] It is worth noting that the expected result is the response result under normal circumstances when testing the system's functional items. Therefore, by inputting the intelligent test data into the pre-set test system and comparing the original response result with the expected result, the corresponding data test result can be quickly determined. Through the above technical solution, the data testing process can be made more intelligent, faster and more accurate.

[0066] like Figure 8As shown, when the original response result is inconsistent with the expected result, after taking the test exception as the data test result, the test case generation method may also include, but is not limited to, the following steps: Step S7221: Compare the original response results with the expected results to determine the response difference information; Step S7222: The response difference information is analyzed and processed through a preset root cause analysis engine to obtain the anomaly analysis results.

[0067] For steps S7221 to S7222, when the original response result is inconsistent with the expected result, after taking the test anomaly as the data test result, the original response result and the expected result can be compared to determine the response difference information. Then, the response difference information can be analyzed and processed by the pre-set root cause analysis engine to obtain the anomaly analysis result. Through the above technical solution, the system test can be made safer and more reliable.

[0068] It is worth noting that in the event of test anomalies, the original response results and expected results can be compared and processed to identify response discrepancies. Then, the root cause analysis engine can be used to analyze and process the response discrepancies to obtain the corresponding anomaly analysis results, thereby improving the reliability and traceability of data testing and enhancing the accuracy of subsequent data testing.

[0069] To more clearly illustrate the technical solution of this application, a specific embodiment is provided below.

[0070] In the insurance business, the insurance business system first receives unstructured documents such as the "Product Terms" and "Underwriting Rules" uploaded by product managers. The core engine (large model) of the AI ​​agent model initiates the document parsing and semantic understanding process. It extracts the rules described in natural language (such as "diagnosed with type II diabetes," "age ≥ 55 years old," "insurance amount exceeding 500,000 yuan," and "mandatory manual underwriting") into a structured form, transforming them into a logically clear internal rule knowledge graph and decision tree model that the system can execute. This process includes: entity recognition (identifying entities such as "type II diabetes," "age," and "insurance amount"), relation extraction (identifying logical relations such as "and," "exceeds," and "otherwise"), and condition constraint mapping (mapping "≥ 55 years old" into numerical comparison conditions). The insurance business system successfully built a test logic model for the "chronic disease care" supplementary insurance and stored it in the rule knowledge base.

[0071] Next, the tester entered the following into the system's dialog interface: "Please help me test whether the system can correctly trigger the mandatory manual underwriting process for a 55-year-old customer diagnosed with type II diabetes who wants to purchase a coverage amount of 600,000 yuan under the 'Chronic Disease Care' supplementary insurance?" The AI ​​agent model received the natural language query, performed intent recognition (identified as a "test execution" task), and entity / condition extraction (extracting key parameters such as "age=55", "type II diabetes=yes", and "coverage amount=600,000 yuan"). Then, the AI ​​agent model combined the rule knowledge graph constructed in the above steps to perform reasoning planning, automatically understand the user's test objectives, and plan a complete test path: 1) Construct an insurance request data that meets the criteria of "55 years old, type II diabetes, and 600,000 yuan coverage amount"; 2) Simulate the system processing the request; 3) Check whether the system invoked the manual underwriting process and rejected automatic underwriting. The system automatically generated a structured, executable test case containing the test objective, preconditions, test data, and expected result ("The system should automatically reject the application and redirect to manual underwriting"), and provided feedback to the user: "We understand your testing requirements and will soon generate a test case to simulate a scenario where a 55-year-old type II diabetes patient applies for insurance with a coverage of 600,000. The expected result is that the system will automatically trigger the manual underwriting process." Next, based on the test cases generated in the above steps, the system calls the intelligent test data generation module. This module automatically constructs a virtual insurance application form in the test database that meets the preconditions, including all necessary fields such as name, age, ID number, health declaration (with type II diabetes checked), and insured amount (600,000). After the data construction is completed, the AI ​​agent model automatically calls the application programming interface of the tested system to initiate a real insurance application request and captures the system's returned result in real time (whether it is a successful underwriting or a rejection and redirection to a manual underwriting page or interface). After the system finishes execution, it captures the raw response data returned by the tested system, such as a JSON format response packet, where the message field value is "Based on your health condition and insured amount, manual underwriting is required."

[0072] The AI ​​agent model automatically compares the actual response captured in the above steps with the defined expected result ("automatically triggering the manual underwriting process"). If the result matches, it is judged as "passed". (Hypothetical scenario: If the system mistakenly passes the automatic underwriting directly and returns a test failure, it is judged as "failed"); (If it fails) further data processing: the system will start the root cause analysis engine, which will compare the test data, expected behavior, and actual behavior, and perform inference in conjunction with the rule knowledge graph. For example, it might analyze: "The expected outcome was mandatory manual underwriting, but it actually passed automatically. Possible reasons include: 1) The age condition in the code was incorrectly written as '>=56' years old; 2) The code omitted the combination judgment of 'coverage amount > 500,000'; 3) The 'diabetes' field in the health declaration did not correctly map to 'type II diabetes' in the rules." The system will provide the most likely root cause and include repair suggestions, such as "It is recommended that developers check the condition judgment logic for the 'chronic disease care' insurance in the rule engine module, especially the combination condition of age and coverage amount." Testers receive a clear feedback report, including "test passed" or "test failed." If it fails, the report not only points out the failure point but also includes a visual root cause analysis chain diagram and specific code logic modification suggestions, truly achieving an intelligent closed loop of "testing—diagnosis—repair."

[0073] Furthermore, one month after the product launch, the business department modified the rules for the "Chronic Disease Care" supplementary insurance to "age ≥ 60 years and coverage exceeding 400,000." Upon receiving the updated document, the system automatically initiated version comparison and impact analysis. The AI ​​agent model compared the new version's rule knowledge graph with the old version, discovering that the key thresholds had changed from "age ≥ 55" to "age ≥ 60," and "coverage > 500,000" to "coverage > 400,000." Subsequently, the system intelligently searched its test asset library and automatically identified that the test case generated in the above steps (age 55, coverage 600,000) no longer met the new boundary conditions.

[0074] The system proactively pushes a "Test Asset Maintenance Suggestion" message to testers: "Due to changes in the product rule 'Chronic Disease Care,' the following test case may be invalid or needs to be updated: TestCase_001 (55 years old, 600,000 coverage). It is recommended to update it to (Age=60, Coverage=410,000) to test the boundaries of the new rule; the system has generated an updated test case draft for you, please confirm." This achieves intelligent and semi-automated maintenance of test assets during version iterations, greatly reducing manual maintenance costs.

[0075] In addition, such as Figure 9 As shown, one embodiment of this application also provides a test case generation device 10, which includes: Acquisition unit 100 is used to acquire rule text and data test request information; Extraction unit 200 is used to perform structured extraction processing on rule text to obtain rule knowledge graph; The identification unit 300 is used to perform intent recognition processing on the data test request information to obtain data test intent information; The parsing unit 400 is used to perform intent parsing processing on the data test intent information to obtain the structured test target; The execution unit 500 is used to perform path search processing on the rule knowledge graph according to the structured test objectives to obtain the reasoning operation path; and to perform logical deduction processing on the rule knowledge graph according to the structured test objectives to obtain the verification rules. Instantiation unit 600 is used to instantiate inference operation paths and verification rules to obtain test cases.

[0076] The specific implementation of the test case generation device 10 is basically the same as the specific implementation of the test case generation method described above, and will not be repeated here.

[0077] In addition, such as Figure 10 As shown, one embodiment of this application also provides an electronic device 700, which includes: a memory 720, a processor 710, and a computer program stored on the memory 720 and executable on the processor 710.

[0078] The processor 710 and memory 720 can be connected via a bus or other means.

[0079] The non-transient software program and instructions required to implement the test case generation method of the above embodiments are stored in the memory 720. When executed by the processor 710, the test case generation method of each of the above embodiments is executed.

[0080] 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.

[0081] Furthermore, one embodiment of this application provides a computer-readable storage medium storing computer-executable instructions that are executed by a processor 710 or a controller, for example, by a processor 710 in the above-described device embodiment, causing the processor 710 to execute the test case generation method in the above-described embodiment.

[0082] The above embodiments can be used in combination, and modules with the same name in different embodiments may be the same or different.

[0083] The foregoing has described specific embodiments of this application; other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than those shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily have to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0084] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and computer-readable storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0085] The apparatus, device, computer-readable storage medium and method provided in the embodiments of this application are corresponding. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and computer storage medium will not be described again here.

[0086] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used when writing program development code. The original code before compilation must also be written in a specific programming language, which is called a Hardware Description Language (HDL). There is not just one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using the aforementioned hardware description languages ​​and programming it into an integrated circuit, the hardware circuit that implements the logic method flow can be easily obtained.

[0087] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0088] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0089] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, in implementing the embodiments of this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0090] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented 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.

[0091] This specification 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.

[0092] 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.

[0093] 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.

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

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

[0096] Computer-readable media includes 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 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.

[0097] 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 a process, method, article, or apparatus. Without further limitation, 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 said element.

[0098] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. 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 of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and 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.

[0099] The embodiments of this application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can reside in local and remote computer storage media, including storage devices.

[0100] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0101] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0102] The above description is merely an embodiment of this application and is not intended to limit 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 principle of this application should be included within the scope of the claims of this application.

Claims

1. A test case generation method, characterized in that, The test case generation method includes: Obtain the rule text and data test request information; The rule text is subjected to structured extraction processing to obtain a rule knowledge graph; The data test request information is processed to identify the intent, thereby obtaining data test intent information; The data test intent information is processed by intent parsing to obtain structured test objectives; Based on the structured testing objective, the rule knowledge graph is subjected to path search processing to obtain the reasoning operation path; and based on the structured testing objective, the rule knowledge graph is subjected to logical deduction processing to obtain the verification rule. The inference operation path and the verification rule are instantiated to obtain the test cases.

2. The test case generation method according to claim 1, characterized in that, The step of performing structured extraction processing on the rule text to obtain a rule knowledge graph includes: The rule text is subjected to entity recognition processing to obtain multiple recognized entities; the rule text is subjected to relation extraction processing to obtain logical relation information; and the rule text is subjected to constraint query processing to obtain constraint query information. The rule knowledge graph is constructed based on multiple identified entities, logical relationship information, and constraint query information.

3. The test case generation method according to claim 1, characterized in that, The process of performing intent recognition processing on the data test request information to obtain data test intent information includes: The data test request information is segmented to obtain multiple data test request sub-fields; The preset intent tag set is matched with multiple data test request subfields to determine the target intent tag. The target intent label is determined as the data test intent information.

4. The test case generation method according to claim 1, characterized in that, After instantiating the inference operation path and the verification rule to obtain the test case, the method further includes: Intelligent test data is constructed based on the test cases; and the intelligent test data is input into a preset test system for test processing to obtain the original response results; wherein, the test cases include the expected results; The original response result and the expected result are compared to obtain the data test result.

5. The test case generation method according to claim 4, characterized in that, The step of constructing intelligent test data based on the test cases includes: The test cases are analyzed and processed to obtain the test preconditions; The intelligent test data is constructed from a preset test database based on the aforementioned test preconditions.

6. The test case generation method according to claim 4, characterized in that, The step of comparing the original response result with the expected result to obtain the data test result includes: If the original response result is consistent with the expected result, the test is considered normal as the data test result; If the original response result is inconsistent with the expected result, the test anomaly will be taken as the data test result.

7. The test case generation method according to claim 6, characterized in that, The test case generation method further includes, after taking the test exception as the data test result when the original response result is inconsistent with the expected result: The original response result is compared with the expected result to determine the response difference information. The anomaly analysis results are obtained by analyzing and processing the response difference information through a preset root cause analysis engine.

8. A test case generation device, characterized in that, The test case generation device includes: The acquisition unit is used to acquire rule text and data test request information; An extraction unit is used to perform structured extraction processing on the rule text to obtain a rule knowledge graph; The identification unit is used to perform intent recognition processing on the data test request information to obtain data test intent information; The parsing unit is used to perform intent parsing processing on the data test intent information to obtain structured test targets; The execution unit is configured to perform path search processing on the rule knowledge graph according to the structured test objective to obtain a reasoning operation path; and to perform logical deduction processing on the rule knowledge graph according to the structured test objective to obtain a verification rule. An instantiation unit is used to instantiate the inference operation path and the verification rule to obtain the test case.

9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the test case generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the test case generation method according to any one of claims 1 to 7.