A software testing method and system based on artificial intelligence

By building a test behavior library and a user behavior library to simulate real user operations, it solves the coverage and accuracy problems of existing software testing methods in non-standard usage scenarios, achieves efficient and accurate software testing, and expands the testing scope.

CN118093381BActive Publication Date: 2024-08-27BEIJING XIAOUNDERSTAND TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410145309.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-01
Publication Date
2024-08-27
Estimated Expiration
2044-02-01

AI Technical Summary

Technical Problem

Existing software testing methods rely on the experience of testers, resulting in low testing efficiency and accuracy, and cannot effectively improve the test coverage and accuracy of software in non-standard usage scenarios.

Method used

Adopt artificial intelligence-based software testing methods to build test behavior libraries and user behavior libraries by obtaining testers' behavioral data to achieve automated and standardized testing, cover a wider range of test scenarios, generate automated test scripts, and screen representative testers and behaviors Data, simulate real user operations, and identify potential problems.

Benefits of technology

It significantly improves the efficiency and accuracy of software testing, can comprehensively evaluate software functions and performance, improves the accuracy and reliability of testing, expands the testing scope to software with similar functions, and ensures the adaptability and effectiveness of testing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118093381B
    Figure CN118093381B
Patent Text Reader

Abstract

The present application discloses a software testing method and system based on artificial intelligence, which relates to the field of artificial intelligence technology. In this method, a plurality of first test behavior data generated when a first tester tests a preset software according to a preset operation is obtained; a test behavior library is constructed based on the plurality of the first test behavior data; a plurality of second test behavior data generated when a second tester tests the preset software according to a random operation is obtained; a user behavior library is constructed based on the plurality of the second test behavior data; the preset software is tested based on the test behavior library and the user behavior library to obtain a first test result. Implementing the technical solution of the present application can effectively improve the test efficiency during software testing.
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 technology, and specifically to a software testing method and system based on artificial intelligence. Background Art

[0002] With the continuous development of science and technology, software applications emerge in an endless stream. After the software is launched, it is very important to ensure that the software has no bugs. Therefore, in the development process before the software is launched, the software needs to be tested to find out the bugs in the software. In the process of software testing, the current software testing method is mostly tested by testers. However, this software testing method mostly relies on the experience of testers, resulting in low testing efficiency and accuracy during software testing.

[0003] Therefore, how to improve the testing efficiency and accuracy during software testing has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides a software testing method and system based on artificial intelligence, which can effectively improve the testing efficiency and accuracy during software testing.

[0005] In a first aspect, the present application provides a software testing method based on artificial intelligence, the method comprising: obtaining multiple first test behavior data generated when a first tester tests a preset software according to a preset operation; constructing a test behavior library based on the multiple first test behavior data; obtaining multiple second test behavior data generated when a second tester tests the preset software according to a random operation; constructing a user behavior library based on the multiple second test behavior data; testing the preset software based on the test behavior library and the user behavior library to obtain a first test result.

[0006] By adopting the above technical scheme, by obtaining multiple first test behavior data generated when the first tester tests the preset software according to preset operations, the performance and possible problems of the software in standard usage scenarios can be captured, and by obtaining multiple second test behavior data generated when the second tester tests the preset software according to random operations, the possible random and diversified behaviors of real users can be simulated to reflect the performance and potential problems of the preset software in non-standard usage situations; based on the multiple first test behavior data, a test behavior library is constructed, and based on the multiple second test behavior data, a user behavior library is constructed, and then the preset software is tested based on the test behavior library and the user behavior library to obtain the first test result, thereby realizing the automation and standardization of the testing process, significantly improving the efficiency of software testing, and covering a wider range of test scenarios in the testing process, so that the functions and performance of the preset software can be comprehensively evaluated, thereby significantly improving the accuracy of software testing.

[0007] Optionally, constructing a test behavior library based on multiple first test behavior data and multiple first log data specifically includes: generating a first test code corresponding to each first test behavior data; generating a set of automated test behavior scripts based on multiple first test codes; and constructing the test behavior library based on the set of automated test behavior scripts.

[0008] By adopting the above-mentioned technical scheme, by generating the first test code corresponding to each first test behavior data, the actual user's operation and system response can be converted into a repeatable test script, thereby effectively improving the accuracy and reliability of the test; by generating an automated test behavior script set based on multiple first test codes, and constructing a test behavior library based on the automated test behavior script set, the efficiency of the testing process is effectively improved.

[0009] Optionally, before obtaining multiple second test behavior data generated when the second tester tests the preset software according to random operations, the method also includes: determining one or more screening criteria; based on one or more of the screening criteria, screening all users in turn to obtain the second tester.

[0010] By adopting the above technical solution, all users are screened in turn based on one or more screening criteria, so as to effectively select representative testers, which not only improves the authenticity and diversity of the test data, but also ensures that the test results can fully reflect the performance of the software in various user groups.

[0011] Optionally, constructing the user behavior library based on multiple second test behavior data specifically includes: filtering to obtain multiple first valid test behavior data from multiple second test behavior data; generating second test codes corresponding to each first valid test behavior data; generating an automated user behavior script set based on multiple second test codes; and constructing the user behavior library based on the automated user behavior script set.

