Modular software testing method and system based on RPA and large model

The modular software testing method using RPA and large models addresses inefficiencies in traditional testing by automating script generation and data analysis, enhancing testing efficiency and accuracy while reducing costs.

CN119718932APending Publication Date: 2025-03-28NAT INNOVATION INST OF DEFENSE TECH PLA ACAD OF MILITARY SCI
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411821851.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Traditional software testing methods are inefficient and costly, struggling to cover all execution paths and usage scenarios due to resource and time constraints, especially in complex software systems with multiple interdependent modules, leading to inaccurate results and high testing costs.

Method used

A modular software testing method and system utilizing Robotic Process Automation (RPA) and large models, which captures and analyzes user interactions to generate comprehensive automated test scripts, integrating data collection for report generation and feedback, thereby reducing manual effort and enhancing testing efficiency and accuracy.

Benefits of technology

This approach significantly shortens testing cycles, improves coverage of software functionalities, ensures accurate and independent module testing, and reduces human and time costs, effectively addressing the limitations of traditional testing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718932A_ABST
    Figure CN119718932A_ABST
Patent Text Reader

Abstract

The invention relates to a modular software testing method and system based on RPA and a large model. The method comprises the step of constructing a software testing system based on RPA and a large model. The software testing system comprises a testing layer, a data layer and an application layer. And the test layer is used for generating a test case for software testing. And obtaining a video record of user software test operation and log data of software system operation. And integrating the video record and the log data to form a time axis view of the operation sequence, and constructing a test process model according to the time axis view. And designing a reusable script template according to the test process model, and generating a test script of the function module based on the RPA according to the script template. And integrating the test scripts of all the function modules to obtain a comprehensive test case set. And executing the automatic script according to the test cases in the test case set, and performing automatic testing on the software. According to the invention, the efficiency and comprehensiveness of software testing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software testing technology, and in particular to a modular software testing method and system based on RPA and a large model. Background Art

[0002] In today's rapidly iterating software development ecosystem, software testing, as a key link to ensure product quality, faces unprecedented challenges and opportunities. With the rapid development of technologies such as cloud computing, big data, and artificial intelligence, software applications have become increasingly complex, and user needs have become more diversified, which has put forward higher requirements for software testing. Traditional testing methods rely on a large number of manual operations, with long testing cycles. Due to time and resource constraints, it is difficult to cover all possible execution paths and usage scenarios, and cannot meet the needs of rapidly iterating software. Optimizing the software testing process, improving testing efficiency and quality, and thus meeting the needs of software testing at all stages have become urgent issues to be solved. In order to improve testing efficiency, reduce testing costs, and reduce the use of manpower, robotic process automation technology can be used to achieve comprehensive testing of software.

[0003] Software usually includes multiple functional modules, and there may be complex dependencies between the functional modules. When performing module testing, it is easy to be affected by other factors, resulting in inaccurate test results. And because the software system functions are complex, a large number of test cases need to be designed, which increases the testing cost and resource requirements. There may be differences in configuration, data volume, network conditions, etc. between the production environment and the test environment. In the case of a large number of concurrent users, simulating the load and concurrency of the production environment requires a lot of computing resources, which is not easy to carry out testing practice. Therefore, there is an urgent need to adopt efficient and modular automated software testing technology to achieve reliable and economical control of software development. Summary of the invention

[0004] Based on this, it is necessary to provide a modular software testing method and system based on RPA and large models that can improve the efficiency and comprehensiveness of software testing in response to the above technical problems.

[0005] A modular software testing method based on RPA and a large model, the method comprising:

[0006] Build a software testing system based on RPA and big models; the software testing system includes the test layer, data layer, and application layer. The test layer is used to generate test cases for software testing. The data layer is used to collect test data generated by the test layer. The application layer is used to generate test reports and test recommendations based on the test data from the data layer.

[0007] Among them, the process of generating test cases for software testing is as follows:

[0008] Obtain video records of user software test operations and log data of software system operation. The video records include screen images and operation monitoring of input devices.

[0009] Integrate video records and log data to form a timeline view of the operation sequence, and build a test process model based on the timeline view.

[0010] Design a reusable script template based on the test process model, and generate test scripts for RPA-based functional modules based on the script template.

[0011] Integrate the test scripts of all functional modules to obtain a comprehensive set of test cases.

[0012] Execute automation scripts according to the test cases in the test case set to perform automated testing on the software.

[0013] A modular software testing system based on RPA and a large model, the system comprising:

[0014] Test layer, data layer and application layer.

[0015] The test layer is used to generate test cases for software testing.

[0016] The data layer is used to collect test data generated by the test layer.

[0017] The application layer is used to generate test reports and test recommendations based on the test data from the data layer.

