A large-model-enhanced intelligent design method for test scenarios

The intelligent design method of test scenarios enhanced by large models uses large models and reinforcement learning technology to automatically design test scenarios, solving the limitations of traditional testing methods in terms of complexity, efficiency and adaptability, and achieving a more efficient and intelligent test scenario. Test coverage and continuous optimization.

CN118035100BActive Publication Date: 2024-10-18BEIJING SPACEFLIGHT TUOPUGAO SCI & TECH CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410201127.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-23
Publication Date
2024-10-18
Estimated Expiration
2044-02-23

AI Technical Summary

Technical Problem

Traditional test scenario design methods have low efficiency, insufficient coverage, and lack of flexibility and intelligence in complex and dynamically changing system environments. They are difficult to adapt to rapidly changing development environments and cannot fully cover all possible operating scenarios, especially complex and unknown ones. scene.

Method used

Adopt the intelligent design method of test scenarios enhanced by large models, use the high-level language understanding and generation capabilities of large models to automatically design test scenarios, identify key patterns and fault points through the transformer architecture and self-attention mechanism, and combine Catalon Studio and testing The Orbit tool automatically generates test cases and uses reinforcement learning technology for continuous optimization.

Benefits of technology

Significantly improves the comprehensiveness, efficiency and intelligence of testing, can more accurately identify and simulate complex scenarios, improves test coverage and quality, achieves continuous optimization and adaptability of the test process, and reduces the time and time of manual test design Resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118035100B_ABST
    Figure CN118035100B_ABST
Patent Text Reader

Abstract

The present invention proposes a large model-enhanced test scenario intelligent design method, which belongs to the field of electronic engineering and computer science, and combines the high-level language understanding and generation capabilities of the large model to automate and optimize the creation process of the test scenario. The present invention first analyzes a large amount of historical data and existing test cases, and uses a deep learning algorithm to train the large model so that it can understand and simulate complex test environments. Then, the model is used to intelligently design new test scenarios that can more comprehensively cover potential system vulnerabilities and edge cases. The present invention can dynamically generate highly customized test scenarios according to specific test requirements and objectives. The present invention further adopts reinforcement learning technology to continuously improve the performance of the large model in test scenario design through a reward and punishment mechanism, and continuously optimizes the generation process of the test scenario through continuous learning and adaptation, which not only improves the efficiency and coverage of the test, but also significantly reduces the time and resources required for manual design of test scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the fields of electronic engineering and computer science, and in particular relates to a large-model enhanced test scenario intelligent design method. Background Art

[0002] In the field of software development, cybersecurity, and testing of artificial intelligence systems, the design of test scenarios is a key link. Effective test scenarios, that is, ensuring the stability and reliability of the system under various circumstances by simulating various actual operation scenarios, are the core of ensuring software quality. However, traditional test scenario design methods face many challenges and limitations.

[0003] First, traditional methods usually rely on manual processes in the design of test scenarios, which is not only time-consuming but also prone to overlooking edge cases. Manually designed test scenarios often fail to fully cover all possible operating scenarios, especially in complex and dynamically changing system environments. In addition, as the complexity of the system increases, the efficiency issues of manual design methods become more obvious.

[0004] Second, although existing automated testing tools can improve efficiency to a certain extent, they usually lack sufficient flexibility and intelligence. These tools often rely on predefined templates and rules, which limits their ability to handle unknown or complex scenarios. For example, they may not be able to effectively identify and test new vulnerability types or specific system behaviors.

[0005] Furthermore, current testing methods face challenges in the environment of continuous integration and continuous deployment (CI / CD). With the rapid iteration of development practices, testing methods need to be able to quickly adapt to code changes while ensuring test coverage and depth. However, existing methods are often cumbersome and insufficient when adapting to this rapidly changing environment.

[0006] Therefore, there is an urgent need to develop a new test scenario design method that can automatically and intelligently handle complex and changing test environments while improving the efficiency, accuracy, and comprehensiveness of testing. This new method should be able to leverage the latest machine learning techniques, especially the capabilities of large models, to innovatively solve the above problems. Summary of the invention