[0012] By adopting the above technical solution, multiple first valid test behavior data are obtained by screening multiple second test behavior data, so that key behaviors and software responses that may occur under real user operating conditions can be accurately captured and identified; by generating second test codes corresponding to each first valid test behavior data, the complex and changeable user behaviors in the real world are converted into repeatable test scripts, which helps to simulate the operations of real users in automated testing and effectively improve the comprehensiveness and authenticity of the test. By generating a collection of automated user behavior scripts based on multiple second test codes, and building a user behavior library based on the collection of automated user behavior scripts, the efficiency of the testing process is effectively improved.

[0013] Optionally, the method also includes: collecting first log data corresponding to each of the first test behavior data; based on multiple first log data, determining the bug corresponding to the preset software when the test is performed according to preset operations; filtering out multiple abnormal test behavior data from multiple second test behavior data; collecting second log data corresponding to each of the abnormal test behavior data; based on multiple second log data, determining the bug corresponding to the preset software when the test is performed according to random operations.

[0014] By adopting the above technical scheme, by collecting the first log data corresponding to each first test behavior data, it is possible to record and analyze in detail the behavior and performance of the software under preset operations, which helps to deeply understand the performance and potential problems of the software under a standard test environment; by determining the corresponding bugs of the preset software when it is tested according to preset operations based on multiple first log data, it is possible to quickly and accurately identify software problems that occur in standard usage scenarios; by screening multiple abnormal test behavior data from multiple second test behavior data, it is possible to capture the abnormal performance of the software under random or non-standard operations, which helps to reveal the potential defects of the software under actual usage conditions; by determining the corresponding bugs of the preset software when it is tested according to random operations based on multiple second log data, it is possible to quickly and accurately identify software problems that occur in special or unconventional usage scenarios.

[0015] Optionally, after the preset software is tested based on the test behavior library and the user behavior library to obtain a first test result, the method also includes: determining a preset function corresponding to the preset software; determining similar software corresponding to the preset software based on the preset function; obtaining a plurality of third test behavior data generated when the first tester tests the similar software according to preset operations; obtaining a plurality of fourth test behavior data generated when the second tester tests the similar software according to random operations; obtaining a plurality of second valid test behavior data from the plurality of fourth test behavior data; determining the operational similarity between the similar software and the preset software based on a plurality of the first test behavior data, a plurality of the third test behavior data, a plurality of the first valid test behavior data and a plurality of the second valid test behavior data; when the operational similarity is greater than a preset similarity threshold, testing the similar software based on the test behavior library and the user behavior library to obtain a second test result.

[0016] Optionally, the determining the operational similarity between the similar software and the preset software based on multiple first test behavior data, multiple third test behavior data, multiple first valid test behavior data and multiple second valid test behavior data specifically includes: performing feature extraction on multiple first test behavior data to obtain multiple first test behavior features; performing feature extraction on multiple third test behavior data to obtain multiple second test behavior features; performing feature extraction on multiple first valid test behavior data to obtain multiple third test behavior features; performing feature extraction on multiple second valid test behavior data to obtain multiple fourth test behavior features; obtaining a first feature similarity based on multiple first test behavior features and multiple second test behavior features; obtaining a second feature similarity based on multiple third test behavior features and multiple fourth test behavior features; obtaining the operational similarity based on the first feature similarity and the second feature similarity.

[0017] By adopting the above technical scheme, by determining the preset function corresponding to the preset software, the core functions and operations of the software can be accurately defined and understood, and by determining the similar software corresponding to the preset software based on the preset function, the test scope can be effectively expanded to software with similar functions; by determining the operation similarity between similar software and the preset software based on multiple first test behavior data, multiple third test behavior data, multiple first valid test behavior data and multiple second valid test behavior data, a quantitative method is provided to evaluate the operation consistency between different software; when the operation similarity is greater than the preset similarity threshold, the similar software is tested based on the test behavior library and the user behavior library to obtain a second test result, so that the test scope can be expanded to a variety of similar software, ensuring the adaptability and effectiveness of the test method when dealing with different software, and effectively improving the detection range of the software testing method.

[0018] In a second aspect of the present application, a software testing system based on artificial intelligence is provided, the system comprising an acquisition module, a behavior library construction module and a testing module; the acquisition module is used to acquire multiple first test behavior data generated when a first tester tests a preset software according to a preset operation; the behavior library construction module is used to construct a test behavior library based on the multiple first test behavior data; the acquisition module is also used to acquire multiple second test behavior data generated when a second tester tests the preset software according to random operations; the behavior library construction module is also used to construct a user behavior library based on the multiple second test behavior data; the testing module is used to test the preset software based on the test behavior library and the user behavior library to obtain a first test result.

[0019] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as described in the first aspect of the present application.

[0020] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method as described in any one of the first aspects of the present application.

