Test case generation method and device, computer equipment and storage medium

By receiving the business scenario description information input by users, using the target model for semantic analysis and generating test cases, the problem of inefficient test case generation in the existing technology is solved, efficient and intelligent test case generation is achieved, and technical threshold is lowered.

CN119645833AActive Publication Date: 2025-03-18PING AN BANK CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411577237.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-03-18
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

The existing automated testing tools and BDD tools have problems such as high technical barriers and difficulty in business personnel participation in financial business testing, resulting in inefficient test case generation.

Method used

By receiving the business scenario description information input by the user, the target model is used to perform semantic analysis, key information is generated, and this information is mapped to the preset structure based on the format of the target testing tool, information is integrated and optimized, and finally the target test case is generated and sent.

Benefits of technology

It improves the efficiency and intelligence of test cases, lowers the technical threshold, and allows business personnel with non-technical backgrounds to directly participate in the writing of test cases, and enhances the accuracy and compliance of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645833A_ABST
    Figure CN119645833A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence, and relates to a test case generation method and device, computer equipment and a storage medium, and the method comprises the steps: receiving business scene description information inputted by a user; inputting the business scene description information into the target large model, and performing semantic analysis on the business scene description information through the target large model to obtain key information; obtaining a target format corresponding to the target test tool; respectively mapping each piece of key information into a corresponding preset structure based on the target format to obtain a plurality of information structures; performing information integration processing on all the information structures to obtain an initial test case; performing optimization processing on the initial test case based on an optimization strategy to obtain a target test case; and sending the target test case to the user. In addition, the invention also relates to a block chain technology, and the target test case can be stored in a block chain. Based on the use of the target large model, the generation efficiency and the generation accuracy of the test case are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence development technology and the field of financial technology, and in particular to a test case generation method, device, computer equipment and storage medium. Background Art

[0002] In the field of financial testing, with the continuous development of technology and the increasing complexity of business needs, automated testing has become an important means to ensure the quality and stability of financial software. At present, there are a variety of automated testing tools and platforms on the market, such as Selenium, Appium, and Cypress, which have achieved automation of testing to a certain extent and greatly improved testing efficiency. However, most of the existing automated testing tools rely on manually written test scripts. Testers not only need to have high programming skills, but also need to have an in-depth understanding and proficiency in the testing tools used. This reliance on technical capabilities has limited the testing work to a certain extent due to the skill level of personnel, making it difficult to quickly adapt to rapidly changing business needs.

[0003] At present, although the BDD (Behavior Driven Development) methodology has been widely adopted and executable BDD test case writing has been implemented through tools such as Cucumber, it still faces technical obstacles and communication barriers in practical applications. The core idea of ​​BDD is to describe business requirements in natural language and convert them into executable test cases, thereby enhancing the communication efficiency between developers, testers and business personnel. However, although existing BDD tools support the use of natural language to write test cases, writing these test cases still requires a certain understanding of DSL (domain-specific language) such as Gherkin. This technical requirement limits the participation of business personnel with non-technical backgrounds, making it difficult for them to directly participate in the writing of test cases and unable to fully express their understanding of business requirements.

[0004] Therefore, the existing automated testing tools and platforms still have significant deficiencies in supporting financial business testing. On the one hand, the technical threshold is high and testers need to have high professional skills; on the other hand, the application of BDD tools is also limited by the requirements of DSL technology, which makes it difficult for business personnel to directly participate in the writing of test cases, resulting in low efficiency in the generation of test cases. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a test case generation method, apparatus, computer equipment and storage medium to solve the technical problem of low test case generation efficiency in the existing financial business testing process.

[0006] In order to solve the above technical problems, the present application embodiment provides a method for generating a test case, which adopts the following technical solution:

[0007] Receive business scenario description information input by the user;

[0008] Inputting the business scenario description information into a preset target macro model, and performing semantic analysis on the business scenario description information through the target macro model to obtain corresponding key information; wherein the number of the key information includes multiple;

[0009] Get the target format corresponding to the target test tool;

[0010] Based on the target format, each of the key information is mapped to a corresponding preset structure to obtain a plurality of corresponding information structures;

[0011] Performing information integration processing on all the information structures to obtain corresponding initial test cases;

[0012] Optimizing the initial test case based on a preset optimization strategy to obtain a corresponding target test case;

[0013] The target test case is sent to the user.

[0014] Furthermore, the step of optimizing the initial test case based on a preset optimization strategy to obtain a corresponding target test case specifically includes:

[0015] Performing specification matching processing on the initial test case to obtain a corresponding first test case;

[0016] Performing grammatical optimization processing on the first test case to obtain a corresponding second test case;

[0017] Performing format adjustment processing on the second test case to obtain a corresponding third test case;

[0018] The third test case is used as the target test case.

[0019] Furthermore, the step of sending the target test case to the user specifically includes:

[0020] Get the target output format;