[0018] The above-mentioned modular software testing method and system based on RPA and big models, first, by obtaining the video record of user operation and the software system operation log, the system can automatically capture and analyze the operation data and generate a timeline view of the operation sequence. This method not only reduces manual intervention, but also comprehensively records the user's operation process and system response, ensuring that all steps are accurately recorded. Next, the system generates reusable script templates by building a test process model. Based on these templates, the automated test scripts of the RPA functional modules are generated, and finally a comprehensive test case set covering different functional modules is formed. By integrating these modular scripts, the test system can perform comprehensive automated testing on the software, avoiding the tedious process of manually writing test cases. This RPA-based automated testing system significantly shortens the test cycle and solves the problem that traditional testing is difficult to cover all execution paths and usage scenarios due to resource and time constraints. By automatically analyzing and generating test scripts, the system can cover software functions more widely, detect hidden dependencies and interaction problems, and improve the comprehensiveness and accuracy of the test. At the same time, due to the modular design of RPA, the system can efficiently handle the complex dependencies between different functional modules, ensuring the independence and accuracy of the test results of each module, thereby avoiding false positives or omissions caused by the influence of other modules. In addition, through the test data collected by the data layer, the application layer can automatically generate test reports and test suggestions, allowing the software development team to quickly obtain feedback and make corrections. Overall, the system has significantly improved the efficiency and comprehensiveness of software testing through automated and intelligent testing processes, reduced manpower and time costs, achieved reliable and economical control of the software development process, and effectively met the needs of rapid iterative development. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 The figure is a flowchart of a modular software testing method based on RPA and a large model in one embodiment;

[0020] Figure 2 It is a structural block diagram of a modular software testing system based on RPA and a large model in one embodiment;

[0021] Figure 3 The figure is a flowchart of the steps of generating software test suggestions in one embodiment. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0023] In one embodiment, Figure 1As shown in the figure, a modular software testing method based on RPA and large models is provided, which is applied to Figure 2 The software testing system based on software robots shown in the figure includes: a test layer, a data layer and an application layer. The test layer is used to generate test cases for software testing. The data layer is used to collect test data generated by the test layer. The data layer collects various types of operation data during the test process for subsequent analysis and troubleshooting. The application layer is used to generate test reports and test suggestions based on the test data from the data layer. The application layer receives information from the data layer, processes and analyzes it, and generates various types of test reports and test suggestions.

[0024] Generating test cases for software testing includes the following steps:

[0025] Step 102, obtaining the video record of the user's software testing operation and the log data of the software system operation.

[0026] The video recording includes screen images and operation monitoring of input devices.

[0027] Specifically, according to the characteristics of software testing, it is usually necessary to use virtual data for testing:

[0028] (1) Scope limitation:

[0029] For numeric data, you can set the minimum and maximum values. The generated values ​​should be within this range. The generation formula is as follows:

[0030] Value=minVal+(Random Number*(maxVal-minVal))

[0031] in:

[0032] Value is the generated data

[0033] minVal is the specified minimum value, maxVal is the specified maximum value

[0034] Random Number is a random number between 0 and 1

[0035] (2) Format specification:

[0036] For an email address, which consists of a user name, a separator, and a domain name, the generation formula is as follows:

[0037] Username=RandomCharacters(length,character_set,start_end_restrictions)

[0038] Where:

[0039] Username is the user name.

[0040] length is the expected length of the username.

[0041] character_set is the allowed character set.

[0042] start_end_restrictions are restrictions on the beginning and ending characters.

[0043] Hostname=SecondaryDomain+"."+TopLevelDomain

[0044] Where:

[0045] Hostname is the email domain name.

[0046] SecondaryDomain is a string of the secondary domain name.

[0047] TopLevelDomain is a string of the top-level domain name.

[0048] EmailAddress=Username+"@"+Hostname

[0049] Where:

[0050] EmailAddress is the generated email address.

[0051] Username is the user name generated according to the above formula.

[0052] Hostname is the domain name generated according to the above formula.

[0053] (3) Uniqueness constraint:

[0054] In order to avoid primary key conflicts in the database, a unique ID is usually required to represent it. The generation formula is as follows:

[0055] UniqueID=ID+timestamp+random_number+counter

[0056] Where:

[0057] UniqueID is a generated unique ID.

[0058] ID is the basic ID, which is the set code.

[0059] timestamp is the current time.

[0060] random_number is a random number.

[0061] counter is a counter.

[0062] Through API interfaces or direct database operations, virtual data is injected into the test environment to ensure that the data meets the test requirements in different scenarios.

[0063] Furthermore, using the RPA screen recording tool, according to the pre-planned test scenario, the software test operations are manually performed by humans. When performing the operations, the screen recording tool automatically captures the elements on the interface and records their element positioning and attributes, and also records user actions such as mouse movement, clicks, and keyboard input. Obtain the running log of the software under test and filter out the event logs in the screen recording interval based on the timestamp. Ensure that each user operation has a unique identifier (ID) and includes the operation type, source name (such as button, menu, input box), source type (such as Excel form, web page), operation time, and any related field values ​​(such as "Customer A" is selected in the "Customer ID" column) for association with the video recording.