[0021] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0022] 1. By obtaining multiple first test behavior data generated when the first tester tests the preset software according to preset operations, the performance and possible problems of the software in standard usage scenarios can be captured. By obtaining multiple second test behavior data generated when the second tester tests the preset software according to random operations, the possible random and diversified behaviors of real users can be simulated to reflect the performance and potential problems of the preset software in non-standard usage situations; based on the multiple first test behavior data, a test behavior library is constructed, and based on the multiple second test behavior data, a user behavior library is constructed, and then the preset software is tested based on the test behavior library and the user behavior library to obtain the first test result, thereby realizing the automation and standardization of the testing process, significantly improving the efficiency of software testing, and covering a wider range of test scenarios in the testing process, so that the functions and performance of the preset software can be comprehensively evaluated, thereby significantly improving the accuracy of software testing.

[0023] 2. By generating the first test code corresponding to each first test behavior data, the actual user operation and system response can be converted into a repeatable test script, thereby effectively improving the accuracy and reliability of the test; by generating an automated test behavior script set based on multiple first test codes, and building a test behavior library based on the automated test behavior script set, the efficiency of the test process is effectively improved.

[0024] 3. By screening multiple first valid test behavior data from multiple second test behavior data, it is possible to accurately capture and identify key behaviors and software responses that may occur under real user operating conditions; by generating second test codes corresponding to each first valid test behavior data, the complex and changeable user behaviors in the real world are converted into repeatable test scripts, which helps to simulate the operations of real users in automated testing and effectively improve the comprehensiveness and authenticity of the test. By generating a collection of automated user behavior scripts based on multiple second test codes, and building a user behavior library based on the collection of automated user behavior scripts, the efficiency of the testing process is effectively improved.

[0025] 4. By determining the preset functions corresponding to the preset software, the core functions and operations of the software can be accurately defined and understood. By determining the similar software corresponding to the preset software based on the preset functions, the test scope can be effectively expanded to software with similar functions. By determining the operational similarity between similar software and the preset software based on multiple first test behavior data, multiple third test behavior data, multiple first valid test behavior data, and multiple second valid test behavior data, a quantitative method is provided to evaluate the operational consistency between different software. When the operational similarity is greater than the preset similarity threshold, the similar software is tested based on the test behavior library and the user behavior library to obtain a second test result, so that the test scope can be expanded to a variety of similar software, ensuring the adaptability and effectiveness of the test method when dealing with different software, and effectively improving the detection range of the software testing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is one of the flowcharts of a software testing method based on artificial intelligence provided in an embodiment of the present application;

[0027] Figure 2 This is the second flow chart of a software testing method based on artificial intelligence provided in an embodiment of the present application;

[0028] Figure 3 This is a flowchart of a software testing method based on artificial intelligence provided by an embodiment of the present application;

[0029] Figure 4 It is a structural diagram of a software testing system based on artificial intelligence provided in an embodiment of the present application;

[0030] Figure 5 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.

[0031] Explanation of the accompanying drawings: 1. Acquisition module; 2. Behavior library construction module; 3. Testing module; 4. Personnel screening module; 5. First processing module; 6. Second processing module; 500. Electronic device; 501. Processor; 502. Communication bus; 503. User interface; 504. Network interface; 505. Memory. DETAILED DESCRIPTION

[0032] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0033] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0034] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0035] This application provides a software testing method based on artificial intelligence, referring to Figure 1 , which shows one of the flow charts of a software testing method based on artificial intelligence provided in an embodiment of the present application. The method includes steps S11-S15, which are as follows:

[0036] Step S11: Acquire a plurality of first test behavior data generated when a first tester tests the preset software according to preset operations.

[0037] Specifically, the preset software in this solution refers to software applied to mobile devices, and mobile devices include but are not limited to electronic devices such as mobile phones and tablets.

[0038] In step S11 , the goal is to ensure that all major functions and user interaction scenarios of the preset software are covered when performing software testing, thereby providing a comprehensive basis for building a test behavior library.

[0039] Therefore, in order to achieve this goal, first of all, a series of detailed test cases need to be designed, which cover all the key functions and possible user operations of the preset software. Then, the first tester (i.e., professional tester) performs the test according to these test cases (i.e., according to the preset operations).

[0040] During the test, each operation (such as click, input, page navigation) and software response (such as page loading, pop-up window, data update) will be recorded in detail to obtain the first test behavior data. Multiple first test behavior data will be recorded by the software monitoring module. The software monitoring module can be an interface set inside the preset software, and the interface is called when the preset software is enabled; the software monitoring module can also be an APP outside the preset software, and the APP is called when the preset software is enabled.

[0041] Step S12: constructing a test behavior library based on a plurality of first test behavior data.

[0042] Specifically, step S12 aims to create a comprehensive test resource collection to reflect the performance of the preset software under various preset operations, providing support for automated testing and subsequent software development.

[0043] The following embodiment will describe in detail the specific steps of constructing a test behavior library based on a plurality of first test behavior data.

[0044] In a possible implementation, step S12 specifically includes the following steps:

[0045] Generate a first test code corresponding to each first test behavior data.