[0007] In order to solve the limitations of traditional software testing methods in terms of complexity, efficiency, coverage and adaptability, the present invention proposes a test scenario intelligent design method based on a large model, which uses the high-level language understanding and generation capabilities of the large model to automatically design test scenarios, thereby improving the comprehensiveness, efficiency and intelligence of the test.

[0008] The definition of test scenario is: Test scenario is a term used in the software testing process. It refers to the concept of a specific test case or test condition used to verify and evaluate whether the software system or component meets its design and requirement specifications. Test scenarios usually include a series of steps, expected results, and test parameters to simulate specific user interactions, system states, or operating environments to ensure the correctness, functionality, and performance of the software under various conditions. Through test scenarios, the functionality, reliability, and user experience of the software can be comprehensively checked to ensure its effectiveness and stability in actual applications.

[0009] In order to achieve the above object, the present invention adopts the following technical scheme:

[0010] A large model enhanced test scenario intelligent design method includes the following steps:

[0011] Step 1: obtain data, preprocess the obtained data, extract and analyze features, build a large model, train and optimize the large model, and determine whether the large model converges; if the large model converges, proceed to step 2; if the large model does not converge, continue to train and optimize the large model until it converges; select the transformer architecture as the core machine learning algorithm to build a large model, use the self-attention mechanism to handle long-distance dependency problems, and the large model is trained to identify key patterns, potential failure points, and specific test scenario descriptions in test cases;

[0012] Step 2: Combine the parameters of the software system and use the Katalon Studio tool and the test track tool to enable the large model to automatically generate more targeted test cases; use the rule-based code acceptance JS and the script generation engine of the Selenium integrated development environment to automatically generate test scripts based on the input, operation and expected results of the test case; use decision trees or cluster analysis to identify and construct edge cases, ensure the comprehensiveness of the test scenarios, and perform scenario coverage and optimization;

[0013] Step 3: Integrate Katalon Studio tools, test track tools and technologies into the popular test framework Selenium integrated development environment to achieve automated test execution and result collection; use monitoring tools and reporting tools to monitor test progress and effects in real time and generate detailed test reports;

[0014] Step 4: Use reinforcement learning technology to continuously optimize the test scenarios. The system evaluates the results of the executed test cases, and considers the test cases that successfully detect faults as positive feedback and the test cases that fail to effectively identify the problems as negative feedback. The reinforcement learning algorithm adjusts the test scenario generation strategy based on the positive or negative feedback to optimize the test case creation process.

[0015] Furthermore, in step one, the data comes from the software defect tracking system, which obtains information including error description, reproduction steps, repair status, etc. through JIRA; and from user feedback, which obtains user feedback on software functions, problem descriptions, and usage scenarios through the user support system Zendesk; and from the server and application log system, which records detailed operations and system status during software runtime through the ELK stack.

[0016] Furthermore, in the step 1, the preprocessing includes:

[0017] (1) Data cleaning: Use the data cleaning tool Talend to remove duplicate, erroneous, and incomplete records; and use the box plot method to identify and handle outliers;

[0018] (2) Use the text processing library NLTK or SpaCy to standardize the text data, including removing stop words, stemming, and part-of-speech tagging;

[0019] (3) Data encoding: Encode historical data and existing test cases using one-hot encoding technology; use word embedding technology for text data to convert text into numerical data that can be processed by machine learning models.

[0020] Furthermore, in the step 1, the training of the large model includes: using a large amount of historical test data, including successful test cases and failed test cases, to train the transformer architecture model; using a supervised learning method, taking the test scenarios and results in the historical data as training targets;

[0021] The optimization of the large model includes: using the cross-validation method to evaluate the generalization ability of the large model to ensure that it performs well on different types of test data; finding the best model configuration by adjusting the hyperparameters of the large model; the hyperparameters include the number of layers, the number of hidden units, and the number of attention heads; fine-tuning the large model on specific test scenario data to improve the accuracy and efficiency of the large model in a specific test environment.