[0064] Furthermore, the user's interactive events on the interface are extracted, including mouse clicks, keyboard input, etc., the text on the screen is parsed and recognized, the timestamps in the log data of the system under test are aligned with the timeline of the video recording, and auxiliary calibration is performed through interactive events and text recognition results to ensure that each record in the log corresponds to the corresponding moment in the video.

[0065] Furthermore, data such as timestamps, operation types, system responses, and element locations are extracted from video records and log files, operation events are named in a standardized manner, and video clips are associated with corresponding operations to form a continuous event stream.

[0066] Step 104 , integrating the video record and the log data to form a timeline view of the operation sequence, and constructing a test process model according to the timeline view.

[0067] Specifically, tasks are segmented by identifying patterns or rules in the sequence, and function-related keywords and events are defined. Functions in the software are mostly triggered by button clicks. Click events are used as segmentation points of the operation sequence, and judgments are made in combination with the recognized screen text. For example, for the login function, keywords may include "login", "submit", "login button", etc., which are used to indicate the current activity. There may be operations such as entering an account and password between two button click events. Therefore, the period from the end of the previous function to the end of this function can be regarded as a functional module. If some activities always appear in a specific order, they can be classified as a functional module. If some activities only occur after other activities, it is a dependency relationship between modules.

[0068] Each ID in the timeline view represents a user operation. The process model is discovered from the UI and logs. Based on the operation sequence, each functional module is identified and divided, the boundaries between modules are determined, and each module is named according to the characteristics and purpose of the operation in the module. Based on the identified functional modules, their jump logic and dependencies, a test process model is constructed.

[0069] Step 106: design a reusable script template according to the test process model, and generate a test script for the RPA-based functional module according to the script template.

[0070] Specifically, identify and divide the test operation process of each functional module from the timeline view, so as to construct a complete test process model for this manual demonstration, which is convenient for comparison and verification; based on this model, extract each functional module, and encapsulate a functional module into a script template according to the captured elements and events, such as a login module script, pass in the account and password parameters, if the user roles are different (user, administrator) but the operation page (URL) is the same, then pass in the role parameters, if the operation pages are different, redesign the login module script for that role; then splice different functional modules according to roles and permissions to generate test cases.

[0071] Therefore, based on the elements and events captured by screen recording, RPA test scripts are automatically generated according to the process model, and repetitive operations are encapsulated into functions for easy calling and maintenance. The module functions are encapsulated, and each module is responsible for specific test steps, such as login, data entry, etc. Input and output interfaces are defined for each module to ensure integration between modules.

[0072] Step 108, integrating the test scripts of all functional modules to obtain a comprehensive test case set.

[0073] Specifically, based on roles and permissions, we build usage scenarios and paths for each role, mark the role scope applicable to each module, and establish a two-dimensional use case matrix. The rows represent different user roles, and the columns represent various functional modules. Within the allowed range, we randomly generate the order and parameters of the test modules to increase the unpredictability and coverage of the test.

[0074] Furthermore, taking the administrator role in the software as an example, if there are multiple function modules such as "delete user", "query user", "add user", etc., and "delete user" has batch operation, the usage path includes one-by-one deletion and batch check deletion. For example, the "add user" function requires input of account number, user name and other parameters, and the length and characters of these parameters are randomly generated to simulate real user use.

[0075] The test scenario is the use under different database environments, such as scenarios with and without initial data. If there is no initial data in the database, "query user" should return empty and no error should be reported. The order of functional modules is random, that is, you can first "delete user", then "query user", then "add user", or "delete user", then "add user", then "query user", to prevent only testing a single function and ignoring the connectivity issues between functional modules.

[0076] Furthermore, taking a psychological assessment system in the form of a questionnaire as an example, if "yes" is selected for an option in question 1, the system may jump to question 4 or add questions to it. The entire questionnaire forms a conclusion based on all the answers. Due to the large number of questions and many option branches, the results are diverse and difficult to predict. Using multiple test cases can increase the coverage of the test results.

[0077] Step 110, executing the automation script according to the test cases in the test case set to perform automated testing on the software.

[0078] Specifically, test execution includes automated execution of test scripts, simulation of user behavior and recording of test data, including testing of a single functional module, testing of different functional modules that simulate the actual use of the software by a character, and running all test case sets in parallel to ensure that each functional module in each path can be executed smoothly.

[0079] The methods for executing tests in parallel are divided into the following types:

[0080] 1. Distributed execution of test cases: Distributed parallel testing refers to splitting test tasks and executing them in parallel on multiple machine nodes, which can significantly reduce test execution time and improve efficiency. For software testing, the core purpose of distributed parallel testing is to allow multiple robots to execute the same or different test cases on different computing nodes at the same time, thereby speeding up the execution of regression testing, load testing, etc. In actual testing business, in order to speed up the time of automated testing, a distributed execution strategy can be adopted. Through the Hub node center, different test requests are distributed to appropriate test nodes to achieve distributed execution of tests. First, RPA robots need to be deployed on multiple machines, and ensure that these robots can obtain tasks from the central scheduling system and execute them. Each robot executes a separate use case, and the central scheduling platform manages and monitors these robot nodes to ensure that each robot completes the task on time. Task priority can be set to handle robot failures or retry mechanisms for execution failures.