[0046] Specifically, in this step, a detailed analysis of each first test behavior data is first required. The first test behavior data includes all operations of the first tester when executing the preset test case, such as clicking a button, entering text, navigating a menu, etc., and the system's response to these operations. Then, based on these operations and responses, the corresponding test code, namely the first test code, will be generated. The first test code is intended to accurately simulate actual user operations and verify whether the system's response meets expectations.

[0047] To generate the first test code, you can use various automated testing tools and frameworks, such as Selenium or Appium. Selenium is a widely used open source automated testing tool that is mainly used for automated testing of web pages and web applications. Appium is an open source tool for automating the testing of mobile applications, including native, hybrid, and mobile web applications. They can simulate user operations and capture system responses. It should be noted that when using Selenium or Appium to generate the first test code, the mobile device needs to be connected to the computer via a data cable so that Selenium or Appium can interact with the mobile device.

[0048] In order to generate the first test code, the automated code compilation interface developed based on the chatgpt large model framework can also be integrated into the preset software, thereby automatically converting each first test behavior data into the corresponding first test code.

[0049] Based on the plurality of first test codes, a set of automated test behavior scripts is generated.

[0050] Specifically, in this step, each independent first test code needs to be reviewed and optimized to ensure that they accurately reflect the user's operations and the system's responses. These test codes include operations on interface elements, such as clicking buttons, entering text, navigating, etc., as well as corresponding expected system reactions, such as page updates, pop-up window displays, etc. Next, these independent test scripts are arranged and combined into more complex test scenarios to form a collection of automated test behavior scripts containing multiple test cases. This process involves organizing the scripts by functional modules or test priorities to ensure the comprehensiveness and logic of the test.

[0051] Build a test behavior library based on a collection of automated test behavior scripts.

[0052] Specifically, in this step, the generated automated test behavior scripts need to be categorized and organized first, that is, the test scripts are organized according to different software features, functional modules or user scenarios, so that specific scripts can be quickly located and used in future tests. For example, all test scripts related to user account management can be classified into one category, while scripts related to data processing functions can be classified into another category.

[0053] Next, these organized scripts are integrated into a unified test behavior library. In addition to the scripts themselves, the test behavior library should also include related test data, configuration information, and execution environment. The test behavior library needs to ensure easy access and use, and also needs to support continuous updates and expansions to adapt to the continuous development and changes of the software.

[0054] It should be noted that when the preset software has a new function, it is necessary to re-enter the new function according to the process and store it in the test behavior library based on step S11 and step S12.

[0055] Step S13: Acquire a plurality of second test behavior data generated when the second tester tests the preset software according to random operations.

[0056] Specifically, in step S13, firstly, the second tester needs to be selected or determined, and the number of the second tester needs to be greater than that of the first tester. The method of selecting the second tester will be described in detail in the subsequent embodiments.

[0057] The second tester will perform a series of random operations on the preset software. The random operations in this solution refer to the daily user operations or completely random and disordered operations performed by the second tester. Completely random and disordered operations do not have to follow conventional usage patterns or preset test cases, but simulate the random behavior of users in the real world. For example, using functions in an unconventional order, performing abnormal data input, or exploring edge cases of the software.

[0058] Next, the method for obtaining a plurality of second test behavior data is similar to the method for obtaining a plurality of first test behavior data in the aforementioned embodiment, so it will not be described in detail here.

[0059] In a possible implementation, before step S13, the method further includes the following steps:

[0060] Determine one or more screening criteria; based on the one or more screening criteria, screen all users in turn to obtain a second tester.

[0061] Specifically, you first need to determine one or more sets of screening criteria, which can be based on factors such as the user's technical background, frequency of use, software operation habits, device type, age segment, etc. For example, select users who frequently use this type of software, or those who use different types of devices to ensure that the test can cover different usage scenarios and hardware configurations. These criteria are formulated to ensure that the second tester can represent the actual user group of the software in order to obtain comprehensive and real usage data.

[0062] When screening all users, a grayscale test can be used to screen the second tester. That is, the user screening is performed in a step-by-step manner. For example, the user screening ratio can be gradually increased: 10%-20%-50%-100%.

[0063] Step S14: constructing a user behavior library based on the plurality of second test behavior data.

[0064] Specifically, step S14 aims to create a comprehensive test resource collection to reflect the performance of the preset software under various random operations, providing support for automated testing and subsequent software development.

[0065] The following embodiment will explain in detail the specific steps of building a user behavior library based on multiple second test behavior data.

[0066] In a possible implementation, step S14 specifically includes the following steps:

[0067] A plurality of first valid test behavior data is obtained by screening the plurality of second test behavior data.

[0068] Specifically, the first effective test behavior data refers to the operational behavior data related to the test software, as well as the operational behavior data that reflects potential defects, performance issues, or user experience issues in the software. For example, if the preset software responds abnormally or crashes after a specific operation, these situations should be marked and included in the first effective test behavior data.

[0069] Generate a second test code corresponding to each first valid test behavior data.