[0021] Performing format conversion processing on the target test case based on the target output format to obtain a converted first target test case;

[0022] Get the preset data push method;

[0023] Based on the data pushing method, the first target test case is sent to the user.

[0024] Furthermore, after the step of optimizing the initial test case based on the preset optimization strategy to obtain the corresponding target test case, the method further includes:

[0025] Call up preset adjustment tools;

[0026] Based on the adjustment tool, obtaining specified market feedback data corresponding to the target test case from a preset market data source;

[0027] Filtering the specified market feedback data to obtain corresponding specified related data;

[0028] Adjust the target test case based on the specified relevant data to obtain an adjusted second target test case;

[0029] Performing verification processing on the second target test case;

[0030] If the second target test case passes the verification, the target test case is updated based on the second target test case.

[0031] Furthermore, after the step of optimizing the initial test case based on the preset optimization strategy to obtain the corresponding target test case, the method further includes:

[0032] Call the pre-built test environment;

[0033] Call the preset test execution engine;

[0034] In the test environment, the target test case is tested and processed based on the test execution engine, and test-related data during the test process is collected;

[0035] Analyze and process the test-related data to obtain corresponding data analysis results;

[0036] A target test report corresponding to the target test case is generated based on the data analysis result.

[0037] Furthermore, after the step of performing test processing on the target test case based on the test execution engine in the test environment and collecting test-related data during the test, the method further includes:

[0038] Call the preset monitoring tool;

[0039] Collecting performance indicators in the test process corresponding to the target test case based on the monitoring tool;

[0040] Analyzing and processing the performance indicators to obtain corresponding performance analysis results;

[0041] Based on the performance analysis result, the test strategy of the target test case is adjusted accordingly.

[0042] Furthermore, after the step of optimizing the initial test case based on the preset optimization strategy to obtain the corresponding target test case, the method further includes:

[0043] Obtaining a specified storage strategy corresponding to the target test case;

[0044] Determining a designated storage medium corresponding to the target test case;

[0045] The target test case is stored based on the specified storage strategy and the specified storage medium.

[0046] In order to solve the above technical problems, the embodiment of the present application also provides a test case generation device, which adopts the following technical solution:

[0047] A receiving module, used to receive business scenario description information input by a user;

[0048] A first analysis module is used to input the business scenario description information into a preset target macro model, and perform semantic analysis on the business scenario description information through the target macro model to obtain corresponding key information; wherein the number of the key information includes multiple;

[0049] A first acquisition module, used to acquire a target format corresponding to a target test tool;

[0050] A mapping module, used to map each of the key information to a corresponding preset structure based on the target format to obtain a plurality of corresponding information structures;

[0051] An integration module, used to perform information integration processing on all the information structures to obtain corresponding initial test cases;

[0052] An optimization module, used to optimize the initial test case based on a preset optimization strategy to obtain a corresponding target test case;

[0053] A sending module is used to send the target test case to the user.

[0054] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0055] Receive business scenario description information input by the user;

[0056] Inputting the business scenario description information into a preset target macro model, and performing semantic analysis on the business scenario description information through the target macro model to obtain corresponding key information; wherein the number of the key information includes multiple;

[0057] Get the target format corresponding to the target test tool;

[0058] Mapping each of the key information to a corresponding preset structure based on the target format to obtain a plurality of corresponding information structures;

[0059] Performing information integration processing on all the information structures to obtain corresponding initial test cases;

[0060] Optimizing the initial test case based on a preset optimization strategy to obtain a corresponding target test case;

[0061] The target test case is sent to the user.

[0062] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0063] Receive business scenario description information input by the user;

[0064] Inputting the business scenario description information into a preset target macro model, and performing semantic analysis on the business scenario description information through the target macro model to obtain corresponding key information; wherein the number of the key information includes multiple;

[0065] Get the target format corresponding to the target test tool;

[0066] Mapping each of the key information to a corresponding preset structure based on the target format to obtain a plurality of corresponding information structures;

[0067] Performing information integration processing on all the information structures to obtain corresponding initial test cases;

[0068] Optimizing the initial test case based on a preset optimization strategy to obtain a corresponding target test case;

[0069] The target test case is sent to the user.

[0070] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0071] The present application first receives the business scenario description information input by the user; then the business scenario description information is input into the preset target large model, and the business scenario description information is semantically analyzed by the target large model to obtain the corresponding key information; wherein the number of the key information includes multiple; then the target format corresponding to the target test tool is obtained; subsequently, each of the key information is mapped to the corresponding preset structure based on the target format to obtain multiple corresponding information structures; and all the information structures are processed for information integration to obtain the corresponding initial test case; further based on the preset optimization strategy, the initial test case is optimized to obtain the corresponding target test case; finally, the target test case is sent to the user. After receiving the business scenario description information input by the user, the present application can automatically convert the business scenario description information into an initial test case based on the target format corresponding to the target test tool through the use of the target large model, thereby improving the generation efficiency and intelligence of the test case. In addition, the initial test case will be optimized based on the optimization strategy to obtain the corresponding target test case, further improving the accuracy and compliance of the target test case. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0073] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0074] Figure 2 A flowchart of an embodiment of a method for generating a test case according to the present application;