[0081] 2. Multi-process parallel execution: Multi-process refers to running multiple independent processes concurrently in a computer. Each process has its own memory space and resources and executes tasks independently. In a parallel execution environment, each process can handle a task or a group of tasks at the same time, and these tasks will not interfere with each other, thereby speeding up the overall execution speed. In RPA software testing, different processes can be started on the same test machine to execute different test cases respectively. The number of processes started is determined according to the number of CPU cores of the test machine to achieve true parallel execution. Each robot runs independently as an independent process and executes different test cases. The main control system is responsible for coordinating these robots and assigning test tasks to them. In order to use computing resources more efficiently, a robot pool can be created in which robots can dynamically receive tasks as needed. Parallel execution testing can effectively evaluate the performance of the system under high concurrent load and reveal potential performance bottlenecks. By simulating multiple users or multiple concurrent operations, the responsiveness and resource consumption of the system under stress conditions are tested. For example, in the scenario of parallel execution, the bottleneck or instability that may occur when the system handles high load can be discovered by analyzing key performance indicators such as response time delay, throughput, and utilization of system resources (such as CPU, memory, and network bandwidth). In a multi-process or multi-threaded environment, multiple operations may be performed in parallel and access shared resources, leading to data competition, deadlock, resource conflicts, and other problems. Through parallel testing, the synchronization mechanism and data consistency problems of the software when handling concurrent requests can be detected. For example, during the test, problems such as improper transaction management, missing locking mechanism, or inappropriate data isolation level may be exposed, which may lead to unstable system operation or even serious functional failures. In the case of multiple users operating at the same time, whether the system can correctly manage concurrent requests, avoid data conflicts, and ensure the correct execution of operations is an important part of the test. For example, in the test of multiple users operating on the same data in parallel, it can reveal whether the system can effectively prevent data conflicts or errors caused by concurrent writes and ensure data consistency and integrity. This verification is particularly critical for high-concurrency business scenarios such as multi-user systems, financial trading platforms, and online shopping malls.

[0082] Software testing is divided into functional module testing, system integration testing and system operation testing.

[0083] 1. Functional module testing;

[0084] Mainly verify the independent functional modules of the software to ensure that each module works as expected. Run the developed RPA script, simulate user operations, automatically send requests to the system and input data, verify whether the functional output meets expectations, and record the test results of each module, including success, failure and specific error information.

[0085] 2. System integration testing;

[0086] Deploy all modules that have passed functional testing in an isolated integrated test environment to ensure interface compatibility and correct data interaction between modules. Design and execute end-to-end test cases across modules, use RPA to simulate complex business processes, and verify the system's ability to work together as a whole. Use multiple software robots to simulate multiple users operating simultaneously and perform high concurrency and load testing. Perform security scans at the same time to check for potential security vulnerabilities and ensure the security of the software.

[0087] 3. System operation test:

[0088] After the software is officially launched, tests are performed according to a predetermined schedule to monitor the continued stability of the system in actual operation. Before and after each test run, the database is automatically backed up and restored to ensure that the test activities do not interfere with the integrity of the production data. Using simulated data in the production environment, multiple software robots are used for integration testing, while recording test data.

[0089] In the above-mentioned automated software testing method, first, by obtaining the video record of the user's operation and the software system operation log, the system can automatically capture and analyze the operation data and generate a timeline view of the operation sequence. This method not only reduces manual intervention, but also comprehensively records the user's operation process and system response, ensuring that all steps are accurately recorded. Next, the system generates reusable script templates by building a test process model. Based on these templates, the automated test scripts of the RPA functional modules are generated, and finally a comprehensive test case set covering different functional modules is formed. By integrating these modular scripts, the test system can perform comprehensive automated testing on the software, avoiding the tedious process of manually writing test cases. This RPA-based automated testing system significantly shortens the test cycle and solves the problem that traditional testing is difficult to cover all execution paths and usage scenarios due to resource and time constraints. By automatically analyzing and generating test scripts, the system can cover software functions more widely, detect hidden dependencies and interaction problems, and improve the comprehensiveness and accuracy of the test. At the same time, due to the modular design of RPA, the system can efficiently handle the complex dependencies between different functional modules, ensure the independence and accuracy of the test results of each module, and thus avoid false positives or false negatives caused by the influence of other modules. In addition, through the test data collected by the data layer, the application layer can automatically generate test reports and test suggestions, allowing the software development team to quickly obtain feedback and make corrections. Overall, the system has significantly improved the efficiency and comprehensiveness of software testing through automated and intelligent testing processes, reduced manpower and time costs, achieved reliable and economical control of the software development process, and effectively met the needs of rapid iterative development.