[0070] Specifically, in the present technical solution, the specific method of generating the second test code corresponding to each first valid test behavior data is similar to the specific method of generating the first test code corresponding to each first test behavior data in the aforementioned embodiment, so no further details will be given here.

[0071] Based on the plurality of second test codes, a set of automated user behavior scripts is generated.

[0072] Specifically, in the present technical solution, the specific method for generating a set of automated user behavior scripts based on multiple second test codes is similar to the specific method for generating a set of automated test behavior scripts based on multiple first test codes in the aforementioned embodiment, so no further details will be given here.

[0073] Build a user behavior library based on a collection of automated user behavior scripts.

[0074] Specifically, in the present technical solution, the specific method of constructing a user behavior library based on a set of automated user behavior scripts is similar to the specific method of constructing a test behavior library based on a set of automated test behavior scripts in the aforementioned embodiment, so no further details will be given here.

[0075] Step S15: Testing the preset software based on the test behavior library and the user behavior library to obtain a first test result.

[0076] Specifically, in this technical solution, the scripts in the test behavior library cover the preset standard operations and expected results, ensuring that the main functions and processes of the software work as expected. The scripts in the user behavior library simulate the possible random and diverse behaviors of real users, providing testing of the software under non-standard usage conditions.

[0077] For the automation code corresponding to the test behavior library and the user behavior library, the code can be classified and saved in different folders according to modules or processes. When performing automated testing of preset software, the corresponding automation code is filtered according to the folder category and applied to the preset software. During the test, the behavior and output of the preset software will be recorded in detail, including any errors or abnormalities. This data is then used to analyze the performance of the software, identify potential problems and improvement points, and obtain the first test results.

[0078] It should be noted that when a software bug is encountered during the automated execution of the test behavior library and the user behavior library, it means that the software fails to work as expected under certain operations or conditions. These bugs may be functional errors, performance issues, user interface defects, or security vulnerabilities. In this case, the specific manifestation of the bug needs to be recorded in detail, including under what operation or under what conditions it occurs, when the bug occurs, and its manifestation. This information is then submitted to the development team so that the development team is responsible for further analysis and repair of the bug.

[0079] On the other hand, if you encounter automation code errors during testing, it means that there are problems with the test script itself. These problems may be script writing errors, logic problems, or improper test environment configuration. In this case, the faulty automation script needs to be reviewed and debugged to determine the cause of the error, which involves checking the syntax of the script, optimizing the logic flow, adjusting the test environment settings, or updating related test data. Once the errors in the script are identified and fixed, the test needs to be re-executed to verify whether the changes are effective.

[0080] In one possible implementation, refer to Figure 2 , which shows a second flow chart of a software testing method based on artificial intelligence provided in an embodiment of the present application. The method also includes steps S21-S25:

[0081] Step S21: collecting first log data corresponding to each first test behavior data.

[0082] Specifically, in the present technical solution, the first log data includes but is not limited to interface return, error log, network environment, mobile phone model, CPU occupancy, memory occupancy, etc.

[0083] Step S22: Based on the plurality of first log data, determine the bug corresponding to the preset software when the preset software is tested according to the preset operation.

[0084] Specifically, in this step, by deeply analyzing these first log data, it is possible to identify abnormal behaviors and potential errors that exist in the preset software when it is tested according to the preset operation. For example, by analyzing the interface return information, problems in data exchange can be detected; through the error log, the specific cause of the software crash or functional failure can be located; and monitoring of CPU and memory usage helps to identify performance bottlenecks. Next, based on these analysis results, the specific bugs in the software are identified. They include but are not limited to functional errors (such as calculation errors, process interruptions), performance issues (such as long response time, excessive resource consumption) or user interface defects (such as layout problems, inconsistent interactions), etc.

[0085] It should be noted that after the bugs are identified, they will be fed back to the developer's terminal, thus providing the developer with a clear direction for improvement. The developer will then solve and fix these bugs in a timely manner.

[0086] Step S23: Filter and obtain a plurality of abnormal test behavior data from the plurality of second test behavior data.

[0087] Specifically, multiple abnormal test behavior data are obtained by screening multiple second test behavior data, that is, behaviors that cause abnormal software reactions, such as error messages, functional failures, crashes or performance degradation, are identified, thereby obtaining multiple abnormal test behavior data.

[0088] Step S24: collecting second log data corresponding to each abnormal test behavior data.

[0089] Specifically, similarly, the second log data includes but is not limited to interface return, error log, network environment, mobile phone model, CPU usage, memory usage, etc.

[0090] Step S25: Based on the plurality of second log data, determine the bug corresponding to the preset software when the software is tested according to the random operation.

[0091] Specifically, the specific implementation method of step S25 is similar to the specific implementation method of step S22, so it will not be described in detail here.

[0092] In one possible implementation, refer to Figure 3 , which shows a third flow chart of a software testing method based on artificial intelligence provided by an embodiment of the present application. After step S15, the method further includes steps S31-S37:

[0093] Step S31: Determine the preset function corresponding to the preset software.