[0075] Figure 3 is a structural schematic diagram of an embodiment of a test case generation device according to the present application;

[0076] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0077] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0078] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0079] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0080] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0081] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0082] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0083] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0084] It should be noted that the test case generation method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the test case generation device is generally set in the server / terminal device.

[0085] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0086] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for generating test cases according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The method for generating test cases provided in the embodiment of the present application can be applied to any scenario where test case generation is required, and the method for generating test cases can be applied to products in these scenarios, for example, test case generation in the financial insurance field. The method for generating test cases comprises the following steps:

[0087] Step S201: receiving business scenario description information input by a user.

[0088] In this embodiment, the test case generation method is executed on the electronic device (eg Figure 1The server / terminal device shown in the figure) can obtain the business scenario description information through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future. The executor of the present application may be a use case generation system with a built-in target large model, or simply referred to as a system. Users can use natural language to enter the business scenario description information corresponding to the test case to be generated in the front-end interface of the system, such as "buy a fund in the specified application for an amount of 10,000 yuan, select a robust risk level, and confirm the transaction.".

[0089] Step S202, input the business scenario description information into a preset target big model, perform semantic analysis on the business scenario description information through the target big model, and obtain corresponding key information; wherein the number of the key information includes multiple.

[0090] In this embodiment, there is no specific limitation on the selection of the target large model, which can be selected according to actual needs, for example, models such as GPT can be used. After the business scenario description information is input into the target large model, the target large model will use natural language processing technology (such as word segmentation, part-of-speech tagging, named entity recognition, etc.) to parse the input business scenario description information and identify key information points, such as application name (specified application), operation type (purchase fund), amount involved (10,000 yuan), risk level (robust type) and transaction confirmation and other key information.

[0091] Step S203, obtaining a target format corresponding to the target testing tool.

[0092] In this embodiment, the target test tool is specifically the Cucumber test tool. The target format is the BDD format (Given-When-Then) of the Cucumber test tool.

[0093] Step S204: Map each of the key information to a corresponding preset structure based on the target format to obtain a plurality of corresponding information structures.

[0094] In this embodiment, the target big model maps the extracted key information to the corresponding preset structure according to the BDD format (Given-When-Then) of Cucumber. The above preset structure may include at least Given structure, When structure, and Then structure. Specifically, Given part: the target big model generates Given statements (Given information structure) according to the preconditions of the business scenario, such as user login status, account balance, etc. For example, "the user has logged in to the specified application, and the account balance is greater than 10,000 yuan." When part: the target big model generates When statements (When information structure) according to the user's operation behavior, such as selecting a fund, entering an amount, selecting a risk level, etc. For example, "the user chooses to buy a fund, enters a purchase amount of 10,000 yuan, selects a risk level of robustness, and clicks to confirm the transaction." Then part: the AI ​​big model generates Then statements (Then information structure) according to the expected business results, such as successful purchase, account balance changes, and fund additions to the investment portfolio. For example, "the system should show that the purchase is successful, the account balance should be reduced by 10,000 yuan, and the user's investment portfolio should include the fund."

[0095] Step S205: performing information integration processing on all the information structures to obtain corresponding initial test cases.

[0096] In this embodiment, a complete initial test case can be formed by integrating the information contained in all information structures, for example, integrating the information of Given, When, and Then together.

[0097] Step S206, optimizing the initial test case based on a preset optimization strategy to obtain a corresponding target test case.

[0098] In this embodiment, the above-mentioned specific implementation process of optimizing the initial test case based on the preset optimization strategy to obtain the corresponding target test case will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated in detail here.

[0099] Step S207: sending the target test case to the user.

[0100] In this embodiment, the specific implementation process of sending the target test case to the user will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated on here.

[0101] The present application first receives the business scenario description information input by the user; then the business scenario description information is input into the preset target large model, and the business scenario description information is semantically analyzed by the target large model to obtain the corresponding key information; wherein the number of the key information includes multiple; then the target format corresponding to the target test tool is obtained; subsequently, each of the key information is mapped to the corresponding preset structure based on the target format to obtain multiple corresponding information structures; and all the information structures are processed for information integration to obtain the corresponding initial test case; further based on the preset optimization strategy, the initial test case is optimized to obtain the corresponding target test case; finally, the target test case is sent to the user. After receiving the business scenario description information input by the user, the present application can automatically convert the business scenario description information into an initial test case based on the target format corresponding to the target test tool through the use of the target large model, thereby improving the generation efficiency and intelligence of the test case. In addition, the initial test case will be optimized based on the optimization strategy to obtain the corresponding target test case, further improving the accuracy and compliance of the target test case.