[0090] In one embodiment, the log data of the tested software system is cleaned and structured to obtain the test operation data of each user software, and the test operation data is associated with the video elements captured by the screen recording tool to obtain the video record of the user software test operation. According to the user's interactive events and text recognition results on the interface, the timestamp in the log data of the tested software system is aligned with the time axis of the video record, and the log data of the software system operation is obtained after auxiliary calibration through the interactive events and text recognition results.

[0091] In one embodiment, keywords of the operation sequence in the video record are extracted, and functional division is performed according to the keywords, interactive events and text recognition results to obtain the dependency relationship between several functional modules. The functional modules, dependency relationship and log data are integrated to form a timeline view of the operation sequence.

[0092] In one of the embodiments, the test operation process of each functional module is identified and divided from the timeline view, and a test process model fully demonstrated by the current user is constructed according to the operation process.

[0093] In one of the embodiments, each functional module in the timeline view is encapsulated into a corresponding reusable script template according to the test process model, and the functional modules corresponding to the user role permissions are spliced ​​according to the script template to generate a test script for the RPA-based functional modules.

[0094] In one embodiment, the test scripts of each functional module are integrated according to the role permissions of different users to generate a comprehensive test case set.

[0095] In one of the embodiments, an automated script is executed according to the test cases in the test case set, and after a test service request is initiated to the software testing system, an automated test is performed on the current software being tested. At the same time, the data layer and the application layer respectively respond to the test service request to generate a test evaluation plan and display it on the UI interface.

[0096] In one embodiment, if Figure 3 The system shown needs to use RPA development tools to create a software testing workflow in order to perform repetitive automated testing tasks. After the test is completed, the collected test data needs to be analyzed to generate analysis reports and improvement suggestions, and the data visualization screen is used for operation monitoring. The data layer uses an intelligent agent model or a neural network or a reinforcement learning model to process the test process and test data. The steps for generating software test suggestions are as follows:

[0097] 1. Report Generation

[0098] Define templates for various reports, extract data from data sources, clean, aggregate and analyze data, count failures, calculate success rates, organize exception information, etc. Use template engines to dynamically fill data into pre-designed templates, generate the main content of the test report, and automatically generate charts based on the data and embed them in the report. The following are the key indicator calculations in the report:

[0099] (1) Pass rate

[0100]

[0101] Where:

[0102] Pass Rate is the pass rate of the test cases.

[0103] Number of Passed Test Cases is the number of test cases that passed the test.

[0104] Total Number of Test Cases is the total number of test cases.

[0105] (2) Row coverage

[0106]

[0107] Where:

[0108] Line Coverage is the line coverage.

[0109] Number of Executed Lines of Code is the number of lines of code executed.

[0110] Total Number of Lines of Code is the total number of lines of code.

[0111] (3) Defect detection rate

[0112]

[0113] Defect Discovery Rate is the defect discovery rate.

[0114] Number of Discovered Defects is the number of defects found.

[0115] Number of Executed Test Cases The number of test cases executed.

[0116] (4) Comprehensive evaluation

[0117] Evaluating the performance of a software system under high concurrency conditions usually involves multiple factors, which can be comprehensively evaluated by designing a weighted scoring model, allowing the weight of each indicator to be adjusted according to actual needs.

[0118] Consider the following metrics: response time (RT), throughput (TP), error rate (ER), CPU utilization (CPU), memory utilization (Mem), and concurrent users (CC).

[0119] Each indicator is standardized to make it comparable, using the minimum-maximum normalization method to map each indicator between 0 and 1:

[0120]

[0121] The subscript norm is the normalized indicator, min and max are the minimum and maximum values ​​of the indicator obtained in the test, and the indicator without a subscript is the average value during the actual test.

[0122] Assign a weight to each metric:

[0123] W RT +W TP +W ER +W CPU +W Mem +W CC =1

[0124] Where W represents the weight and the subscripts represent the indicators.

[0125] The comprehensive score can be calculated by weighting:

[0126] Score = W RT ·RT norm +W TP TP norm +W ER ·E Rnorm +E CPU CPU Use,norm +W Mem Mem Use,norm +W CC CC norm

[0127] 2. Test suggestion generation

[0128] Capture error logs, debug logs, access logs and other operation logs from the system under test. These logs contain various events and behavior records during system operation, which are important bases for analyzing code quality and problems. During the test process, if an error occurs, the log will record relevant error information such as error code, error message, and location, which can help understand the specific situation of the software error. The test system automatically captures the key information of the error, such as the location where the error occurred or the call stack, and locates the source code fragment that may cause the error.

[0129] Send error information such as error code, error description, system environment information, and related source code snippets to the big model, and use the big model's learning and analysis capabilities to analyze the above information and try to find out the cause of the error. Taking ERROR_1234 as an example, the prompt for the basic information description is as follows:

[0130] Error code: ERROR_1234