[0022] Furthermore, in step 2, the parameters of the software system include API endpoints, user input range, and system configuration.

[0023] The beneficial effects of the present invention compared with the prior art are:

[0024] (1) The present invention improves the automation and intelligence level of test design: By using large models to automate the test design process, the present invention significantly reduces the need for manually writing test cases and scripts, and improves the efficiency and quality of test design. Intelligent design allows more accurate identification and simulation of complex test scenarios, especially those edge cases that are difficult to foresee or construct manually.

[0025] (2) The present invention significantly improves test coverage and comprehensiveness: Compared with traditional testing methods, the present invention can more comprehensively cover various possible operating scenarios, including those that are uncommon or difficult to predict. This helps to reveal potential software defects and problems, thereby improving the overall quality and stability of the software.

[0026] (3) The present invention enables continuous optimization of the test process: The present invention uses reinforcement learning technology to achieve self-learning and dynamic optimization of the test model. By continuously collecting test results and feedback, the system automatically adjusts the test case generation strategy to improve the accuracy and coverage of the test cases. This self-optimization mechanism not only ensures that the test process keeps pace with the continuous development and changes of the software, but also enhances the pertinence and depth of the test, thereby improving the effectiveness and adaptability of the overall test. In this way, the system can automatically identify and improve inefficient or invalid test cases, ensuring continuous improvement of test quality and efficiency.

[0027] (4) The present invention reduces the time and resource consumption associated with testing: Automated and intelligent test design significantly reduces the workload of manual test design, thereby saving a lot of time and resources. This is particularly important for a fast-iteration development environment, which can accelerate product time to market and respond to market changes.

[0028] In summary, the present invention adopts an advanced reinforcement learning framework to bring revolutionary changes to software testing. Through the reward and penalty mechanism, the system can learn from the test results and continuously adjust and optimize the test scenario generation strategy. The present invention can perform dynamic adaptation and continuous optimization: The core of the present invention is that it can achieve dynamic adaptation and continuous optimization of the test process. The system constantly adjusts the test cases according to the development and changes of the software to ensure that the test strategy is always synchronized with the latest status of the software. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A schematic diagram of a large-model enhanced test scenario intelligent design method of the present invention. DETAILED DESCRIPTION

[0030] The present invention is described in further detail below in conjunction with the accompanying drawings.

[0031] like Figure 1 As shown, a large model-enhanced test scenario intelligent design method of the present invention is implemented by a data analysis and model training module, a test case and script generation module, and a test execution and feedback module, and includes the following steps:

[0032] Step 1: Obtain data, preprocess the obtained data, extract and analyze features, build a large model, train and optimize the large model, and determine whether the large model converges;

[0033] Specifically, the data comes from the software defect tracking system, and information including error description, reproduction steps, repair status, etc. is obtained through JIRA; the data also comes from user feedback, and user feedback on software functions, problem descriptions, and usage scenarios are obtained through the user support system Zendesk; the data also comes from the server and application log system, and the detailed operations and system status of the software during runtime are recorded through the ELK (Elasticsearch, Logstash, Kibana) stack.

[0034] The pre-processing comprises:

[0035] (1) Data cleaning: Use the data cleaning tool Talend to remove duplicate, erroneous, and incomplete records; and use the boxplot method to identify and process outliers.

[0036] (2) Use the text processing library NLTK or SpaCy to standardize the text data, including removing stop words, stemming, and part-of-speech tagging.

[0037] (3) Data encoding: Encode non-numeric data from software defect tracking systems, user support systems, and server logs using the One-Hot Encoding technique; use word embedding technology (such as Word2Vec or BERT embedding) for text data to convert text into numerical data that can be processed by machine learning models.