[0102] In some optional implementations, step S206 includes the following steps:

[0103] The initial test case is subjected to specification matching processing to obtain a corresponding first test case.

[0104] In this embodiment, the format of the generated initial test case can be adjusted according to the specifications and requirements of the target test tool to make it conform to the specifications of the target test tool, thereby obtaining the corresponding first test case.

[0105] The first test case is subjected to grammatical optimization processing to obtain a corresponding second test case.

[0106] In this embodiment, the grammar in the first test case is optimized to make it more in line with the expression habits of natural language, which may include adjusting sentence structure, correcting spelling errors, replacing synonyms, etc., to improve the readability and usability of the test case.

[0107] The second test case is formatted to obtain a corresponding third test case.

[0108] In this embodiment, the second test case is formatted to ensure that it meets the format requirements of the target test tool. If the second test case is found to have format errors or non-compliance with the specification, further corresponding corrections will be made or the user will be prompted to make modifications, thereby obtaining a modified third test case.

[0109] The third test case is used as the target test case.

[0110] The present application performs specification matching processing on the initial test case to obtain a corresponding first test case; then performs syntax optimization processing on the first test case to obtain a corresponding second test case; then performs format adjustment processing on the second test case to obtain a corresponding third test case; and subsequently uses the third test case as the target test case. The present application performs specification matching processing, syntax optimization processing, and format adjustment processing on the initial test case, thereby realizing intelligent and efficient optimization processing of the initial test case, and then generating a target test case that meets the format specifications of the target test tool, effectively improving the standardization and accuracy of the generated target test case.

[0111] In some optional implementations of this embodiment, step S207 includes the following steps:

[0112] Get the target output format.

[0113] In this embodiment, there is no specific limitation on the selection of the above-mentioned target output format. Different output formats can be selected according to actual user needs or project requirements, for example, output formats such as Markdown, Word document, Excel table, etc. can be selected.

[0114] The target test case is format converted based on the target output format to obtain a converted first target test case.

[0115] In this embodiment, the target test case is converted into the target output format to obtain a converted first target test case.

[0116] Get the preset data push method.

[0117] In this embodiment, there is no specific limitation on the selection of the above data push method, for example, interface display, information push, SMS sending, etc. can be used.

[0118] Based on the data pushing method, the first target test case is sent to the user.

[0119] In this embodiment, the first target test case may be sent to the user in a data push manner.

[0120] This application obtains the target output format; then performs format conversion processing on the target test case based on the target output format to obtain the converted first target test case; then obtains the preset data push method; and subsequently sends the first target test case to the user based on the data push method. After generating a target test case corresponding to the business scenario description information based on the use of the target large model, this application intelligently performs format conversion processing on the target test case based on the use of the target output format to obtain the converted first target test case, and then sends the first target test case to the user based on the preset data push method, so that the user can use and read it conveniently, thereby improving the user's experience.

[0121] In some optional implementations, after step S206, the electronic device may further perform the following steps:

[0122] Invoke a preset adjustment tool.

[0123] In this embodiment, the above-mentioned adjustment tool can be specifically an adjustment tool based on ReAct technology. The rapid changes in the financial market require real-time response from the testing tool. The adjustment tool based on ReAct technology enables the system to adjust according to real-time feedback during the test process. For example, if the market data changes when executing the "fund purchase" test and the original purchase strategy is no longer applicable, the adjustment tool based on ReAct technology will automatically generate a new test case, adjust the purchase amount or fund selection, and ensure that the test case always conforms to the actual business logic. This dynamic adjustment capability makes the test process more flexible and able to cope with the complex and changing financial market environment.

[0124] Based on the adjustment tool, designated market feedback data corresponding to the target test case is obtained from a preset market data source.

[0125] In this embodiment, the above-mentioned market data sources may include financial trading platforms, market intelligence services, sales systems, etc.

[0126] The specified market feedback data is filtered to obtain corresponding specified related data.

[0127] In this embodiment, the specified market feedback data can be parsed and filtered to extract key data that is crucial to the test case adjustment, such as fund price changes, sales status changes, etc.

[0128] The target test case is adjusted based on the specified relevant data to obtain an adjusted second target test case.

[0129] In this embodiment, the target test case is adjusted by specifying relevant data, such as changing the purchase amount, selecting an alternative fund, etc., to ensure that the test case always complies with the actual business logic, thereby obtaining an adjusted second target test case.

[0130] In addition, since the original test cases cannot be executed due to market changes, the adjustment tool will generate new test cases to ensure the comprehensiveness and accuracy of the test.

[0131] The second target test case is verified.

[0132] In this embodiment, after the second target test case is obtained, the second target test case is further verified to ensure that its logic is correct, executable and meets expectations.

[0133] If the second target test case passes the verification, the target test case is updated based on the second target test case.