[0094] Specifically, this step is to ensure that in the following testing phase, the functional differences between the preset software and similar software can be accurately identified and compared. By clarifying the core functions and features of the preset software, a solid foundation is provided for identifying similar software and evaluating the operational similarity in the subsequent steps.

[0095] Therefore, to determine the preset functions corresponding to the preset software, it is necessary to clarify the operating system, hardware configuration and network conditions required by the preset software, as well as the design intent, main functions, user interface and user experience goals of the preset software.

[0096] Step S32: Based on the preset function, determine similar software corresponding to the preset software.

[0097] Specifically, in this step, based on software evaluation tools or manual review, the operating system, hardware configuration and network conditions required by the preset software, as well as the design intent, main functions, user interface and user experience goals of the preset software, will be considered to determine whether there is similar software in other software to be tested that is highly consistent with the preset software in hardware conditions and operating functions.

[0098] Step S33: Acquire a plurality of third test behavior data generated when the first tester tests similar software according to preset operations.

[0099] Specifically, the specific implementation method of step S33 is similar to the specific implementation method of step S11, so it will not be described in detail here.

[0100] Step S34: Acquire a plurality of fourth test behavior data generated when the second tester tests similar software according to random operations.

[0101] Specifically, the specific implementation method of step S34 is similar to the specific implementation method of step S13, so it will not be described in detail here.

[0102] Step S35: Filter and obtain a plurality of second valid test behavior data from the plurality of fourth test behavior data.

[0103] Specifically, the specific implementation method of step S35 is similar to the specific implementation method of obtaining a plurality of first valid test behavior data by screening a plurality of second test behavior data, so it will not be described in detail here.

[0104] Step S36: Determine the operational similarity between the similar software and the preset software based on the plurality of first test behavior data, the plurality of third test behavior data, the plurality of first valid test behavior data, and the plurality of second valid test behavior data.

[0105] In a possible implementation, step S36 specifically includes the following steps:

[0106] Perform feature extraction on a plurality of first test behavior data to obtain a plurality of first test behavior features. Perform feature extraction on a plurality of third test behavior data to obtain a plurality of second test behavior features. Perform feature extraction on a plurality of first valid test behavior data to obtain a plurality of third test behavior features. Perform feature extraction on a plurality of second valid test behavior data to obtain a plurality of fourth test behavior features.

[0107] Specifically, it is necessary to first conduct an in-depth analysis of the first test behavior data, the third test behavior data, the first effective test behavior data, and the second effective test behavior data. These data contain the specific operations of the user when using the preset software, such as clicking, sliding, inputting, etc., and the software's response to these operations. The implementation method can be achieved by using data analysis tools to identify common user operation sequences and how the software responds to these operations. By analyzing these operations, key behavior patterns and user interaction characteristics in software use can be identified. Next, these identified behavior patterns and interaction characteristics are converted into quantifiable features. This process may include determining the frequency, sequence, duration of operations, and the response time and results of the software. For example, record the time the user spends on a specific function, the number of clicks, and the loading time of the software.

[0108] Then, the first test behavior feature, the second test behavior feature, the third test behavior feature and the fourth test behavior feature are extracted to identify possible user interface problems or software function bottlenecks. In addition, these features will be used in subsequent steps to compare with the features of similar software, so as to accurately evaluate the operational similarity between the two.

[0109] Based on the plurality of first test behavior features and the plurality of second test behavior features, a first feature similarity is obtained.

[0110] Specifically, data analysis and comparison methods are first needed to process the user behavior features extracted from the preset software and similar software. This includes using statistical methods or machine learning techniques to evaluate and compare the similarities and differences between the two sets of data. For example, compare the operation sequence, reaction time, and interaction mode of users when performing specific tasks in the two software.

[0111] Next, these comparison results are quantified to calculate a numerical value reflecting the similarity of the operation level. This value is based on multiple dimensions such as operation frequency, sequence similarity, time interval, etc. For example, the correlation or distance metric between two sets of operation data is calculated, such as cosine similarity or Jaccard similarity index.

[0112] Based on the plurality of third test behavior features and the plurality of fourth test behavior features, a second feature similarity is obtained.

[0113] Specifically, firstly, it is necessary to conduct an in-depth analysis and comparison of the third test behavior feature and the fourth test behavior feature identified in the aforementioned embodiment. That is, to evaluate the random operation patterns of users when using the software, such as unconventional inputs, behaviors that do not conform to standard usage procedures, etc., and the software's responses to these operations. Through this analysis, the behavior patterns of the software when handling unexpected or random interactions can be revealed.

[0114] Next, these analysis results are quantified to calculate a value that reflects the similarity between the two software in handling random and non-standard operations, that is, comparing the frequency, sequence, duration of user operations, and the consistency and stability of software responses. For example, statistical similarity measurement methods such as Pearson correlation coefficient or Euclidean distance can be used to evaluate the similarity of these behavioral characteristics.

[0115] Based on the first feature similarity and the second feature similarity, the operation similarity is obtained.