[0038] Specifically, the construction of the large model includes: selecting the Transformer architecture as the core machine learning algorithm. Transformer is an advanced deep learning model that is particularly suitable for handling complex language understanding and generation tasks. It uses the self-attention mechanism to more effectively handle long-distance dependency problems, which is crucial for understanding complex test scenarios and requirements. The large model is trained to identify key patterns, potential failure points, and specific test scenario descriptions in test cases.

[0039] Specifically, the training process of the large model includes: using a large amount of historical test data, including successful and failed test cases, to train the Transformer model. Using supervised learning methods, the test scenarios and results in the historical data are used as training targets.

[0040] Specifically, the optimization strategies for large models include: using cross-validation methods to evaluate the generalization ability of the model to ensure that it performs well on different types of test data. Finding the best model configuration by adjusting the model's hyperparameters, such as the number of layers, number of hidden units, number of attention heads, etc. Fine-tuning the model on specific test scenario data to improve the accuracy and efficiency of the model in a specific test environment.

[0041] Step 2: Automatically generate test cases, write intelligent scripts, and perform scenario coverage and optimization:

[0042] Specifically, the automatic generation of test cases includes: combining parameters of the software system, such as API endpoints, user input range, system configuration, etc., using Katalon Studio and TestRail tools to enable the large model to generate more targeted test cases.

[0043] Specifically, the writing of the intelligent script includes: using the rule-based CodeceptJS (Code Acceptance JS) and Selenium IDE (Selenium Integrated Development Environment) script generation engine to automatically generate a test script according to the input, operation and expected results of the test case.

[0044] Specifically, the scenario coverage and optimization includes: using decision trees or cluster analysis to identify and construct edge cases to ensure the comprehensiveness of the test scenarios.

[0045] Step three: Integrate and automate tools, continuously monitor and report, perform automated testing, collect and analyze results, and provide feedback based on test results to continuously optimize test assumptions.

[0046] Specifically, the tool integration and automation include: integrating the above-mentioned tools and technologies such as Katalon Studio and TestRail into the popular testing framework Selenium to achieve automated test execution and result collection.

[0047] Specifically, the continuous monitoring and reporting includes: using the monitoring tool Prometheus and the reporting tool Kibana to monitor the test progress and effect in real time and generate detailed test reports.

[0048] Specifically, the automated test execution includes: combining the parameters of the software system, such as API endpoints, user input range, system configuration, etc., using Katalon Studio and TestRail tools to generate more targeted test cases for large models.

[0049] Specifically, the result collection and analysis includes: using the rule-based CodeceptJS (Code Acceptance JS) and Selenium IDE (Selenium Integrated Development Environment) script generation engine to automatically generate test scripts according to the input, operation and expected results of the test case.

[0050] Step 4: Use reinforcement learning technology to continuously optimize the test scenarios.

[0051] Specifically, step 4 adopts a reinforcement learning framework, in which the generation and execution result feedback of test cases are regarded as learning signals. The system adjusts its behavior according to the test results (such as whether the test case successfully reveals defects in the software) and optimizes the strategy for generating test cases. For example, if a test case successfully identifies a previously undiscovered software defect, this will be regarded as a positive feedback, encouraging the system to generate similar test cases in the future. On the contrary, if a test case fails to find any problems, this will be regarded as negative feedback, causing the system to adjust its strategy to avoid generating similar invalid test cases. This dynamic learning and adjustment process enables test cases to continuously adapt to software changes and emerging test requirements, ensuring the continuous optimization and effectiveness of the test process. In this way, the present invention continuously improves test coverage and accuracy, and effectively supports the continuous improvement of software quality. This learning cycle ensures that test assumptions continue to adapt to software changes and new test requirements, and improves test comprehensiveness and accuracy. The system integrates new data and feedback, continuously improves test strategies and models, and ensures that test cases are synchronized with software development trends and technical standards.

[0052] In summary, the present invention significantly improves the automation, intelligence and efficiency of the software testing process by combining large models and advanced data analysis technology. Through deep learning and analysis of a large amount of historical test data, the present invention can automatically generate test cases and scripts that fully cover various edge cases, greatly improving the coverage and accuracy of test scenarios. In addition, through continuous test execution and feedback mechanisms, the present invention can dynamically optimize test assumptions to ensure that the test process keeps pace with the development and changes of the software.