[0134] In this embodiment, after the second target test case passes the verification, the second target test case will be added to the test case library and replace the original target test case for subsequent testing.

[0135] This application calls a preset adjustment tool; and based on the adjustment tool, obtains the specified market feedback data corresponding to the target test case from the preset market data source; then filters the specified market feedback data to obtain the corresponding specified related data; then adjusts the target test case based on the specified related data to obtain the adjusted second target test case; subsequently verifies the second target test case; if the second target test case passes the verification, the target test case is updated based on the second target test case. This application calls an adjustment tool to obtain the specified market feedback data corresponding to the target test case from the market data source, and filters the specified market feedback data to obtain the specified related data, then adjusts the target test case based on the specified related data to obtain the adjusted second target test case, and then intelligently updates the target test case based on the second target test case when the second target test case passes the verification. This application can realize dynamic adjustment and real-time optimization of test cases based on the use of adjustment tools, effectively ensuring that test cases are always consistent with market changes and business logic, thereby improving the accuracy and comprehensiveness of the test.

[0136] In some optional implementations, after step S206, the electronic device may further perform the following steps:

[0137] Call the pre-built test environment.

[0138] In this embodiment, according to the actual test requirements, the test environment corresponding to the test work of the target test case is pre-configured, including the required test server, database, network configuration, etc. Among them, a monitoring tool based on Agent technology can be used to monitor and manage these resources to ensure that they are available and stable during the test process.

[0139] During the test execution process, the monitoring tool based on Agent technology acts as an intelligent agent to dynamically monitor and manage the test process. The monitoring tool can not only automatically allocate test resources, but also adjust the test strategy according to the real-time environment. For example, in the "fund purchase" scenario, the Agent will monitor the real-time changes in market data and adjust the test data or regenerate the test steps according to these changes to ensure the accuracy of the test results. In addition, the monitoring tool can also automatically adjust resource allocation according to the system load to ensure efficient execution of the test.

[0140] Call the preset test execution engine.

[0141] In this embodiment, the test execution engine is a pre-built engine responsible for automatically executing tests according to the steps and conditions defined in the test case.

[0142] In the test environment, the target test case is tested and processed based on the test execution engine, and test-related data during the test process is collected.

[0143] In this embodiment, during the test process of testing the target test case through the test execution engine, all relevant data are collected, including the execution results of the test steps, system logs, exception information, etc.

[0144] The test-related data are analyzed and processed to obtain corresponding data analysis results.

[0145] In this embodiment, the collected test-related data can be analyzed to identify successful steps and failed steps, and for failed steps, the failure causes are further analyzed, such as input errors, system defects, insufficient resources, etc., and then integrated to obtain corresponding data analysis results.

[0146] A target test report corresponding to the target test case is generated based on the data analysis result.

[0147] In this embodiment, the generated data analysis results can be filled into the pre-built test report template to obtain the target test report corresponding to the target test case. The filling process involves operations such as data screening, sorting, and summarizing to ensure that the report content is accurate and easy to understand. In addition, the above-mentioned test report template is pre-designed, including the structure, content, style, etc. of the report. And the template test report can be customized according to user needs and project characteristics.

[0148] This application calls a pre-built test environment; then calls a preset test execution engine; then in the test environment, based on the test execution engine, the target test case is tested and processed, and test-related data in the test process is collected; subsequently, the test-related data is analyzed and processed to obtain corresponding data analysis results; finally, a target test report corresponding to the target test case is generated based on the data analysis results. This application tests and processes the target test case in a pre-built test environment based on the use of a test execution engine, and collects test-related data in the test process, then analyzes and processes the test-related data to obtain corresponding data analysis results, and automatically generates a target test report corresponding to the target test case based on the data analysis results, thereby intelligently realizing the automation and intelligence of test execution and result analysis for the target test case, effectively improving test efficiency and quality, and providing strong support for project decision-making.

[0149] In some optional implementations of this embodiment, after the step of performing test processing on the target test case based on the test execution engine in the test environment and collecting test-related data during the test, the electronic device may further perform the following steps:

[0150] Call the preset monitoring tool.

[0151] In this embodiment, the monitoring tool may be a tool with monitoring function based on Agent technology.

[0152] Based on the monitoring tool, performance indicators in the test process corresponding to the target test case are collected.

[0153] In this embodiment, the monitoring tool collects key performance indicators (KPIs), such as page loading speed, network latency, and server response time, during the test process of using the test execution engine to test the target test case.

[0154] The performance indicators are analyzed and processed to obtain corresponding performance analysis results.

[0155] In this embodiment, the collected performance indicators can be analyzed and processed by using statistical analysis and machine learning techniques to evaluate performance bottlenecks and potential problems in the test process, identify abnormal behaviors or performance degradation trends, and then integrate them to obtain corresponding performance analysis results.

[0156] Based on the performance analysis result, the test strategy of the target test case is adjusted accordingly.