[0116] Specifically, in this step, the first feature similarity (reflecting the similarity under standard operation) and the second feature similarity (reflecting the similarity under random operation) need to be reasonably weighted and integrated, that is, a mathematical model or statistical method is used to combine these two similarity metrics to obtain a single indicator representing the overall operational similarity of the two software. For example, the weights of the two similarities are adjusted according to the focus and purpose of the test to reflect the importance of different operation types for the overall evaluation.

[0117] Next, based on this comprehensive similarity index, we draw conclusions about the overall consistency between the preset software and similar software at the user operation level. This index not only takes into account the similarity of standard operating procedures, but also takes into account the behavior of the software in non-standard and random operating scenarios.

[0118] Step S37: When the operation similarity is greater than a preset similarity threshold, similar software is tested based on the test behavior library and the user behavior library to obtain a second test result.

[0119] Specifically, in this technical solution, firstly, a preset similarity threshold needs to be set based on the understanding of software categories and market standards. Once the operational similarity between the preset software and similar software exceeds this threshold, it is considered that these software are similar enough in user operation mode and functional response, and further testing can be performed using the test behavior library and user behavior library.

[0120] Next, the built test behavior library and user behavior library are applied to these similar software. That is, the automated test scripts that have been used to test the preset software and the scripts that simulate real user operations are run on similar software and tested. During the test process, the performance of similar software is closely monitored, including but not limited to functional performance, user interface response, and possible anomalies or errors. These performances are then analyzed to identify potential problems and improvement points, thereby obtaining the second test results.

[0121] Reference Figure 4, which shows a structural schematic diagram of an artificial intelligence-based software testing system provided in an embodiment of the present application, the system includes an acquisition module 1, a behavior library construction module 2 and a test module 3; the acquisition module 1 is used to obtain a plurality of first test behavior data generated when a first tester tests a preset software according to a preset operation; the behavior library construction module 2 is used to construct a test behavior library based on the plurality of first test behavior data; the acquisition module 1 is also used to obtain a plurality of second test behavior data generated when a second tester tests the preset software according to a random operation; the behavior library construction module 2 is also used to construct a user behavior library based on the plurality of second test behavior data; the test module 3 is used to test the preset software based on the test behavior library and the user behavior library to obtain a first test result.

[0122] In one possible implementation, the behavior library construction module 2 is also used to generate a first test code corresponding to each first test behavior data; the behavior library construction module 2 is also used to generate a set of automated test behavior scripts based on multiple first test codes; the behavior library construction module 2 is also used to construct a test behavior library based on the set of automated test behavior scripts.

[0123] In a possible implementation, the system further includes a personnel screening module 4. The personnel screening module 4 is used to determine one or more screening criteria; the personnel screening module 4 is also used to screen all users in turn based on the one or more screening criteria to obtain the second tester.

[0124] In one possible implementation, the behavior library construction module 2 is also used to filter out multiple first valid test behavior data from multiple second test behavior data; the behavior library construction module 2 is also used to generate a second test code corresponding to each first valid test behavior data; the behavior library construction module 2 is also used to generate an automated user behavior script set based on the multiple second test codes; the behavior library construction module 2 is also used to construct a user behavior library based on the automated user behavior script set.

[0125] In a possible implementation, the system further includes a first processing module 5. The first processing module 5 is used to collect first log data corresponding to each first test behavior data; the first processing module 5 is also used to determine the bug corresponding to the preset software when the preset operation is tested based on multiple first log data; the first processing module 5 is also used to filter out multiple abnormal test behavior data from multiple second test behavior data; the first processing module 5 is also used to collect second log data corresponding to each abnormal test behavior data; the first processing module 5 is also used to determine the bug corresponding to the preset software when the random operation is tested based on multiple second log data.

[0126] In a possible implementation, the system further includes a second processing module 6. The second processing module 6 is used to determine the preset function corresponding to the preset software; the second processing module 6 is also used to determine the similar software corresponding to the preset software based on the preset function; the acquisition module 1 is also used to obtain a plurality of third test behavior data generated when the first tester tests the similar software according to the preset operation; the acquisition module 1 is also used to obtain a plurality of fourth test behavior data generated when the second tester tests the similar software according to the random operation; the second processing module 6 is also used to filter out a plurality of second valid test behavior data from the plurality of fourth test behavior data; the second processing module 6 is also used to determine the operational similarity between the similar software and the preset software based on a plurality of first test behavior data, a plurality of third test behavior data, a plurality of first valid test behavior data and a plurality of second valid test behavior data; the testing module 3 is also used to test the similar software based on the test behavior library and the user behavior library to obtain a second test result when the operational similarity is greater than the preset similarity threshold.

[0127] In a possible implementation, the second processing module 6 is further used to perform feature extraction on multiple first test behavior data to obtain multiple first test behavior features; the second processing module 6 is further used to perform feature extraction on multiple third test behavior data to obtain multiple second test behavior features; the second processing module 6 is further used to perform feature extraction on multiple first valid test behavior data to obtain multiple third test behavior features; the second processing module 6 is further used to perform feature extraction on multiple second valid test behavior data to obtain multiple fourth test behavior features; the second processing module 6 is further used to obtain a first feature similarity based on multiple first test behavior features and multiple second test behavior features; the second processing module 6 is further used to obtain a second feature similarity based on multiple third test behavior features and multiple fourth test behavior features; the second processing module 6 is further used to obtain an operation similarity based on the first feature similarity and the second feature similarity.