[0053] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in this field.

[0054] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A large-model enhanced test scenario intelligent design method, the test scenario ensures the stability and reliability of the system under various conditions by simulating various actual operation scenarios, characterized by: The steps include: Step 1: obtain data, preprocess the obtained data, extract and analyze features, build a large model, train and optimize the large model, and determine whether the large model converges; if the large model converges, proceed to step 2; if the large model does not converge, continue to train and optimize the large model until it converges; select the transformer architecture as the core machine learning algorithm to build a large model, use the self-attention mechanism to handle long-distance dependency problems, and the large model is trained to identify key patterns, potential failure points, and specific test scenario descriptions in test cases; Step 2: Combine the parameters of the software system and use the Katalon Studio tool and the Test Track tool to automatically generate more targeted test cases for the large model; use the script generation engine of the rule-based code acceptance JS and Selenium integrated development environment to automatically generate test scripts based on the input, operation and expected results of the test case; Use decision trees or cluster analysis to identify and construct edge cases to ensure comprehensiveness of test scenarios and to perform scenario coverage and optimization; Step 3: Integrate Katalon Studio tools, test track tools and technologies into the popular test framework Selenium integrated development environment to achieve automated test execution and result collection; use monitoring tools and reporting tools to monitor test progress and effects in real time and generate detailed test reports; Step 4: Use reinforcement learning technology to continuously optimize the test scenarios. The system evaluates the results of the executed test cases, and treats the test cases that successfully detect faults as positive feedback and the test cases that fail to effectively identify the problem as negative feedback. Reinforcement learning algorithms adjust test scenario generation strategies based on positive or negative feedback to optimize the test case creation process; The training of the large model includes: using a large amount of historical test data, including successful test cases and failed test cases, to train the transformer architecture model; using a supervised learning method, taking the test scenarios and results in the historical data as training targets; The optimization of the large model includes: using the cross-validation method to evaluate the generalization ability of the large model to ensure that it performs well on different types of test data; finding the best model configuration by adjusting the hyperparameters of the large model; the hyperparameters include the number of layers, the number of hidden units, and the number of attention heads; fine-tuning the large model on specific test scenario data to improve the accuracy and efficiency of the large model in a specific test environment.

2. The method for intelligent design of test scenarios enhanced by large models according to claim 1, characterized in that: In step 1, the data comes from the software defect tracking system, which includes error description, reproduction steps, and repair status obtained through JIRA; and from user feedback, which includes user feedback on software functions, problem descriptions, and usage scenarios obtained through the user support system Zendesk; As well as from the server and application log systems, through the ELK stack, record the detailed operations and system status when the software is running.

3. The method for intelligent design of test scenarios enhanced by large models according to claim 1, characterized in that: In the step 1, the preprocessing includes: (1) Data cleaning: Use the data cleaning tool Talend to remove duplicate, erroneous, and incomplete records; and use the box plot method to identify and handle outliers; (2) Use the text processing library NLTK or SpaCy to standardize the text data, including removing stop words, stemming, and part-of-speech tagging; (3) Data encoding: Encode historical data and existing test cases using one-hot encoding technology; use word embedding technology for text data to convert text into numerical data that can be processed by machine learning models.

4. A large model enhanced test scenario intelligent design method according to any one of claims 1 to 3, characterized in that: In the step 2, the parameters of the software system include API endpoints, user input range, and system configuration.

Citation Information

Patent Citations

  • Reinforcement learning-based mobile terminal application test method, device, equipment and medium

    CN111538668A

  • Software integration evaluation method based on machine learning and static analysis

    CN114490344A

  • Method and system for analyzing automatic test quality based on machine learning

    CN117407313A

  • Software function automatic test method and system, terminal and medium

    CN117421217A

  • Automatic test scenario generation

    US20210216442A1