[0157] In this embodiment, a corresponding adjustment strategy can be formulated based on the obtained performance analysis results to deal with performance problems or resource bottlenecks. Among them, the adjustment strategy may include adjusting the waiting time, increasing the number of retries, changing the number of concurrent users, etc. The adjustment strategy is then automatically executed to make corresponding adjustments to the test strategy of the target test case. For example, if the page loading speed slows down, the monitoring tool will increase the waiting time or adjust the network configuration to reduce delays. Monitor the effect of the strategy adjustment to evaluate whether the performance has improved. In addition, if the adjustment is effective, the current strategy is maintained; if the effect is not good, the monitoring tool will try other strategies or make further adjustments. In addition, the monitoring tool can also collect feedback data during the adjustment process of the test strategy of the target test case to optimize future resource allocation and monitoring strategies.

[0158] This application calls a preset monitoring tool; then based on the monitoring tool, it collects the performance indicators in the test process corresponding to the target test case; then analyzes and processes the performance indicators to obtain corresponding performance analysis results; and subsequently, based on the performance analysis results, adjusts the test strategy of the target test case accordingly. In the test process of testing the target test case based on the test execution engine, this application will also intelligently collect the performance indicators in the test process corresponding to the target test case based on the use of the monitoring tool, and analyze and process the performance indicators to obtain performance analysis results, and then automatically adjust the test strategy of the target test case based on the obtained performance analysis results, so that intelligent management and resource optimization can be achieved in the test process of the target test case, effectively ensuring the efficient execution of the test process and the rational use of resources.

[0159] In some optional implementations of this embodiment, after step S206, the electronic device may further perform the following steps:

[0160] Get a specified storage policy corresponding to the target test case.

[0161] In this embodiment, the above-mentioned specified storage strategy may specifically adopt strategies such as cyclic overwriting or scheduled backup to ensure that the specified storage strategy will not be lost due to insufficient storage space.

[0162] Determine a designated storage medium corresponding to the target test case.

[0163] In this embodiment, there is no specific limitation on the selection of the above-mentioned designated storage medium, and it may include, for example, a local database, a file system, a cloud server, a blockchain, etc.

[0164] The target test case is stored based on the specified storage strategy and the specified storage medium.

[0165] In this embodiment, the target test case may be stored in the specified storage medium in a storage manner specified by a storage strategy.

[0166] The present application obtains the designated storage strategy corresponding to the target test case; then determines the designated storage medium corresponding to the target test case; and subsequently performs storage processing on the target test case based on the designated storage strategy and the designated storage medium. After automatically generating the target test case, the present application intelligently obtains the designated storage strategy corresponding to the target test case, determines the designated storage medium corresponding to the target test case, and then performs storage processing on the target test case based on the designated storage strategy and the designated storage medium, thereby ensuring the data security of the target test case and ensuring that the target test case will not be lost due to insufficient storage space, effectively improving the storage intelligence of the target test case.

[0167] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.

[0168] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.

[0169] In addition, this application combines AI big model, Agent and ReAct technology to provide an intelligent, dynamically adaptive financial business UI automation testing solution. It not only solves the shortcomings of existing technologies in dealing with complex financial scenarios, but also provides strong technical support for testing work in the financial industry by lowering technical barriers, improving testing efficiency and flexibility, and brings the following benefits:

[0170] 1) Lower technical threshold and improve collaboration efficiency: Traditional BDD tools require users to have certain programming skills. This invention generates natural language BDD test cases through AI big models, which significantly lowers the technical threshold and enables business personnel with non-technical backgrounds to directly participate in the writing and review of test cases. This approach not only improves the collaboration efficiency within the team, but also ensures that the test cases are highly consistent with actual business needs, reducing errors caused by poor communication.

[0171] 2) Improve test intelligence and flexibility: By introducing Agent technology, resource management and strategy adjustment in the test process have been improved in an intelligent way. Agent can not only automatically allocate and adjust test resources, but also respond dynamically according to the real-time environment. This is especially important in the financial field, because the rapid changes in the market require testing tools to adjust test content in a timely manner to reflect the actual situation. For complex financial business scenarios, Agent's intelligent management ensures the efficiency and flexibility of the test process.

[0172] 3) Dynamic response to changes in financial markets: Financial markets are changing rapidly, and traditional testing tools often have difficulty coping with changes in real-time data. The ReAct technology in this invention enables the system to adjust according to real-time feedback during the test process. For example, in the fund purchase test scenario, ReAct can automatically adjust the test steps according to changes in the fund market to ensure that the test cases are always valid and accurate. This dynamic adjustment capability enables the test system to adapt to the rapid changes in the financial market and ensure the reliability and consistency of the test results.