[0128] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0129] The present application also discloses an electronic device. Figure 5 , Figure 5The electronic device 500 may include: at least one processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .

[0130] The communication bus 502 is used to realize the connection and communication between these components.

[0131] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.

[0132] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0133] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, and it can be implemented separately through a chip.

[0134] Among them, the memory 505 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 505 may optionally be at least one storage device located away from the aforementioned processor 501. Refer to Figure 5 , the memory 505 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module and an application program.

[0135] exist Figure 5 In the electronic device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 501 can be used to call an application stored in the memory 505, and when executed by one or more processors 501, the electronic device 500 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0136] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0137] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

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

[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0140] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0141] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.

[0142] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A software testing method based on artificial intelligence, characterized in that: The method comprises: Acquire a plurality of first test behavior data generated when a first tester tests the preset software according to a preset operation; Generate a first test code corresponding to each of the first test behavior data; Based on the first test codes, generate a set of automated test behavior scripts; Building a test behavior library based on the automated test behavior script set; Acquire a plurality of second test behavior data generated when a second tester tests the preset software according to random operations; Filtering the plurality of the second test behavior data to obtain a plurality of first valid test behavior data; Generate a second test code corresponding to each of the first valid test behavior data; Based on the plurality of the second test codes, generating a set of automated user behavior scripts; Building a user behavior library based on the automated user behavior script set; Testing the preset software based on the test behavior library and the user behavior library to obtain a first test result; Determining a preset function corresponding to the preset software; Based on the preset function, determining similar software corresponding to the preset software; Acquire a plurality of third test behavior data generated when the first tester tests the similar software according to preset operations; Acquire a plurality of fourth test behavior data generated when the second tester tests the similar software according to random operations; Filtering the plurality of fourth test behavior data to obtain a plurality of second valid test behavior data; Determine the operational similarity between the similar software and the preset software based on the plurality of the first test behavior data, the plurality of the third test behavior data, the plurality of the first valid test behavior data, and the plurality of the second valid test behavior data; When the operation similarity is greater than a preset similarity threshold, the similar software is tested based on the test behavior library and the user behavior library to obtain a second test result.

2. The method according to claim 1, characterized in that Before obtaining a plurality of second test behavior data generated when a second tester tests the preset software according to random operations, the method further includes: identifying one or more screening criteria; Based on one or more of the screening criteria, all users are screened in turn to obtain the second tester.

3. The method according to claim 1, characterized in that The method further comprises: Collecting first log data corresponding to each of the first test behavior data; Based on the plurality of the first log data, determining the bug corresponding to the preset software when the preset software is tested according to the preset operation; Filtering the plurality of the second test behavior data to obtain a plurality of abnormal test behavior data; Collecting second log data corresponding to each of the abnormal test behavior data; Based on the plurality of second log data, a bug corresponding to the preset software when the preset software is tested according to the random operation is determined.

4. The method according to claim 1, characterized in that: The determining the operational similarity between the similar software and the preset software based on the plurality of the first test behavior data, the plurality of the third test behavior data, the plurality of the first valid test behavior data, and the plurality of the second valid test behavior data specifically includes: Performing feature extraction on the plurality of first test behavior data to obtain a plurality of first test behavior features; Performing feature extraction on the plurality of third test behavior data to obtain a plurality of second test behavior features; Performing feature extraction on the plurality of first valid test behavior data to obtain a plurality of third test behavior features; Performing feature extraction on the plurality of the second valid test behavior data to obtain a plurality of fourth test behavior features; Obtaining a first feature similarity based on a plurality of the first test behavior features and a plurality of the second test behavior features; Based on the plurality of the third test behavior features and the plurality of the fourth test behavior features, obtaining a second feature similarity; The operation similarity is obtained based on the first feature similarity and the second feature similarity.

5. An artificial intelligence-based software testing system for executing the artificial intelligence-based software testing method according to claim 1, characterized in that: The system includes an acquisition module, a behavior library construction module and a test module; The acquisition module is used to acquire a plurality of first test behavior data generated when a first tester tests the preset software according to a preset operation; The behavior library construction module is used to construct a test behavior library based on the plurality of the first test behavior data; The acquisition module is further used to acquire a plurality of second test behavior data generated when a second tester tests the preset software according to random operations; The behavior library building module is further used to build a user behavior library based on the plurality of the second test behavior data; The testing module is used to test the preset software based on the testing behavior library and the user behavior library to obtain a first testing result.

6. An electronic device, characterized in that: The electronic device (500) comprises a processor (501), a memory (505), a user interface (503) and a network interface (504), wherein the memory (505) is used to store instructions, the user interface (503) and the network interface (504) are used to communicate with other devices, and the processor (501) is used to execute the instructions stored in the memory (505) so that the electronic device (500) executes the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 4 is performed.