Software testing method and device, electronic equipment, storage medium and program product
Automatic code review and test case generation through natural language processing models solve the problems of low efficiency and poor quality of existing software testing technologies, realize efficient and accurate software testing, and launch high-quality software products.
Patent Information
- Application Number
- CN202310802699.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
The existing software testing technology is low efficiency and poor quality, prone to artificial errors, cannot comprehensively test the software, and the code review is not objective.
Natural language processing models (such as ChatGPT) are used to automate code review and test case generation, test software by traversing test cases, generate test reports, and save reports on the blockchain to ensure they are not tampered with.
Improve the efficiency and quality of software testing, reduce manual testing costs, ensure test coverage and accuracy, and launch high-quality software products.
Smart Images

Figure CN119226128A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence and blockchain technology. Specifically, the present application relates to a software testing method, device, electronic device, storage medium and program product. Background Art
[0002] In the existing software testing technology, the test operation object needs to spend a lot of time and energy on manual testing and manual code review. The test efficiency is low, the quality is poor, and it is easy to have errors in human operation. For example, some test cases are omitted due to negligence or subjective selection when setting test cases, resulting in the inability to fully test the software; for example, when conducting code reviews, non-objective code review reports are given due to subjective understanding of product requirements. Summary of the invention
[0003] In order to solve at least one of the above technical problems, the embodiments of the present application provide a software testing method, device, electronic device, storage medium and program product. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a software testing method, comprising:
[0005] Get the software to be tested;
[0006] Acquire product requirement information related to the software to be tested;
[0007] Calling a preset natural language processing model to perform at least one of the following operations on the software to be tested based on the product requirement information:
[0008] Performing code review on the program code of the software to be tested and generating a first code review report;
[0009] Generate at least one first test case related to the software to be tested, so as to test the software to be tested by traversing each first test case and generate a test report;
[0010] Based on a preset test case template related to the software to be tested, at least one test parameter is generated, and each test parameter is filled into the test case template to obtain at least one second test case, and the software to be tested is tested by traversing each second test case to generate a test report.
[0011] In a feasible embodiment, the step of performing a code review on the program code of the software to be tested and generating a first code review report includes:
[0012] Inputting the program code of the software to be tested and the product requirement information into the natural language processing model, and performing a code review on the program code of the test software based on the product requirement information through the natural language processing model to obtain a code review report for the current review;
[0013] If an updated program code is obtained, the natural language processing model is called to re-review the updated program code based on the product requirement information to obtain a code review report for the current review;
[0014] If there is no updated program code, the most recently generated code review report will be used as the first code review report of the first code review phase;
[0015] The updated program code is obtained by modifying the program code that was last code reviewed based on the code review report generated last time.
[0016] In a feasible embodiment, after obtaining the code review report of the current review, the method further includes:
[0017] Sending the code review report of the current review to the developer of the software to be tested;
[0018] monitoring whether the development object submits updated program code corresponding to the software to be tested to a preset code repository, and if so, obtaining the updated program code;
[0019] If no updated program code is obtained or an indication of code review passing is received within the preset monitoring time, it is determined that there is no updated program code;
[0020] The code review passing indication information is sent by the development object after viewing the code review report of the current review.
[0021] In a feasible embodiment, the generating at least one first test case related to the software to be tested includes:
[0022] Acquire test information related to the content to be tested of the software to be tested, determined based on the product requirement information;
[0023] Inputting the test information into the natural language processing model, and generating at least one first test case based on the test information through the natural language processing model;
[0024] The test information includes at least one test operation and the operation results respectively obtained by executing each test operation.
[0025] In a feasible embodiment, the generating at least one test parameter based on a preset test case template related to the software to be tested includes:
[0026] Obtaining a preset test case template related to the software to be tested, wherein the test case template includes at least one test operation, test parameter attributes corresponding to each test operation, and operation results expected to be obtained by executing each test operation;
[0027] The test case template is input into the natural language processing model, and at least one test parameter corresponding to the test parameter attribute is generated for each test operation through the natural language processing model.
[0028] In a feasible embodiment, the step of obtaining the software to be tested includes:
[0029] Monitor whether there is any new or updated program code related to the software in the preset code repository, and if so, obtain the program code and determine the software corresponding to the program code as the software to be tested;
[0030] Among them, the updated program code includes the program code obtained by modifying the current program code based on the first code review report or the second code review report; the second code review report includes a report obtained by using a preset code review method to conduct a code review on the program code of the software to be tested based on the first code review report.
[0031] In a feasible embodiment, when the first test case and the second test case are applied together in the same test phase, the software to be tested is tested by traversing each of the first test case and the second test case to generate a test report for the test phase;
[0032] The method further comprises:
[0033] Traverse the test cases involved in the automated testing process to complete the regression testing of the software to be tested and generate a regression testing report.
[0034] In a feasible embodiment, the natural language processing model is ChatGPT.
[0035] In a feasible embodiment, at least one of the code review report and the test report is saved via blockchain.
[0036] In a second aspect, the present application provides a software testing device, comprising:
[0037] A first acquisition module is used to acquire the software to be tested;
[0038] A second acquisition module is used to acquire product requirement information related to the software to be tested;
[0039] A calling module is used to call a preset natural language processing model and perform at least one of the following operations on the software to be tested based on the product requirement information:
[0040] Performing code review on the program code of the software to be tested and generating a first code review report;
[0041] Generate at least one first test case related to the software to be tested, so as to test the software to be tested by traversing each first test case and generate a test report;
[0042] Based on a preset second test case related to the software to be tested, test parameters of at least one test instance are generated, so as to fill the second test case with the test parameters to obtain at least one test instance, and the software to be tested is tested through the test instance to generate a test report.
[0043] In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the software testing method provided in the first aspect above.
[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the software testing method provided in the first aspect are implemented.
[0045] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the software testing method provided in the first aspect above.
[0046] The beneficial effects of the technical solution provided by the embodiment of the present application are:
[0047] The embodiment of the present application provides a method for automated testing. Specifically, when the software to be tested and its related product requirement information are obtained, a preset natural language processing model can be called to perform at least one of the following operations on the software to be tested based on the product requirement information: Operation 1, code review the program code of the software to be tested, and generate a first code review elevation; Operation 2, generate at least one first test case related to the software to be tested, so as to test the software to be tested by traversing each first test case and generate a test report; Operation 3, based on a preset test case template related to the software to be tested, generate at least one test parameter, fill each test parameter into the test case template to obtain at least one second test case, and test the software to be tested by traversing each second test case to generate a test report. The implementation of the present application can call the natural language processing model of artificial intelligence to perform automated code review in software testing and related operations in automated testing, which can save the time cost of the test operation object, improve test coverage, test efficiency and test quality, and launch high-quality software products. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0049] Figure 1 A flowchart of a software testing method provided in an embodiment of the present application;
[0050] Figure 2 A timing diagram of an AI code review provided in an embodiment of the present application;
[0051] Figure 3 Another timing diagram of AI code review provided in an embodiment of the present application;
[0052] Figure 4 A timing diagram of an automated test provided in an embodiment of the present application;
[0053] Figure 5 A timing diagram of another automated test provided in an embodiment of the present application;
[0054] Figure 6 A schematic diagram of the overall process of software testing provided in an embodiment of the present application;
[0055] Figure 7 A schematic diagram of a business system to which the method provided in an embodiment of the present application is applicable;
[0056] Figure 8 A schematic diagram of the structure of a software testing device provided in an embodiment of the present application;
[0057] Fig. 9A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0059] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".
[0060] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0061] The embodiments of the present application involve artificial intelligence (AI), which is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that involves a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0062] Specifically, embodiments of the present application relate to natural language processing (Nature Language processing, NLP) and machine learning (Machine Learning, ML) technology.
[0063] Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.
[0064] Machine learning is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0065] In response to at least one technical problem existing in the above-mentioned prior art, an embodiment of the present application provides an automated testing solution combining artificial intelligence and blockchain, which can be applied to software testing scenarios; specifically, automated testing and automated code review are realized by referring to artificial intelligence and blockchain technology, and the test report and code review report are saved in a distributed database to ensure that they are saved in an environment that cannot be tampered with.
[0066] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0067] The following is an explanation of the software testing method in the embodiment of the present application.
[0068] Specifically, the system applying the method provided in the embodiment of the present application may include a code repository, a demand management platform, a test platform, a device for running a natural language processing model (which may be a terminal or a server), a blockchain, etc. Among them, the method provided in the embodiment of the present application can be implemented through a test platform and run on a terminal or a server; the terminal (also referred to as a device) may be a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device (such as a smart speaker), a wearable electronic device (such as a smart watch), a vehicle terminal, a smart home appliance (such as a smart TV), an AR / VR device, etc., but is not limited thereto. The server may be an independent physical server, or a server cluster or a distributed system (such as a distributed cloud storage system) composed of multiple physical servers, or a cloud server that provides cloud computing and cloud storage services. Optionally, the natural language processing model may also be run directly by the test platform.
[0069] like Figure 1 As shown, the software testing method includes steps S101 to S103:
[0070] Step S101: Obtain the software to be tested.
[0071] Among them, software in the embodiments of the present application may refer to computer programs, procedures, rules, and possible files, documents and data related to the operation of the computer system; such as some instructions or computer program sets that provide the required functions and performance; illustratively, software may refer to application programs (application software), system software, etc.
[0072] The software to be tested may refer to an object newly developed by the development object according to product requirements, or may refer to an object obtained by modifying the program code of an existing software according to testing or application feedback.
[0073] In one example, the test platform can be triggered by itself to implement the software testing method provided by the present application, such as actively obtaining the software to be tested and starting the software testing process to perform software testing when some set conditions are met. Optionally, the test platform can also receive external instructions to passively trigger the execution of the software testing method.
[0074] Step S102: Acquire product requirement information related to the software to be tested.
[0075] Among them, the software can be an object developed according to product requirements. Based on this, when conducting software testing, it can be processed in combination with the product requirement information corresponding to the software to be tested, such as better understanding the product requirements during the software testing process and modifying the software program code; or checking whether the operation of the software can meet the product requirements during the software testing process. Exemplarily, assuming that the software to be tested is a newly developed application, the product requirement information may include information about certain requirements and questions raised by the software operating object from its own perspective, or information about the experience and functions that the software operating object hopes to obtain.
[0076] Optionally, the product requirement information and the software to be tested can be in a one-to-one correspondence or a one-to-many relationship; for example, in some related products, when a piece of product requirement information is proposed, the development object may modify multiple related software. Therefore, the product requirement information can be the information obtained from the outside in real time when the test platform prepares to perform software testing on the software to be tested, or it can be the information related to the software to be tested obtained by the test platform from its own storage space.
[0077] Step S103: calling a preset natural language processing model, and performing at least one of the following operations 1 to 3 for the software to be tested based on the product requirement information:
[0078] Operation 1: Perform code review on the program code of the software to be tested and generate a first code review report.
[0079] Among them, code review (CR) is the process of improving code quality by reviewing code during software testing. Figure 2 and Figure 6 As shown in the AI code review, the embodiment of the present application performs code review and generates a code review report by calling a natural language processing model; specifically, after the development object submits the code to the code repository, the test platform can download the code from the code repository (obtain the corresponding software to be tested) and send the code to the natural language processing model, and use natural language processing and machine learning techniques through the natural language processing model to check the quality of the code and generate a report (which can automatically identify problems in the code and make improvement suggestions); the generated report can be sent to the development object so that the development object can understand the problems in the code and possible improvement directions while viewing the report.
[0080] The embodiment of the present application completes automated code review by calling a natural language processing model, which can improve the accuracy and consistency of software testing (avoiding subjective differences caused by software testing on different test objects), reduce the workload and time cost of the test objects, and thus improve testing efficiency and quality.
[0081] Operation 2: Generate at least one first test case related to the software to be tested, test the software to be tested by traversing each first test case, and generate a test report.
[0082] Among them, a test case refers to a description of a test task for a specific software product, which can reflect the test plan, method, technology and strategy. For example, a test case can be a set of test inputs, execution conditions and expected results set for the software to be tested, which is used to verify whether the software to be tested meets a specific product requirement. It should be noted that the test case does not include actual results, but sets an expected result; the test case is generated before the test, while the actual result is generated after the software to be tested is tested.
[0083] In the present application, the test platform can use the generation capability of the natural language processing model to generate test cases in an automated manner. Exemplarily, some information about the software to be tested, such as the functions, inputs, and outputs of the software to be tested, can be provided to the natural language processing model based on product requirement information, and the natural language processing model can use this information to automatically create test cases. The embodiment of this method can prevent the test subject from missing some test cases due to negligence or subjective operation. Testing the software to be tested through the first test case can assist the test subject in discovering defects and problems in the software to be tested, thereby improving the test efficiency and quality.
[0084] Operation 3: Based on a preset test case template related to the software to be tested, generate at least one test parameter, fill each test parameter into the test case template to obtain at least one second test case, and test the software to be tested by traversing each second test case to generate a test report.
[0085] Among them, the test case template includes the execution framework but lacks the information of the test instance; for example, a test case is to search for the product "paper towel" to display a list of products containing "paper towel" on the result display page; then the "paper towel" therein is the test parameter of a test instance, and the test case template is the framework information with missing input parameters (test parameters).
[0086] Compared with directly creating a complete test case through the natural language processing model in operation 2, in operation 3, the set test case template can be referenced, the natural language processing model can be called to generate the test parameters of the test case, and then the test parameters can be filled into the test case template to obtain multiple complete test cases. The implementation of operation 3 makes full use of the professionalism of the test object while providing more random and more test parameters through the AI model, thereby improving the test coverage, reducing the time cost of designing test cases, and the interference of subjective factors, improving the accuracy and consistency of the test, thereby improving the test efficiency and quality.
[0087] The embodiments of the present application can call the natural language processing model to perform automated code review on program code and generate high-quality AI code review reports, which is conducive to saving review time; the natural language processing model can also be called to generate a complete first test case for the software to be tested, or to generate test parameters based on the test case template, so as to obtain a complete second test case after filling the test parameters into the test case template, which is conducive to improving test coverage and comprehensiveness, reducing test case design time, reducing testing costs, and thus improving test efficiency and quality.
[0088] Optionally, the natural language processing model cited in the embodiment of the present application may be ChatGPT (ChatGenerative Pre-trained Transformer). ChatGPT is a general artificial intelligence model based on natural language generation, which adopts a pre-trained self-attention mechanism and provides solutions to various text generation tasks by learning a large amount of natural language text. It can generate various content on the Internet, such as news comments, essays, novels, and even code and music. ChatGPT is based on neural machine translation technology, which can not only encode and decode words, but also capture the connection and grammatical structure between different words in a sentence. In the automated code review, the embodiment of the present application utilizes ChatGPT's learning ability for text information, uses ChatGPT to automatically detect functional changes, code quality, and other content involved in the code, and generates a code review report. In automated testing, the embodiment of the present application utilizes ChatGPT's generation ability, and after giving ChatGPT a series of input information, generates the test parameters of the corresponding test cases or test instances through ChatGPT. In the embodiment of the present application, the introduction of ChatGPT can effectively improve the test efficiency and quality.
[0089] Optionally, at least one of the code review report and the test report involved in the embodiment of the present application can be saved through blockchain. Using blockchain technology to save test reports and code review reports can ensure that the reports cannot be tampered with, ensure that the software development, testing, and online processes are open and transparent, and ensure the balanced operation of the system through standardization and normalization. At the same time, it is also more convenient to review or hold accountable when the system fails.
[0090] In a feasible embodiment, obtaining the software to be tested in step S101 includes: monitoring whether there is new or updated program code related to the software in a preset code repository, and if so, obtaining the program code and determining the software corresponding to the program code as the software to be tested.
[0091] Among them, a monitoring program for the code warehouse can be set in the test platform. By monitoring the code warehouse, software testing can be carried out in time for the newly added or updated program code and the corresponding software to be tested. Among them, the code warehouse can also be called a repository, a resource library, a version library, a code library, a storage library, which contains files, directories and metadata. The code warehouse can refer to a platform, a tool or a distributed server or database used to store code in the software testing system. The development object can submit the newly developed or modified program code to the code warehouse for backup and version control.
[0092] Among them, the updated program code includes the program code obtained by modifying the current program code based on the first code review report or the second code review report; the second code review report includes a report obtained by using a preset code review method to conduct a code review on the program code of the software to be tested based on the first code review report.
[0093] like Figure 6 As shown, the updated program code may be the content obtained by modifying the program code based on the first code review report generated by AI in the first code review stage; or it may be the content obtained by modifying the program code based on the second code review report output by the test object in the second code review stage. Figure 6 As shown, the second code review report can be a report obtained by the test object based on the first code review report to conduct a code review on the program code. That is, in the second code review stage, the code review can be conducted in combination with the product requirements and the AI code review results to generate a second code review report with better accuracy and quality.
[0094] The following is a detailed description of the AI code review stage in the embodiments of the present application.
[0095] In a possible embodiment, if Figure 3 As shown, in order to further improve the role of code review in improving code quality in software testing, the embodiment of the present application is designed with an operation of iterating the program code in the AI code review stage. For example, the current program code can be adjusted according to the code review report generated by the current iteration, and after obtaining a program code with better quality, the next iteration of code review is performed on the program code until the latest output code review report indicates that the code quality meets the preset requirements.
[0096] Optionally, in operation 1, code review is performed on the program code of the software to be tested to generate a first code review report, including the following steps A1 to A3:
[0097] Step A1: Input the program code of the software to be tested and the product requirement information into the natural language processing model, and perform a code review on the program code of the test software based on the product requirement information through the natural language processing model to obtain a code review report for the current review.
[0098] Among them, since the code review is performed using a natural language processing model, in addition to inputting product requirement information related to the program code of the software to be tested into the natural language processing model, information related to the code review can also be input, such as the readability of the code, the accuracy of the format (related to the language used to write the code), the length of the function body, the length of the class, the number of parameters, the accuracy of the comments, whether there is duplicate code, the extensibility of the code, etc. General review information in the code review. Step A1 can show the input, operation and output of the natural language processing model in the current iteration operation.
[0099] Step A2: If the updated program code is obtained, the natural language processing model is called to re-review the updated program code based on the product requirement information to obtain a code review report for the current review. The updated program code is obtained by modifying the program code of the last code review based on the code review report generated last time.
[0100] Among them, Figure 3 As shown (exemplifying the code quality detection process), if the test platform can download the updated code, the code review process can be iterated again, the natural language processing model is called on the updated program code to re-detect the code quality, and a new code review report is generated.
[0101] Step A3: If there is no updated program code, the most recently generated code review report is used as the first code review report of the first code review stage.
[0102] Among them, for Figure 6 As a whole, the newly generated code review report can be used as the first code review report finally outputted in this stage. Optionally, the code review reports generated by each iteration in the iterative process can be saved (such as stored in the test platform and blockchain) to facilitate review in case of failure or in subsequent testing and regression testing stages.
[0103] Optionally, in the above steps A1 and A2, after obtaining the code review report of the current review, steps A01 to A03 are further included:
[0104] Step A01: Send the code review report of the current review to the developer of the software to be tested.
[0105] Among them, after obtaining the code review report of the current iteration returned by the natural language processing model, the test platform can store the code review report in its own storage space, and at the same time send the code review report to the development object for review, so that the development object can feedback whether the program code needs to be updated based on the code review report.
[0106] Step A02: monitoring whether the development object submits updated program code corresponding to the software to be tested to a preset code repository, and if so, obtaining the updated program code.
[0107] Among them, the test platform can monitor the code warehouse in real time during the first code review stage to determine in real time whether the development object has submitted program code related to the current software to be tested to the code warehouse. Optionally, the acquisition operation of the updated program code can be implemented by the test platform actively monitoring the code warehouse; the development object can also actively send an update instruction of the program code to the test platform, so that the test platform can obtain the updated program code from the code warehouse based on the update instruction; the development object can also send the updated program code to the code warehouse and send it to the test platform synchronously, so that the test platform can obtain the updated program code faster and more efficiently, and save the resources consumed by monitoring the code warehouse.
[0108] Step A03: If no updated program code is obtained or code review approval indication information is received within the preset monitoring time, it is determined that there is no updated program code. The code review approval indication information is sent by the development object after viewing the code review report of the current review.
[0109] Among them, considering that each stage of software testing needs to effectively control the testing time and efficiency, therefore, in the first code review stage, if the test platform has not obtained the updated program code after monitoring the code repository for a preset period of time, it can be confirmed that there is no need to update the program code (the current program code meets the quality requirements of the code review); alternatively, the development object can determine whether the current program code needs to be updated after reviewing the code review report, and send an indication message to the test platform if there is no need to update the program code, so that the test platform can perform testing operations in other stages.
[0110] In the iterative process of the above-mentioned code review proposed in the embodiment of the present application, if the code quality does not meet the requirements (as can be seen from the code review report), the development object can make modifications according to the instructions in the quality report. The test platform can re-download the code and send the changed code to ChatGPT to re-detect the code quality. ChatGPT can also regenerate a new quality report, and the development object can view the new report to evaluate the effect of the code quality improvement. By using this iterative process in the automated testing solution, the accuracy and consistency of the test can be improved, thereby improving the test efficiency and quality. ChatGPT uses natural language processing and machine learning technology to automatically identify problems in the code and make suggestions for improvement, thereby helping the development object to solve problems in the code faster. This process can also reduce the workload and time cost of the test object and improve the efficiency and quality of the test. Using AI to assist in code quality detection can help the development object identify problems in the code faster and more accurately, and make suggestions for improvement, which can greatly improve the test efficiency and quality, and help launch high-quality software products faster.
[0111] The following is a detailed description of the AI testing phase in the embodiments of the present application.
[0112] In a possible embodiment, if Figure 4 As shown, in operation 2, at least one first test case related to the software to be tested is generated, including the following steps B1-B2:
[0113] Step B1: Acquire test information related to the content required to be tested of the software to be tested, which is determined based on the product requirement information.
[0114] The test information may be extracted from the product requirement information, or may be generated based on the product requirement information.
[0115] Step B2: Input the test information into the natural language processing model, and generate at least one first test case based on the test information through the natural language processing model, wherein the test information includes at least one test operation and the operation results obtained by executing each test operation.
[0116] Example description, assuming that the software to be tested is an application, and its runtime presentation to the operating object is an online shopping website. In the testing phase, it is hoped to test the shopping cart function of the application to ensure that it can add, delete and settle goods normally. The test object can provide ChatGPT with some information about the shopping cart function, or the test platform can determine some information related to the shopping cart function based on the product demand information; for example, the information of the goods to be added-the expected results after adding, the information of the goods to be deleted-the expected results after deleting, the shopping cart information before settlement, etc. ChatGPT will use this input information to automatically generate test cases, such as checking whether the shopping cart contains the product A after adding a product A, checking whether the shopping cart no longer contains the product B after deleting a product B, and checking whether the total price of the goods in the shopping cart is correct before settlement. The test object and the test platform can use the generated test cases to test the shopping cart function to ensure that it can work normally. In the embodiment of the present application, using ChatGPT to automatically generate test cases can avoid the test object from missing some test cases due to negligence or subjectivity, and can also help the test object better understand various aspects of the shopping cart function. The test cases generated by ChatGPT can also help the test object better find defects and problems in the shopping cart function, thereby improving the test efficiency and quality. It is understandable that different software may provide the same shopping cart function, so
[0117] Alternatively, if Figure 6 As shown, the first test case generated by step B2 can be applied to the first test phase to replace all or part of the designed third test case; it can also be applied to the second test phase as a partial test case applied in the third test phase.
[0118] In a possible embodiment, if Figure 5 As shown, in operation 3, at least one test parameter is generated based on a preset test case template related to the software to be tested, including the following steps C1-C2:
[0119] Step C1: obtaining a preset test case template related to the software to be tested, wherein the test case template includes at least one test operation, test parameter attributes corresponding to each test operation, and operation results expected to be obtained by executing each test operation.
[0120] Optionally, the test case template may be obtained based on a preset test case design method, or may be obtained by obtaining a first test case for different test operations and deleting the test parameters of the test instance therein.
[0121] For example, assume that the software to be tested is an application program, and the presentation of the operation object during its runtime is an e-commerce website. During the testing phase, if you want to test the search function of the e-commerce website, the test object can design a test case template related to the search function of the e-commerce website, as shown in Table 1 below:
[0122] Table 1
[0123]
[0124] As can be seen from Table 1, the test case template can be used to test the e-commerce website's search function, and can test the e-commerce website's ability to search, filter and sort products. Among them, different input parameters correspond to different test instances, and each test operation corresponds to an expected result. Optionally, as can be seen in the column for filtering products in the test operation, an input parameter can correspond to multiple parameter attributes. It can be understood that one test case corresponds to one test operation, that is, the example in Table 1 gives three test case templates.
[0125] Step C2: input the test case template into the natural language processing model, and generate at least one test parameter corresponding to the test parameter attribute for each test operation through the natural language processing model.
[0126] In conjunction with the example in step C1 above, after obtaining the test case template, the natural language processing model can be called to generate test parameters (input parameters), so as to fill the generated test parameters into the test case template to generate a second test case, as shown in Table 2 below:
[0127] Table 2
[0128]
[0129] As can be seen from Table 2, for a test operation, the natural language processing model can generate two or more test parameters, and then after filling the test parameters into the test case template, multiple second test cases corresponding to the same test operation can be obtained. It can be understood that one test case corresponds to one test operation, and when N test parameters (corresponding to N test instances) are filled into a test case template, N second test cases can be obtained, that is, the example in Table 2 gives 6 second test cases.
[0130] The embodiment of the present application can effectively improve test coverage, reduce test case design time, reduce test costs, and improve test efficiency and quality by using random parameters generated by ChatGPT to fill in test cases. Among them, filling in test cases with random parameters generated by ChatGPT can increase the number of test cases and increase test coverage, while reducing the time for test subjects to fill in test cases, thereby reducing test costs. In addition, filling in test cases with random parameters generated by ChatGPT can reduce the interference of subjective factors, improve the accuracy and consistency of tests, and thus improve test efficiency and quality.
[0131] Optionally, when the first test case and the second test case are applied together in the same test phase, the software to be tested is tested by traversing each of the first test case and the second test case to generate a test report for the test phase. Figure 6 As shown, in the second test phase, the first test case and the second test case can be applied synchronously, and the first test case and the second test case constitute a test case set, and the software to be tested is tested by traversing all the test cases included in the set, and finally a test report is output.
[0132] In a feasible embodiment, the method provided by the present application further includes step S104: traversing the test cases involved in the automated testing process to complete the regression test of the software to be tested and generate a regression test report.
[0133] Alternatively, if Figure 6 As shown, the regression testing phase can be implemented at the end of software testing, or when changes are detected in the software to be tested, regression testing can be performed by traversing all current historical test cases to ensure that the changed software to be tested meets the product's operating requirements.
[0134] In order to better illustrate the software testing method provided in the embodiment of the present application, an exemplary workflow is given below to illustrate the operations performed in each stage of software testing as a whole.
[0135] First, if Figure 7 As shown, in the software testing system, a requirement proposal object, a development object, a test object, a requirement management platform, a code repository, a test platform, a called natural language processing model (such as ChatGPT), and a blockchain may be involved.
[0136] Among them, Figure 6 As shown, the operational stages related to software launch may include the requirements stage, the development stage, the deployment stage, the first code review stage (also known as the AI code review stage), the second code review stage, the first testing stage, the second testing stage (also known as the AI testing stage), and the regression testing stage.
[0137] In the demand stage, the demand-proposing object can propose the demand and submit the product demand information to the demand management platform. At this time, the development object and the test object can retrieve the product demand information and determine the practicality and necessity of realizing the corresponding product demand.
[0138] During the development phase, the development object can develop the program code of the corresponding software product based on the product requirement information, or modify the program code of the improved software product; then, the development object can submit the relevant program code to the code repository to back up the corresponding program code and perform version control of the software product.
[0139] In the deployment phase, the test platform can monitor the code changes in the code repository. If it is determined that there is new program code or updated program code, it can automatically download the code and deploy it to the test environment. In this phase, the test object can obtain product demand information from the demand management platform and design test cases and automated test cases on the test platform (the processing of this operation can also be completed in the corresponding test phase).
[0140] In the first code review phase, the testing platform calls ChatGPT to automatically detect the code quality of the new code, such as the functional changes involved, etc., generates an AI code review report, saves the AI code review report in its own storage space, and sends it to the blockchain for storage.
[0141] In the second code review phase, the test object can download the code from the code repository and the AI code review report from the test platform. The code review is conducted in combination with the product requirement information and the AI code review report, and the second code review report is generated and sent to the test platform and blockchain for storage.
[0142] In the first test phase, the test object can obtain the third test case from the test platform, complete the test of the software to be tested, generate a test report, and send the test report to the test platform and blockchain for storage. Optionally, in addition to the third test case obtained by applying the preset test case design method, the test object can also obtain at least one first test case generated by the test platform calling ChatGPT for the software to be tested based on the product demand information. Among them, in order to avoid the duplication of the first test case and the third test case, resulting in a longer test time, the first test case and the third test case can be compared before traversing the test case to test the software to be tested. If there are identical test cases (similarity is higher than the set threshold), one of them is deleted. Among them, the comparison of the first test case and the third test case can also be performed by calling a natural language processing model (such as a test case screening operation), and the text sentence is analyzed by the natural language processing model to determine the similarity between the two.
[0143] In the second test phase, the test platform can obtain the test case template designed by the test object according to the preset test case design method. The template may include one or more, and the test platform may call ChatGPT to generate test instance related parameters (test parameters) for each test case template. The test platform can obtain multiple second test cases by filling each test parameter into the corresponding test case template, and then traverse the second test case to test the software to be tested, generate an automated test report, and save the test report to the test platform and the blockchain; optionally, the second test case of the application can also be sent to the blockchain for storage. Optionally, in order to improve the test efficiency and quality, the first test case generated by calling the natural language processing model can be introduced in the second test phase to avoid the problem that the test case template that omits some test cases causes the traversed second test case to fail to comprehensively cover the required test content.
[0144] In the regression testing phase, the testing platform can traverse the historically saved test cases (such as the test cases traversed in the first testing phase and the second testing phase), instruct the software to be tested to execute each test case, complete the regression test, generate a regression test report, and save the regression test report to the testing platform and the blockchain.
[0145] In the embodiments of the present application, on the one hand, artificial intelligence technology is introduced to realize automated testing and AI code review, which can effectively ensure the quality and stability of program code and improve testing efficiency and quality; on the other hand, blockchain technology is introduced to store the test reports and code review reports generated at each stage in a secure and tamper-proof blockchain, so that product-related objects can access the code review report and review the test results at any time, which is conducive to ensuring the openness and transparency of software development, testing, and online processes, and ensuring the balanced operation of the system through standardization and normalization.
[0146] It should be noted that in the optional embodiments of the present application, the data involved (such as the software to be tested, product requirement information, code review reports, test reports and other related data), when the above embodiments of the present application are applied to specific products or technologies, need to obtain permission or consent from the user, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the object, these data need to be obtained with the authorization and consent of the object and in compliance with the relevant laws, regulations and standards of the country and region.
[0147] The present application embodiment provides a software testing device, such as Figure 8 As shown, the software testing device 100 may include: a first acquisition module 101 , a second acquisition module 102 , and a calling module 103 .
[0148] The first acquisition module 101 is used to acquire the software to be tested; the second acquisition module 102 is used to acquire product requirement information related to the software to be tested; the calling module 103 is used to call a preset natural language processing model and perform at least one of the following operations 1 to 3 for the software to be tested based on the product requirement information:
[0149] Operation 1: performing a code review on the program code of the software to be tested and generating a first code review report;
[0150] Operation 2: generating at least one first test case related to the software to be tested, so as to test the software to be tested by traversing each first test case and generate a test report;
[0151] Operation 3: Based on a preset second test case related to the software to be tested, generate test parameters of at least one test instance, fill the second test case with the test parameters to obtain at least one test instance, test the software to be tested through the test instance, and generate a test report.
[0152] In a feasible embodiment, when the calling module 103 is used to perform code review on the program code of the software to be tested and generate the first code review report, it is specifically used to:
[0153] Inputting the program code of the software to be tested and the product requirement information into the natural language processing model, and performing a code review on the program code of the test software based on the product requirement information through the natural language processing model to obtain a code review report for the current review;
[0154] If an updated program code is obtained, the natural language processing model is called to re-review the updated program code based on the product requirement information to obtain a code review report for the current review;
[0155] If there is no updated program code, the most recently generated code review report will be used as the first code review report of the first code review phase;
[0156] The updated program code is obtained by modifying the program code that was last code reviewed based on the code review report generated last time.
[0157] In a feasible embodiment, the calling module 103 is further configured to, after obtaining the code review report for the current review, further include:
[0158] Sending the code review report of the current review to the developer of the software to be tested;
[0159] monitoring whether the development object submits updated program code corresponding to the software to be tested to a preset code repository, and if so, obtaining the updated program code;
[0160] If no updated program code is obtained or an indication of code review passing is received within the preset monitoring time, it is determined that there is no updated program code;
[0161] The code review passing indication information is sent by the development object after viewing the code review report of the current review.
[0162] In a feasible embodiment, when the calling module 103 is used to generate at least one first test case related to the software to be tested, it is specifically used to:
[0163] Acquire test information related to the content to be tested of the software to be tested, determined based on the product requirement information;
[0164] Inputting the test information into the natural language processing model, and generating at least one first test case based on the test information through the natural language processing model;
[0165] The test information includes at least one test operation and the operation results respectively obtained by executing each test operation.
[0166] In a feasible embodiment, when the calling module 103 is used to generate at least one test parameter based on a preset test case template related to the software to be tested, it is specifically used to:
[0167] Obtaining a preset test case template related to the software to be tested, wherein the test case template includes at least one test operation, test parameter attributes corresponding to each test operation, and operation results expected to be obtained by executing each test operation;
[0168] The test case template is input into the natural language processing model, and at least one test parameter corresponding to the test parameter attribute is generated for each test operation through the natural language processing model.
[0169] In a feasible embodiment, when the first acquisition module 101 is used to execute acquisition of the software to be tested, it is specifically used to:
[0170] Monitor whether there is any new or updated program code related to the software in the preset code repository, and if so, obtain the program code and determine the software corresponding to the program code as the software to be tested;
[0171] Among them, the updated program code includes the program code obtained by modifying the current program code based on the first code review report or the second code review report; the second code review report includes a report obtained by using a preset code review method to conduct a code review on the program code of the software to be tested based on the first code review report.
[0172] In a feasible embodiment, when the first test case and the second test case are applied together in the same test phase, the software to be tested is tested by traversing each of the first test case and the second test case to generate a test report for the test phase;
[0173] The device also includes a regression testing module, which is used to:
[0174] Traverse the test cases involved in the automated testing process to complete the regression testing of the software to be tested and generate a regression testing report.
[0175] In a feasible embodiment, the natural language processing model is ChatGPT.
[0176] In a feasible embodiment, at least one of the code review report and the test report is saved via blockchain.
[0177] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0178] The modules involved in the embodiments described in the present application can be implemented by software. The name of the module does not limit the module itself in some cases. For example, the first acquisition module can also be described as "a module for acquiring software to be tested", "a first module", etc.
[0179] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a certain amount of processed data to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0180] The underlying blockchain platform can include object management, basic services, smart contracts, and operation monitoring processing modules. Among them, the object management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between the object's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. The development object can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. At the same time, it also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network status monitoring, node equipment health status monitoring, etc.
[0181] The platform product service layer provides the basic capabilities and implementation framework of typical applications. Based on these basic capabilities, the development objects can superimpose the characteristics of the business and complete the blockchain implementation of the business logic. The application service layer provides application services based on the blockchain solution for business participants to use.
[0182] In an embodiment of the present application, an electronic device is provided, including a memory, a processor and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of the software testing method. Compared with the relevant technology, it can be realized that when the software to be tested and its related product requirement information are obtained, the preset natural language processing model can be called to perform at least one of the following operations for the software to be tested based on the product requirement information: operation 1, code review of the program code of the software to be tested, and generate a first code review elevation; operation 2, generating at least one first test case related to the software to be tested, so as to test the software to be tested by traversing each first test case and generate a test report; operation 3, based on the preset test case template related to the software to be tested, at least one test parameter is generated, so as to fill each test parameter into the test case template to obtain at least one second test case, and test the software to be tested by traversing each second test case, and generate a test report. The implementation of the present application can call the natural language processing model of artificial intelligence to perform automated code review in software testing and related operations in automated testing, which can save the time cost of the test operation object, improve the test efficiency and quality, and launch high-quality software products.
[0183] In an alternative embodiment, an electronic device is provided, such as Fig. 9 As shown, Fig. 9 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0184] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0185] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0186] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0187] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0188] Among them, electronic equipment includes but is not limited to: terminals and servers.
[0189] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0190] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.
[0191] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0192] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0193] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A software testing method, characterized in that: include: Get the software to be tested; Acquire product requirement information related to the software to be tested; Calling a preset natural language processing model to perform at least one of the following operations on the software to be tested based on the product requirement information: Performing code review on the program code of the software to be tested and generating a first code review report; Generate at least one first test case related to the software to be tested, so as to test the software to be tested by traversing each first test case and generate a test report; Based on a preset test case template related to the software to be tested, at least one test parameter is generated, and each test parameter is filled into the test case template to obtain at least one second test case, and the software to be tested is tested by traversing each second test case to generate a test report.
2. The method according to claim 1, characterized in that The step of performing code review on the program code of the software to be tested and generating a first code review report includes: Inputting the program code of the software to be tested and the product requirement information into the natural language processing model, and performing a code review on the program code of the test software based on the product requirement information through the natural language processing model to obtain a code review report for the current review; If an updated program code is obtained, the natural language processing model is called to re-review the updated program code based on the product requirement information to obtain a code review report for the current review; If there is no updated program code, the most recently generated code review report will be used as the first code review report of the first code review phase; The updated program code is obtained by modifying the program code that was last code reviewed based on the code review report generated last time.
3. The method according to claim 2, characterized in that After getting the code review report for the current review, it also includes: Sending the code review report of the current review to the developer of the software to be tested; monitoring whether the development object submits updated program code corresponding to the software to be tested to a preset code repository, and if so, obtaining the updated program code; If no updated program code is obtained or an indication of code review passing is received within the preset monitoring time, it is determined that there is no updated program code; The code review passing indication information is sent by the development object after viewing the code review report of the current review.
4. The method according to claim 1, characterized in that: The generating at least one first test case related to the software to be tested comprises: Acquire test information related to the content to be tested of the software to be tested, determined based on the product requirement information; Inputting the test information into the natural language processing model, and generating at least one first test case based on the test information through the natural language processing model; The test information includes at least one test operation and the operation results respectively obtained by executing each test operation.
5. The method according to claim 1, characterized in that The generating at least one test parameter based on a preset test case template related to the software to be tested includes: Obtaining a preset test case template related to the software to be tested, wherein the test case template includes at least one test operation, test parameter attributes corresponding to each test operation, and operation results expected to be obtained by executing each test operation; The test case template is input into the natural language processing model, and at least one test parameter corresponding to the test parameter attribute is generated for each test operation through the natural language processing model.
6. The method according to claim 1, characterized in that The step of obtaining the software to be tested includes: Monitor whether there is any new or updated program code related to the software in the preset code repository, and if so, obtain the program code and determine the software corresponding to the program code as the software to be tested; Among them, the updated program code includes the program code obtained by modifying the current program code based on the first code review report or the second code review report; the second code review report includes a report obtained by using a preset code review method to conduct a code review on the program code of the software to be tested based on the first code review report.
7. The method according to claim 1, characterized in that When the first test case and the second test case are applied together in the same test phase, the software to be tested is tested by traversing each of the first test case and the second test case to generate a test report for the test phase; The method further comprises: Traverse the test cases involved in the automated testing process to complete the regression testing of the software to be tested and generate a regression testing report.
8. The method according to any one of claims 1 to 7, characterized in that The natural language processing model is ChatGPT.
9. The method according to any one of claims 1 to 7, characterized in that: At least one of the code review report and the test report is saved via blockchain.
10. A software testing device, characterized in that: include: A first acquisition module is used to acquire the software to be tested; A second acquisition module is used to acquire product requirement information related to the software to be tested; A calling module is used to call a preset natural language processing model and perform at least one of the following operations on the software to be tested based on the product requirement information: Performing code review on the program code of the software to be tested and generating a first code review report; Generate at least one first test case related to the software to be tested, so as to test the software to be tested by traversing each first test case and generate a test report; Based on a preset second test case related to the software to be tested, test parameters of at least one test instance are generated, so as to fill the second test case with the test parameters to obtain at least one test instance, and the software to be tested is tested through the test instance to generate a test report.
11. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