[0173] 4) Enhance the comprehensiveness and business consistency of testing: By deeply integrating financial business logic and test cases generated by AI big models, the comprehensiveness and business consistency of testing are ensured. In the fund purchase test scenario, the system can automatically generate test cases covering various business processes and adjust them in real time according to market changes. This high level of business consistency ensures that the test results can truly reflect the business process and help discover potential risks and system vulnerabilities.

[0174] 5) Improve test efficiency and shorten development cycle: Traditional test processes often take a lot of time to write, adjust and execute test cases, while the present invention significantly improves test efficiency through automated generation and intelligent management. Especially in the financial industry, time is money. By shortening the test cycle and increasing test coverage, the present invention can help financial institutions bring products to market faster while ensuring product quality and compliance.

[0175] In summary, the application of this application in the field of financial testing not only solves the shortcomings of existing technologies, but also significantly improves the efficiency, flexibility and accuracy of testing through intelligent, dynamic adjustment and automated generation. This innovative solution provides financial institutions with a powerful and efficient testing tool that can better cope with complex business scenarios and rapidly changing market demands.

[0176] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0177] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target test cases, the above-mentioned target test cases can also be stored in a node of a blockchain.

[0178] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0179] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (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 knowledge to obtain the best results.

[0180] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0182] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0183] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a test case generation device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0184] like Figure 3 As shown, the test case generation device 300 described in this embodiment includes: a receiving module 301, a first analysis module 302, a first acquisition module 303, a mapping module 304, an integration module 305, an optimization module 306 and a sending module 307. Among them:

[0185] Receiving module 301, used to receive business scenario description information input by a user;

[0186] The first analysis module 302 is used to input the business scenario description information into a preset target macro model, and perform semantic analysis on the business scenario description information through the target macro model to obtain corresponding key information; wherein the number of the key information includes multiple;

[0187] A first acquisition module 303, used to acquire a target format corresponding to a target test tool;

[0188] A mapping module 304 is used to map each of the key information to a corresponding preset structure based on the target format to obtain a plurality of corresponding information structures;

[0189] An integration module 305 is used to perform information integration processing on all the information structures to obtain corresponding initial test cases;

[0190] The optimization module 306 is used to optimize the initial test case based on a preset optimization strategy to obtain a corresponding target test case;

[0191] The sending module 307 is used to send the target test case to the user.

[0192] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the test case generation method in the above-mentioned implementation mode, and will not be repeated here.

[0193] In some optional implementations of this embodiment, the optimization module 306 includes:

[0194] A first processing submodule, configured to perform specification matching processing on the initial test case to obtain a corresponding first test case;

[0195] A second processing submodule, configured to perform syntax optimization processing on the first test case to obtain a corresponding second test case;

[0196] A third processing submodule, configured to perform format adjustment processing on the second test case to obtain a corresponding third test case;

[0197] A determination submodule is used to use the third test case as the target test case.

[0198] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the test case generation method in the above-mentioned implementation mode, and will not be repeated here.

[0199] In some optional implementations of this embodiment, the sending module 307 includes:

[0200] A first acquisition submodule is used to acquire a target output format;

[0201] A conversion submodule, configured to perform format conversion processing on the target test case based on the target output format to obtain a converted first target test case;

[0202] The second acquisition submodule is used to acquire a preset data push method;

[0203] A sending submodule is used to send the first target test case to the user based on the data push method.

[0204] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the test case generation method in the above-mentioned implementation mode, and will not be repeated here.

[0205] In some optional implementations of this embodiment, the test case generating device further includes:

[0206] A first calling module is used to call a preset adjustment tool;

[0207] A second acquisition module is used to acquire, based on the adjustment tool, specified market feedback data corresponding to the target test case from a preset market data source;

[0208] A filtering module, used to filter the specified market feedback data to obtain corresponding specified related data;

[0209] A first adjustment module, configured to adjust the target test case based on the specified relevant data to obtain an adjusted second target test case;

[0210] A verification module, used for verifying the second target test case;

[0211] An updating module is used to update the target test case based on the second target test case if the second target test case passes the verification.

[0212] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the test case generation method in the above-mentioned implementation mode, and will not be repeated here.

[0213] In some optional implementations of this embodiment, the test case generating device further includes:

[0214] The second calling module is used to call the pre-built test environment;

[0215] The third calling module is used to call a preset test execution engine;

[0216] A test module, used to perform test processing on the target test case based on the test execution engine in the test environment, and collect test-related data during the test process;

[0217] A second analysis module is used to analyze and process the test related data to obtain corresponding data analysis results;

[0218] A generating module is used to generate a target test report corresponding to the target test case based on the data analysis result.

[0219] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the test case generation method in the above-mentioned implementation mode, and will not be repeated here.

[0220] In some optional implementations of this embodiment, the test case generating device further includes:

[0221] The fourth calling module is used to call a preset monitoring tool;

[0222] A collection module, used for collecting performance indicators in the test process corresponding to the target test case based on the monitoring tool;

[0223] A third analysis module is used to analyze and process the performance indicators to obtain corresponding performance analysis results;