[0131] Error description: An unexpected exception occurred while performing a data write operation, and the error message was displayed as "Unable to open file, permission denied".

[0132] System environment information:

[0133] Operating system: Ubuntu 20.04LTS

[0134] Programming language: Python 3.9.5

[0135] Framework / library versions: Django 3.2, psycopg2 2.9.3

[0136] Server configuration: AWS EC2 t3.medium instance Related environment variables: DATABASE_URL = postgres: / / user:password@localhost / dbname Related source code snippet:

[0137] def save_data_to_db(record):

[0138] try:

[0139] with open(' / var / log / app / data.log','a')as logfile:

[0140] logfile.write(json.dumps(record))

[0141] #Database save operation

[0142] db_connection=psycopg2.connect(DATABASE_URL)

[0143] cursor=db_connection.cursor()

[0144] cursor.execute("INSERT INTO records(data)VALUES(%s)",

[0145] (json.dumps(record),))

[0146] db_connection.commit()

[0147] except Exception as e:

[0148] print(f"Error during data saving:{e}")

[0149] finally:

[0150] if db_connection:

[0151] db_connection.close()

[0152] The prompt for building the request is as follows:

[0153] Please analyze the above error description, system environment and the provided source code snippet, analyze the specific cause of error ERROR_1234, and generate a detailed error analysis report for the error, including but not limited to the following:

[0154] 1. Possible causes of the error: List at least 3 different reasons that may cause this error code. Please ensure that each reason is based on the technical background, considering the perspectives of software development, system configuration, user operation, etc.

[0155] 2. Solutions for each cause: Provide clear and feasible solutions for each possible cause listed. The solution should include necessary technical details, configuration modifications, code adjustments, etc. to ensure that implementers can directly fix the problem according to the instructions. Please arrange the solutions in ascending order of complexity and cost, and give priority to options with low implementation costs and quick results.

[0156] Please keep the output format as JSON structure, such as:

[0157] {

[0158] "Error code":"E001",

[0159] "Possible causes of error":[

[0160] {

[0161] "Reason Description":"Reason 1 Description",

[0162] "Solution":"Detailed steps for solution 1"

[0163] },

[0164] {

[0165] "Reason Description":"Reason 2 Description",

[0166] "Solution":"Detailed steps for Solution 2"

[0167] },

[0168] {

[0169] "Reason Description":"Reason 3 Description",

[0170] "Solution":"Detailed steps for Solution 3"

[0171] } ]

[0173] }.

[0174] If analysis fails, we will suggest directions for further investigation, pay attention to file access permission settings, user permissions of the execution environment, and any configuration issues related to database connections or data writing operations, and provide feedback in the following format:

[0175] Error code identification: ERROR_1234

[0176] Problem Summary: Describe the obstacle that the application encounters when performing a specific operation.

[0177] · Troubleshooting process: briefly describe the verified troubleshooting steps and findings.

[0178] Potential problem area: The fault link or code area (function / class / configuration file name) inferred based on the existing clues.

[0179] If necessary error information is found to be missing during the analysis process, such as the error information pointing to a configuration file, further search for files or code snippets that may cause the error, relocate the error source and send it to the large model.

[0180] It is worth noting that since there may be multiple reasons for an error code, the test suggestion should generate content in the structure of <error code, possible cause of the error, solution>, and provide corresponding solutions for each possible cause of the error, so that developers can quickly locate and try different solutions to improve the efficiency and accuracy of troubleshooting. For each possible cause of the error, the big model is used to give corresponding code repair suggestions, including specific code changes, configuration adjustments and other measures, and multiple suggestions fed back by the big model are sorted out, sorted by complexity, feasibility, cost-effectiveness and other factors, to form a list of candidate solutions to provide reference for development and testing personnel.

[0181] The application layer includes the following modules:

[0182] (1) Unit test report: A test result report of the software functional module, which verifies whether each independent component works as expected and ensures that the basic building blocks of the code are correct.

[0183] (2) Functional test report: The test result report of the overall function comprehensively evaluates the accuracy and completeness of each function of the system to ensure that all functions can work together correctly.

[0184] (3) Performance test report: A test result report on software performance, including performance indicators such as response time, throughput, and resource usage under a specific workload, to facilitate optimization of system configuration and ensure the stability and efficiency of the application in a real environment.

[0185] (4) Security Test Report: A report on the test results of software security, including data protection, access control, vulnerability detection, etc., to detect the system's resistance to malicious activities, provide a detailed list of security weaknesses and compliance issues, and guide the implementation of security reinforcement measures.

[0186] (5) Monitoring big data screen: A big data dashboard that displays the system operation status, integrating multi-dimensional data such as key performance indicators, system utilization, and error rates, to facilitate rapid identification of problems and take action to ensure the continuous and stable operation of the system.

[0187] (6) Notification of abnormal results: Automatically monitor abnormal situations during the execution process and promptly notify relevant members via email to speed up the response to problems.