[0224] The second adjustment module is used to adjust the test strategy of the target test case accordingly based on the performance analysis result.

[0225] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the test case generation method in the above-mentioned implementation mode, and will not be repeated here.

[0226] In some optional implementations of this embodiment, the test case generating device further includes:

[0227] A third acquisition module is used to acquire a specified storage strategy corresponding to the target test case;

[0228] A determination module, used to determine a designated storage medium corresponding to the target test case;

[0229] A storage module is used to store the target test case based on the specified storage strategy and the specified storage medium.

[0230] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the test case generation method in the above-mentioned implementation mode, and will not be repeated here.

[0231] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0232] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0233] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0234] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the test case generation method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0235] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the test case generation method.

[0236] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0237] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the test case generation method as described above.

[0238] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0239] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A method for generating a test case, characterized in that: The steps include: Receive business scenario description information input by the user; Inputting the business scenario description information into a preset target macro model, and performing semantic analysis on the business scenario description information through the target macro model to obtain corresponding key information; wherein the number of the key information includes multiple; Get the target format corresponding to the target test tool; Based on the target format, each of the key information is mapped to a corresponding preset structure to obtain a plurality of corresponding information structures; Performing information integration processing on all the information structures to obtain corresponding initial test cases; Optimizing the initial test case based on a preset optimization strategy to obtain a corresponding target test case; The target test case is sent to the user.

2. The method for generating a test case according to claim 1, characterized in that: The step of optimizing the initial test case based on a preset optimization strategy to obtain a corresponding target test case specifically includes: Performing specification matching processing on the initial test case to obtain a corresponding first test case; Performing grammatical optimization processing on the first test case to obtain a corresponding second test case; Performing format adjustment processing on the second test case to obtain a corresponding third test case; The third test case is used as the target test case.

3. The method for generating a test case according to claim 1, characterized in that: The step of sending the target test case to the user specifically includes: Get the target output format; Performing format conversion processing on the target test case based on the target output format to obtain a converted first target test case; Get the preset data push method; Based on the data pushing method, the first target test case is sent to the user.

4. The method for generating a test case according to claim 1, characterized in that: After the step of optimizing the initial test case based on the preset optimization strategy to obtain the corresponding target test case, the method further includes: Call up preset adjustment tools; Based on the adjustment tool, obtaining the specified market feedback data corresponding to the target test case from a preset market data source; Filtering the specified market feedback data to obtain corresponding specified related data; Adjust the target test case based on the specified relevant data to obtain an adjusted second target test case; Performing verification processing on the second target test case; If the second target test case passes the verification, the target test case is updated based on the second target test case.

5. The method for generating a test case according to claim 1, characterized in that: After the step of optimizing the initial test case based on the preset optimization strategy to obtain the corresponding target test case, the method further includes: Call the pre-built test environment; Call the preset test execution engine; In the test environment, the target test case is tested and processed based on the test execution engine, and test-related data during the test process is collected; Analyze and process the test-related data to obtain corresponding data analysis results; A target test report corresponding to the target test case is generated based on the data analysis result.

6. The method for generating a test case according to claim 5, characterized in that: After the step of performing test processing on the target test case based on the test execution engine in the test environment and collecting test-related data during the test, the method further includes: Call the preset monitoring tool; Collecting performance indicators in the test process corresponding to the target test case based on the monitoring tool; Analyzing and processing the performance indicators to obtain corresponding performance analysis results; Based on the performance analysis result, the test strategy of the target test case is adjusted accordingly.

7. The method for generating a test case according to claim 1, characterized in that: After the step of optimizing the initial test case based on the preset optimization strategy to obtain the corresponding target test case, the method further includes: Obtaining a specified storage strategy corresponding to the target test case; Determining a designated storage medium corresponding to the target test case; The target test case is stored based on the specified storage strategy and the specified storage medium.

8. A test case generation device, characterized in that: include: A receiving module, used to receive business scenario description information input by a user; A first analysis module is used to input the business scenario description information into a preset target macro model, and perform semantic analysis on the business scenario description information through the target macro model to obtain corresponding key information; wherein the number of the key information includes multiple; A first acquisition module, used to acquire a target format corresponding to a target test tool; A mapping module, used to map each of the key information to a corresponding preset structure based on the target format to obtain a plurality of corresponding information structures; An integration module, used to perform information integration processing on all the information structures to obtain corresponding initial test cases; An optimization module, used to optimize the initial test case based on a preset optimization strategy to obtain a corresponding target test case; A sending module is used to send the target test case to the user.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the test case generation method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the test case generation method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Automatic test case generation device based on large language model

    CN117806980A

  • Program automatic testing method, device, storage medium and electronic equipment

    CN118069509A

  • Test case generation method and system, electronic equipment and storage medium

    CN118642960A

  • Page function testing method and related device

    WO2020233034A1