[0188] (7) Error cause analysis: Based on all error information found during test execution, analyze the cause of the error through error type, error code and software system operation log.

[0189] (8) Code suggestion generation: Provide specific modified code snippets for the problems found, as well as suggestions such as adjusting system settings and updating dependency versions.

[0190] (9) Summary of repair solutions: Organize multiple suggestions and sort them according to factors such as complexity, feasibility, and cost-effectiveness to form a comprehensive list of candidate solutions for the development team to choose from.

[0191] In software testing, it is necessary to clearly define the test objectives and define the functional modules, performance indicators, and security requirements that need to be tested based on the software features. Based on the demand analysis, design comprehensive test scenarios such as normal processes, boundary conditions, and exception handling, and plan the test process. In order to isolate the test environment and the production environment, it is necessary to use virtual data for testing and determine the rules for generating virtual data to ensure that the data can cover all test cases while meeting privacy and compliance requirements.

[0192] After the test is completed, the collected test data needs to be analyzed to generate analysis reports and improvement suggestions, and the operation needs to be monitored using a data visualization screen.

[0193] 1. Report Generation

[0194] Define templates for various reports, extract data from data sources, clean, aggregate and analyze data, count failures, calculate success rates, organize exception information, etc. Use template engines to dynamically fill data into pre-designed templates, generate the main content of the test report, and automatically generate charts based on the data and embed them in the report. The following are the key indicator calculations in the report:

[0195] (1) Pass rate

[0196]

[0197] Where:

[0198] Pass Rate is the pass rate of the test cases.

[0199] Number of Passed Test Cases is the number of test cases that passed the test.

[0200] Total Number of Test Cases is the total number of test cases.

[0201] (2) Row coverage

[0202]

[0203] Where:

[0204] Line Coverage is the line coverage.

[0205] Number of Executed Lines of Code is the number of lines of code executed.

[0206] Total Number of Lines of Code is the total number of lines of code.

[0207] (3) Defect detection rate

[0208]

[0209] Defect Discovery Rate is the defect discovery rate.

[0210] Number of Discovered Defects is the number of defects found.

[0211] Number of Executed Test Cases The number of test cases executed.

[0212] (4) Comprehensive evaluation

[0213] Evaluating the performance of a software system under high concurrency conditions usually involves multiple factors, which can be comprehensively evaluated by designing a weighted scoring model, allowing the weight of each indicator to be adjusted according to actual needs.

[0214] Consider the following metrics: response time (RT), throughput (TP), error rate (ER), CPU utilization (CPU), memory utilization (Mem), and concurrent users (CC).

[0215] Each indicator is standardized to make it comparable, using the minimum-maximum normalization method to map each indicator between 0 and 1:

[0216]

[0217] The subscript norm is the normalized indicator, min and max are the minimum and maximum values ​​of the indicator obtained in the test, and the indicator without a subscript is the average value during the actual test.

[0218] Assign a weight to each metric:

[0219] W RT +W TP +W ER +W CPU +W Mem +W CC =1

[0220] Where W represents the weight and the subscripts represent the indicators.

[0221] The comprehensive score can be calculated by weighting:

[0222] Score = W RT·RT norm +W TP TP norm +W ER ·ER norm +W CPU CPU Use,norm +W Mem Mem Use,norm +W CC CC norm

[0223] 2. Test suggestion generation

[0224] Capture error logs, debug logs, access logs and other operation logs from the system under test. These logs contain various events and behavior records during system operation, which are important bases for analyzing code quality and problems. During the test process, if an error occurs, the log will record relevant error information such as error code, error message, and location, which can help understand the specific situation of the software error. The test system automatically captures the key information of the error, such as the location where the error occurred or the call stack, and locates the source code fragment that may cause the error.

[0225] The error information such as error code, error description, system environment information and related source code snippets are sent to the big model, and the learning and analysis capabilities of the big model are used to analyze the above information and try to find out the cause of the error.

[0226] In one embodiment, Figure 2 As shown, a modular software testing system based on RPA and a large model is provided, including:

[0227] Test layer, data layer and application layer.

[0228] The test layer is used to generate test cases for software testing.

[0229] The data layer is used to collect test data generated by the test layer.

[0230] The application layer is used to generate test reports and test recommendations based on the test data from the data layer.

[0231] In one embodiment, the test layer includes: a screen recording module, a log capture module, a process mining module, a RPA code generation module, a use case generation module, and a test execution module. The screen recording module is used to capture event information of user interaction with the software, and record the entire process of the user actually operating the software, and output the video record corresponding to the event information to the log capture module. The log capture module is used to collect log data and video records of the software runtime system, and output them to the process mining module. The process mining module is used to integrate video records and log data, generate a timeline view of the operation sequence, and build a test process model based on the timeline view. The RPA code generation module is used to generate a test script for a functional module based on the RPA through the test process model, and output it to the use case generation module. The use case generation module is used to integrate the test scripts of all functional modules according to different user role permissions, generate a comprehensive test case set, and output it to the test execution module. The test execution module is used to run the test case set for software automation testing.

[0232] In one of the embodiments, the application layer includes: a unit test report generation module, a functional test report generation module, a performance test report generation module, a security test report generation module, a monitoring big data screen, an abnormal result notification module, an error cause analysis module, a code suggestion generation module and a repair solution summary module.

[0233] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0234] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0235] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A modular software testing method based on RPA and large models, characterized in that: The method comprises: Building a software testing system based on RPA and big models; the software testing system includes a test layer, a data layer and an application layer; the test layer is used to generate test cases for software testing; the data layer is used to collect test data generated by the test layer; the application layer is used to generate test reports and test suggestions based on the test data from the data layer; Among them, the process of generating test cases for software testing is as follows: Obtaining video records of user software testing operations and log data of software system operation; wherein the video records include screen images and operation monitoring of input devices; Integrate the video record and the log data to form a timeline view of the operation sequence, and construct a test process model according to the timeline view; Design a reusable script template according to the test process model, and generate a test script for the RPA-based functional module according to the script template; Integrate the test scripts of all functional modules to obtain a comprehensive test case set; Execute the automation script according to the test cases in the test case set to perform automated testing on the software.

2. The method according to claim 1, characterized in that Obtain video records of user software testing operations and log data of software system operation, including: Cleaning and structuring the log data of the software system under test to obtain the test operation data of each user software, and associating the test operation data with the video elements captured by the screen recording tool to obtain a video record of the user software test operation; According to the user's interactive events and text recognition results on the interface, the timestamp in the log data of the software system under test is aligned with the time axis of the video record. After auxiliary calibration through the interactive events and the text recognition results, the log data of the software system operation is obtained.

3. The method according to claim 2, characterized in that Integrate the video record and the log data to form a timeline view of the operation sequence, including: Extracting keywords of the operation sequence in the video record, performing functional division according to the keywords, the interaction events and the text recognition results, and obtaining dependency relationships between a plurality of functional modules; The functional modules, the dependencies and the log data are integrated to form a timeline view of the operation sequence.

4. The method according to claim 3, characterized in that Constructing a test process model according to the timeline view includes: The test operation process of each functional module is identified and divided from the timeline view, and a test process model fully demonstrated by the current user is constructed according to the operation process.

5. The method according to claim 4, characterized in that Designing a reusable script template according to the test process model, and generating a test script for the RPA-based functional module according to the script template, including: According to the test process model, each functional module in the timeline view is encapsulated into a corresponding reusable script template, and the functional modules corresponding to the user role permissions are spliced ​​according to the script template to generate a test script for the RPA-based functional modules.

6. The method according to claim 5, characterized in that Integrate the test scripts of all functional modules to obtain a comprehensive test case set, including: Integrate the test scripts of each functional module according to the role permissions of different users to generate a comprehensive test case set.

7. The method according to claim 6, characterized in that Executing automated scripts according to the test cases in the test case set to perform automated testing on the software, including: The automated script is executed according to the test cases in the test case set, and after a test service request is initiated to the software testing system, an automated test is performed on the current software being tested. At the same time, the data layer and the application layer respond to the test service request respectively to generate a test evaluation plan and display it on the UI interface.

8. A modular software testing system based on RPA and large models, characterized in that: The system comprises: Test layer, data layer and application layer; The test layer is used to generate test cases for software testing; The data layer is used to collect test data generated by the test layer; The application layer is used to generate a test report and a test suggestion based on the test data from the data layer.

9. The system according to claim 8, characterized in that The test layer includes: a screen recording module, a log capture module, a process mining module, an RPA code generation module, a use case generation module, and a test execution module; the screen recording module is used to capture event information of user interaction with the software, and record the entire process of the user actually operating the software, and output the video record corresponding to the event information to the log capture module; The log capture module is used to collect the log data of the software runtime system and the video record, and output them to the process mining module; The process mining module is used to integrate the video records and log data, generate a timeline view of the operation sequence, and build a test process model according to the timeline view; The RPA code generation module is used to generate a test script of the RPA-based functional module through the test process model, and output it to the use case generation module; The test case generation module is used to integrate the test scripts of all functional modules according to different user role permissions, generate a comprehensive test case set, and output it to the test execution module; The test execution module is used to run the test case set to perform software automation testing.

10. The system according to claim 9, characterized in that The application layer includes: a unit test report generation module, a functional test report generation module, a performance test report generation module, a security test report generation module, a monitoring big data screen, an abnormal result notification module, an error cause analysis module, a code suggestion generation module and a repair solution summary module.

Citation Information

Patent Citations

  • Industrial control system information security test system and method

    CN111698267A

  • RPA process automatic generation method and system based on video analysis

    CN113255614A

  • Automatic function test method and system based on RPA

    CN114860618A

  • UI automatic test system and method based on RPA robot

    CN118227506A

  • Information processing device, testing method, and testing program

    WO2023238262A1