Method, device, equipment and storage medium for generating software testing requirements

By using a pre-trained test requirement generation model, test requirement documents that conform to specifications are automatically analyzed and generated, solving the problems of low efficiency and easy omissions in manual writing, and achieving efficient and accurate software test requirement generation.

CN118484403BActive Publication Date: 2024-11-12AEROSPACE SOFTWARE TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410949726.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-12
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

In existing technologies, software testing requirements mainly rely on manual writing, which has problems such as low efficiency, easy omissions, difficulty in coping with rapidly changing requirements, and strong dependence on personnel.

Method used

Employing a pre-trained test requirement generation model, based on defined domain data, standard knowledge graphs, and software specification requirements, the system automatically analyzes brief test requirement descriptions input by users and generates complete test requirement documents that conform to the specifications.

Benefits of technology

It improved the efficiency and quality of test documentation writing, reduced omissions caused by human error, enabled rapid response to changes in requirements, reduced reliance on the professional competence of testers, and improved test coverage and team collaboration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118484403B_ABST
    Figure CN118484403B_ABST
Patent Text Reader

Abstract

The present application relates to the field of software testing technology, and in particular provides a method, device, equipment and storage medium for generating software testing requirements, the method comprising: obtaining a first content input by a user, the first content comprising a general description of the testing requirements of the software in a set field; using a pre-trained test requirement generation model to analyze the first content to obtain a second document, the second document being a complete test requirement document that meets the requirements of the software specification in the set field; the test requirement generation model is constructed based on the basic data of the set field, the standard knowledge graph of the set field and the requirements of the software specification in the set field. Since the user inputs a relatively accurate general description of the test requirement, the test requirement generation model can generate a complete test requirement document that meets the requirements of the software specification in the set field, avoiding various problems existing in the tester manually writing the test requirement document, and improving the writing efficiency and document quality of the test document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a method, device, equipment and storage medium for generating software testing requirements. Background Art

[0002] Test requirements refer to a set of test steps and input data written during the software testing process to verify whether the software system meets the expected functional and performance requirements.

[0003] In the relevant technologies, the current mainstream software testing requirements mainly rely on manual writing by testers. The process of testers writing test cases mainly includes: testers carefully read the software requirements documents, design documents and source code, and deeply understand the functions, behaviors, interfaces and internal structures of the software. Based on the understanding of the software system, testers list detailed test requirements one by one, covering multiple dimensions such as functional testing, performance testing, security testing, compatibility testing, etc., and clarify the test objectives, test methods, expected results and evaluation criteria. After completing the first draft, the test requirements are comprehensively reviewed and revised through peer review, expert review, etc. to ensure their completeness, correctness and consistency.

[0004] In the related technologies, due to reliance on manual writing by testers, there are problems such as low efficiency, easy omissions, and difficulty in responding to rapidly changing needs. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a method, device, equipment and storage medium for generating software testing requirements, which improves the writing efficiency and document quality of test documents.

[0006] In a first aspect, the present application provides a method for generating software testing requirements, the method comprising: obtaining first content input by a user, the first content comprising a general description of the testing requirements for software in a set domain; using a pre-trained test requirement generation model to analyze the first content to obtain a second document, the second document being a complete test requirement document that meets the software specification requirements of the set domain; the test requirement generation model is constructed based on set domain data, a set domain standard knowledge graph, and historical test requirements of related software.

[0007] In the second aspect, the present application provides a device for generating software testing requirements, which includes: a first content acquisition module, used to obtain first content input by a user, the first content including a general description of the testing requirements for software in a set domain; a second document determination module, used to analyze the first content using a pre-trained test requirement generation model to obtain a second document, the second document being a complete test requirement document that meets the software specification requirements of the set domain; the test requirement generation model is constructed based on set domain data, a set domain standard knowledge graph, and historical test requirements of related software.

[0008] In a third aspect, the present application provides a device for generating software testing requirements, the device comprising: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by one or more processors, the one or more processors implement the method for generating software testing requirements as described in the first aspect above.

[0009] In a fourth aspect, the present application provides a storage medium, which may be a computer-readable storage medium, storing a computer program thereon, which, when executed by a processor, implements the method for generating software testing requirements as described in the first aspect above.

[0010] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages:

[0011] The embodiment of the present application provides a method, device, converter and storage medium for generating software test requirements, the method comprising: obtaining a first content input by a user, the first content comprising a general description of the test requirements of the software in a set field; using a pre-trained test requirement generation model to analyze the first content to obtain a second document, the second document being a complete test requirement document that meets the software specification requirements of the set field; the test requirement generation model is constructed based on the basic data of the set field, the standard knowledge graph of the set field and the software specification requirements of the set field. Since the user inputs a simple general description of the test requirements, the test requirement generation model can generate a complete test requirement document that meets the software specification requirements of the set field, avoiding various problems existing in the tester manually writing the test requirement document, and improving the writing efficiency and document quality of the test document. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0013] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0014] Figure 1 A flowchart of a method for generating software test requirements provided in an embodiment of the present application;

[0015] Figure 2 A schematic diagram of a flow chart of a second document determination method provided in an embodiment of the present application;

[0016] Figure 3 A schematic diagram of a first document page provided in an embodiment of the present application;

[0017] Figure 4 A schematic diagram of a second document page provided in an embodiment of the present application;

[0018] Figure 5 A flow chart of a test requirement generation model optimization method provided in an embodiment of the present application;

[0019] Figure 6 A schematic diagram of the structure of a device for generating software test requirements provided in an embodiment of the present application;

[0020] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0022] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

[0023] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0024] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0025] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0026] Test requirements refer to a set of test steps, test conditions, and expected results written during the software testing process to verify whether the software system meets the expected functional and performance requirements. Test requirements usually include information such as test purpose, test conditions, test steps, and expected results, and are intended to verify the correctness, stability, reliability, and security of the software system. By executing test cases, defects and problems in the software system can be discovered, and repairs and improvements can be made in a timely manner to improve software quality and user satisfaction.

[0027] In the relevant technologies, the current mainstream software test cases mainly rely on manual writing by testers. The process of testers writing test cases mainly includes three steps: (1) In-depth understanding: testers carefully read the software test requirements documents, design documents and source code, and rely on their deep professional background and practical experience to deeply understand the functions, behaviors, interfaces and internal structures of the software. (2) Manual writing: Based on the understanding of the software system, engineers list detailed test requirements item by item, covering multiple dimensions such as functional testing, performance testing, security testing, compatibility testing, etc., and clarify the test objectives, test methods, expected results and evaluation standards. (3) Review and optimization: After completing the first draft, the test requirements are comprehensively reviewed and revised through peer review, expert review, etc. to ensure their completeness, correctness and consistency.

[0028] With the increasing complexity, functional diversity, and increasing safety standards of current software systems, traditional strategies for generating test requirements face significant challenges. These strategies rely mainly on experienced and skilled test engineers to manually write detailed test requirements by manually analyzing software requirements, design documents, and source code. However, this approach has the following limitations:

[0029] (1) Inefficiency: Manually writing test requirements is time-consuming, especially in large and complex software projects. It requires a lot of human resources to carry out meticulous analysis and documentation, which seriously affects the testing cycle and the overall project progress.

[0030] (2) Easy to miss: Human factors may lead to incomplete coverage of test requirements, especially when dealing with complex logic, abnormal situations and boundary conditions. Test engineers may miss key test points due to fatigue, negligence or knowledge blind spots.

[0031] (3) Poor adaptability: Faced with rapidly changing requirements, manually written test requirements are difficult to respond to and update quickly, which often leads to a disconnect between test activities and actual needs, increasing the cost of subsequent rework.

[0032] (4) Strong dependence on personnel: The generation of high-quality testing needs is highly dependent on the professional qualities and experience accumulation of individual testers. The mobility of testers or differences in their abilities may lead to fluctuations in test quality, which is not conducive to team collaboration and knowledge inheritance.

[0033] To solve one or more of the above-mentioned technical problems, an embodiment of the present application provides a method for generating software testing requirements, the method comprising: obtaining a first content input by a user, the first content comprising a general description of the testing requirements for software in a set domain; using a pre-trained test requirement generation model to analyze the first content to obtain a second document, the second document being a complete test requirement document that meets the software specification requirements of the set domain; the test requirement generation model is constructed based on basic data of the set domain, a standard knowledge graph of the set domain, and software specification requirements of the set domain.

[0034] Since the user inputs a simple general description of the test requirements, the test requirement generation model can generate a complete test requirement document that meets the requirements of the set domain software specifications, avoiding various problems that exist when testers manually write test requirement documents, and improving the writing efficiency and quality of test documents.

[0035] The following is a detailed description of the method for generating software testing requirements provided by the present application in conjunction with the accompanying drawings and specific implementation methods.

[0036] Figure 1 This is a flowchart of a method for generating software testing requirements in an embodiment of the present application. This embodiment is applicable to the situation of automatically generating software testing requirements. The method can be executed by a software testing requirement generating device. The software testing requirement generating device can be implemented in software and / or hardware. The software testing requirement generating device can be configured in an electronic device.

[0037] like Figure 1 As shown, the method for generating software testing requirements provided in the embodiment of the present application mainly includes steps S101-S102.

[0038] S101. Obtain first content input by a user, where the first content includes a general description of test requirements for software in a set field.

[0039] The set domain can refer to a field that has certain barriers to other conventional fields, for example, the set domain can refer to the military field. Since the software in the set domain needs to involve a specific operating environment, a specifically designed strategic background, and strictly defined rules at the beginning of software design, conventional artificial intelligence (AI) models lack a deep understanding of the unique concepts and logic in the set domain without sufficient training, and cannot generate targeted testing requirements.

[0040] The first content is an initial, general description of the test requirements, which includes information on the basic functions, expected behaviors, key business processes or specific quality attributes of the software. Since the description of the first content is relatively brief, it may lack details such as specific test conditions, expected results, data boundaries, abnormal scenarios, etc. For example, when the test requirement is for the angle test requirement of the software, the first content can be: "The servo master control software receives the angle control command sent by the airborne optical terminal, and after the control platform rotates to the response angle, it reports the current azimuth and pitch angle values ​​to the airborne optical terminal."

[0041] When testing the software, it can be a test of the overall performance of the entire software, for example: overall testing requirements for various functions that the software can achieve, software operating performance, software security, and other dimensions. Therefore, the first content can be understood as a general description of the overall testing requirements for the software. Furthermore, in order to ensure the accuracy of the output test requirement document, the first content is a relatively accurate general description of the test requirements entered by the user.

[0042] During software testing, only one type of function or one of the service performances in the software may be tested. Therefore, the first content may also be a general description of the test requirements for a certain service performance of the software.

[0043] In one possible implementation, obtaining the first content input by the user includes: obtaining a first text input by the user, where the first text is a general description of the test requirement. In another possible implementation, obtaining the first content input by the user includes: obtaining a first voice input by the user, performing voice recognition on the first voice, and identifying a general description of the test requirement in the first voice as the first content.

[0044] In another implementation, see Figure 2 , a user inputs a document including a test item, a test name, a test identifier, and a brief description of the test requirement, and the content of the document is identified and extracted to obtain the first content.

[0045] S102. Use a pre-trained test requirement generation model to analyze the first content to obtain a second document, where the second document is a complete test requirement document that meets the requirements of the set domain software specification; the test requirement generation model is constructed based on the set domain basic data, the set domain standard knowledge graph, and the set domain software specification requirements.

[0046] Among them, the second document is a complete test requirement document that meets the requirements of the set domain software specifications; the second document mainly includes: test case name, test case identification, brief description of test requirements, participating equipment, preconditions, main process, extended process, post-process, test rules and constraints, etc.

[0047] Among them, the basic data of the set field includes the basic knowledge of the set field, professional terms, special environment, security theory, threat intelligence, etc. Among them, the special field environment data includes: extremely cold environment, extremely high temperature environment, super destructive environment, etc.

[0048] Based on the basic knowledge and professional terminology of the set domain, a test requirement generation model is constructed, so that deep learning and the set domain knowledge are deeply integrated, so that the test requirement generation model has a deep understanding of the software's unique business logic, operating procedures, professional terminology, etc., ensuring that the generated test requirements are close to the actual situation.

[0049] Based on the security theory and practical threat intelligence in the set field, a test demand generation model is constructed so that the test cases generated by the test demand generation model can comprehensively and accurately test the security protection capabilities of the software.

[0050] Integrate environmental characteristic data so that the test requirement generation model can simulate various complex environmental conditions, ensuring that the generated test requirements cover performance and stability testing of the software in extreme environments.

[0051] The complete knowledge graph of set domain standards is seamlessly embedded into the test requirement generation model to ensure that the generated test requirements automatically follow and verify relevant standard requirements during the automatic generation process.

[0052] The test requirement generation model has powerful semantic parsing capabilities, can deeply understand the internal logic of software functions, and automatically derive various normal paths, abnormal paths, boundary conditions and compatibility test scenarios. Through in-depth analysis of input documents, the model can generate comprehensive and targeted test case requirements.

[0053] In one possible implementation, a user inputs a summary description of the entire software test requirements, and the summary description of the test requirements is input into a pre-trained test requirements generation model to analyze the summary description of the entire software test requirements, obtain a document including the test requirements of each dimension of the entire software, and display the document in the terminal interface. The tester can judge whether the test requirements of each dimension are missing or complete based on the displayed document. The tester can input a summary description of the test requirements for a specific test dimension, test project, or test business based on the incomplete parts of the document. A summary description of the test requirements input for a specific test dimension, test project, or test business is obtained, and the pre-trained test requirements generation model analyzes the summary description of the test requirements for a specific test dimension, test project, or test business to obtain the test requirements for a specific test dimension, test project, or test business, so as to improve and update the document including the test requirements of each dimension of the entire software.

[0054] If there are still omissions or incompleteness in the test requirements, you can enter a general description of the test requirements for a specific test dimension, test project or test business multiple times to continuously improve and update the document covering the test requirements of all dimensions of the entire software, so as to obtain a complete test requirement document that meets the software specification requirements of the set domain.

[0055] The embodiment of the present application provides a method for generating software test requirements, the method comprising: obtaining a first content input by a user, the first content comprising a general description of the test requirements of the software in a set field; using a pre-trained test requirement generation model to analyze the first content to obtain a second document, the second document being a complete test requirement document that meets the requirements of the software specification in the set field; the test requirement generation model is constructed based on the basic data of the set field, the standard knowledge graph of the set field, and the software specification requirements in the set field. Since the user inputs a simple general description of the test requirements, the test requirement generation model can generate a complete test requirement document that meets the requirements of the software specification in the set field, avoiding various problems that exist in the tester manually writing the test requirement document, and improving the writing efficiency and document quality of the test document.

[0056] On the basis of the above embodiment, the embodiment of the present application optimizes the step of "S102, using a pre-trained test requirement generation model to analyze the first content to obtain a second document", such as Figure 2 As shown, the optimized “using the pre-trained test requirement generation model to analyze the first content to obtain the second document” mainly includes the following steps:

[0057] S201. Extract key elements of the test requirements from the first content.

[0058] In this embodiment, the first content is a first document as an example. The first document can be understood as the original demand document. Figure 3 As shown, one of the test items in the first document mainly includes: test item, test case name, test requirement identifier, and test requirement general description.

[0059] In the case where the first content is a document, after obtaining the first document input by the user, it is determined whether the first document meets the general requirements of the software development document in the set domain. If not, the content in the first document that does not meet the general requirements of the software development document in the set domain is modified. After the first document meets the general requirements of the software development document in the set domain, the key elements corresponding to the test requirements are extracted from the first document. Through in-depth analysis of the first document, the key elements of each functional requirement are extracted.

[0060] Exemplarily, the general requirements for setting domain software development documents may be the directory chapter structure of GJB438B or GJB438C.

[0061] The above key elements include one or more of the following: test requirement identification, test requirement summary description, business rules corresponding to the test requirement, priority of each business requirement, and the relationship between each business requirement.

[0062] Among them, the test requirement identifier refers to the unique identifier of a specific functional requirement. The test requirement summarizes the detailed description of the required function, including expected behavior, constraints, etc. The business rules corresponding to the test requirement refer to the business logic, operation process, data constraints, etc. related to the function. The priority of each business requirement is used to measure the level of importance and urgency of the requirement. The relationship between each business requirement includes the dependency or interaction with other requirements.

[0063] S202: Perform context analysis on key elements to obtain a third document, wherein the third document is an initial description document of the test requirements.

[0064] Based on the parsed key elements, the initial description document is quickly generated using the powerful language understanding and generation capabilities of the test requirements generation model. The test requirements generation model can automatically generate comprehensive and logically coherent test objectives, test conditions, expected results, etc. by combining contextual information, providing basic materials for subsequent requirement description revisions.

[0065] S203: Modify the third document to obtain a second document.

[0066] Make fine-grained revisions to the initial description document of the test requirements to obtain a second document, ensuring that the second document is accurate, clearly expressed and meets the software specification requirements.

[0067] The second document includes test items of different dimensions of the software, and the test objectives, test conditions, test steps, and expected results corresponding to each test item. Figure 4 This is a page diagram of the test requirements document for the angle control test project. Figure 4 , the test requirements in the angle control test project mainly include: test participants, preconditions, main process, extended process and postconditions, etc.

[0068] In a possible implementation, the third document is corrected, including: when the third document does not meet the software specification requirements of a set field, correcting the document style of the third document; when the logical relationship of the third document is incorrect, correcting the logical relationship of the third document.

[0069] Among them, the software specification requirements refer to the general requirements for software development documents in the setting field. For example, the software specification requirements can be the directory chapter structure of GJB438B or GJB438C.

[0070] If the third document does not meet the software specification requirements of the set field, the document style of the third document shall be revised to meet the professional terms and expression style of the general requirements of software development documents in the set field, so as to improve the professionalism and consistency of the description. Among them, the document style includes expression methods, professional terms, etc.

[0071] Ensure that the logical relationships among the test objectives, test conditions, expected results, etc. in the test requirements are clear without any contradictions or confusion.

[0072] Determine whether the content of the third document is consistent with the content of the first document. If not, regenerate a new test requirement document for the inconsistent content to replace the inconsistent content in the third document with the first document. In this way, verify the accuracy of the test requirements and ensure that they are consistent with the original requirements document without omissions or misunderstandings.

[0073] Determine whether the logical relationship between the test objectives, test conditions, and prediction results in each test project is correct and clear. If there is a contradiction or confusion in the logical relationship between the test objectives, test conditions, and prediction results in the test project, correct the logical relationship of the test project or regenerate the test requirements corresponding to the test project.

[0074] After the coordinated operation of the above three steps, the software test requirement generation model finally outputs a test requirement document with rigorous structure, accurate content, and compliance with software specifications. This document lists in detail the test objectives, test conditions, expected results and other elements for each original functional requirement of the software. After strict control by the requirement description correction module, the accuracy and standardization of the test requirement description are ensured, providing a solid foundation for high-quality and efficient software testing work in the set field. Based on this document, the test team can formulate a detailed test plan, write test cases, and effectively guide the actual test execution process.

[0075] Based on the above embodiment, the above test requirement generation method also includes: in response to a modification instruction for the second document, modifying the test requirement in the second document, the modification instruction includes: a priority setting instruction, a test item update instruction, and an association modification instruction.

[0076] During the implementation of this application, a user-friendly interactive interface was developed to allow testers to interact with the generated test requirement documents. Testers can add, delete, modify, query, set priorities, establish associations, and other operations on the generated test items. At the same time, the system will continuously optimize the output of the test requirement generation model based on feedback, and realize the iteration and improvement of test requirements in human-computer collaboration.

[0077] Based on the above embodiment, the above test requirement generation method also includes: real-time monitoring of software change information, wherein the change information includes at least one of the following: update log, code submission, defect report; based on the change information, real-time correction of the test content related to the change information in the second document.

[0078] The test requirements generation model has self-learning capabilities, can track software change logs, code submissions, defect reports and other information in real time, and dynamically adjust test requirements to adapt to the rapid iteration of software versions. In addition, the test requirements generation model can automatically introduce best practices based on project characteristics and industry standards to ensure that the generated test requirements are always consistent with the latest technology trends and quality standards.

[0079] Based on the above embodiments, the present application provides an optimization method for a test demand generation model, such as Figure 5 As shown, the optimization method of the test demand generation model provided in the embodiment of the present application mainly includes the following steps:

[0080] S301: Obtain input document.

[0081] Among them, the format and acquisition method of the input document are the same as the format and acquisition method of the first document in the above embodiment. For details, please refer to the description in the above embodiment, and will not be repeated in the embodiments of this application.

[0082] The tester provides an initial, general description of the test requirements, which may include information on the basic functions, expected behaviors, key business processes, or specific quality attributes of the software. Since the initial description is relatively brief, it may lack details such as specific test conditions, expected results, data boundaries, and abnormal scenarios.

[0083] S302: Input the input document into the test requirement generation model to obtain an initial document.

[0084] Through the deep integration of deep learning and domain knowledge, the test demand generation model has a deep understanding of the software's unique business logic, operating procedures, professional terminology, etc. The pre-trained test demand generation model (such as a large language model) has rich domain knowledge, software engineering experience, and understanding of software test requirement specifications.

[0085] The test requirement generation model receives as input the input document provided by the user and combines its internal knowledge base, including but not limited to software development best practices, testing strategies, industry standards, and test case samples from similar software projects, to reason and generate the missing details.

[0086] The test requirements generation model expands the input document (initial, relatively general test requirements description) into a detailed test requirements document, covering necessary elements such as test objectives, test items, test steps, expected results, priorities, and associated defect tracking information.

[0087] S303: Obtaining annotation information of the initial document, where the annotation information includes error information and correction suggestions in the initial document.

[0088] The tester identifies and points out the errors or problems in the detailed test requirements in the initial document of the first step, such as logical errors, non-compliance with actual business rules, omission of important test points or unclear expressions, etc. The tester also clearly points out the parts that need to be corrected, which can be overall structural adjustments or modifications to specific items.

[0089] Get testers to point out errors or problems in the detailed test requirements in the initial document in the first step, as well as suggestions for corrections.

[0090] S304: Use the initial document and annotation information to adjust model parameters of the test requirement generation model.

[0091] The trained test demand generation model receives the error information and correction suggestions annotated by the user and uses them as new learning samples to optimize the model parameters. The model adjusts its own parameters or updates the knowledge base through reinforcement learning, continuous learning or other adaptive learning mechanisms to reduce the probability of the same errors when generating similar requirements in the future.

[0092] With the continuous guidance of the testers, the test requirement generation model continuously modifies the generated test requirement documents until the testers are satisfied. This process may involve multiple rounds of interaction, and each round will make the test requirement generation model closer to the actual project requirements.

[0093] In summary, this method uses the powerful language understanding and generation capabilities of the generative AI model to assist users in quickly building detailed software testing requirements. In the early stage, the test requirement generation model generates a preliminary requirement document based on the brief input provided by the user and the internal knowledge base; then, the tester guides the test requirement generation model to make corrections through feedback. The model continuously optimizes its generation capabilities during the learning process, and finally forms an accurate and comprehensive description of the test requirements. This human-computer collaborative approach not only takes advantage of humans in understanding complex business logic and identifying abnormal situations, but also makes full use of AI's ability to efficiently process large amounts of information and quickly generate specification documents, effectively improving the efficiency and quality of test requirement formulation.

[0094] Compared with the related art, the beneficial effects of the method for generating test requirements provided in the embodiment of the present application are embodied in the following aspects:

[0095] 1. Significantly improve efficiency: By adopting this method, the time for generating software test requirements can be shortened to 1 / 5 of the traditional manual writing method, which greatly reduces the workload of testers and enables them to focus more on the analysis of complex problems and the design of advanced test strategies.

[0096] 2. Improve test coverage: The test requirements generated by the model trained in a specific field can comprehensively cover various functional, performance, security and other test dimensions, significantly reduce the test blind spots caused by human negligence, and improve the overall test coverage of the software.

[0097] 3. Enhance the quality of requirements: The generated test requirements are clearly expressed, logically rigorous, and highly relevant. They are easy to understand and execute, which helps to improve the collaboration efficiency of the test team, reduce communication costs, and ensure that the test activities are highly consistent with the project goals.

[0098] 4. Flexible adaptation to changes: Through dynamic updates and adaptive learning mechanisms, this application method can effectively cope with frequent changes in software projects, ensuring that test requirements always remain consistent with the actual software status, and providing strong support for efficient testing in an agile development environment.

[0099] In summary, the generative AI software testing requirements generation method proposed in this application, through key technologies such as deep learning model construction, semantic parsing and scenario reasoning, interactive requirements optimization, dynamic update and adaptive learning, realizes efficient, comprehensive, accurate and dynamic generation of software testing requirements, significantly improves the quality and efficiency of software testing, and brings innovative solutions to the practice of automated testing in the field of software engineering.

[0100] Figure 6 FIG. 1 is a schematic diagram of a structure of a device for generating software test requirements in an embodiment of the present application, such as Figure 6 As shown, the software testing requirement generation device 60 provided in the embodiment of the present application mainly includes: a first content acquisition module 61 and a second document determination module 62.

[0101] Among them, the first content acquisition module 61 is used to obtain the first content input by the user, and the first content includes a general description of the test requirements of the software in the set domain; the second document determination module 62 is used to use a pre-trained test requirement generation model to analyze the first content to obtain a second document, and the second document is a complete test requirement document that meets the software specification requirements of the set domain; the test requirement generation model is constructed based on the basic data of the set domain, the standard knowledge graph of the set domain, and the software specification requirements of the set domain.

[0102] The embodiment of the present application provides a device for generating software test requirements, which is used to execute the following process: obtaining a first content input by a user, the first content including a general description of the test requirements of the software in a set field; using a pre-trained test requirement generation model to analyze the first content, and obtaining a second document, the second document is a complete test requirement document that meets the requirements of the software specification in the set field; the test requirement generation model is constructed based on the basic data of the set field, the standard knowledge graph of the set field, and the software specification requirements of the set field. Since the user inputs a simple general description of the test requirements, the test requirement generation model can generate a complete test requirement document that meets the requirements of the software specification in the set field, avoiding various problems that exist in the tester manually writing the test requirement document, and improving the writing efficiency and document quality of the test document.

[0103] In one possible implementation, the second document determination module 62 is specifically used to extract key elements of the test requirements from the first content; perform context analysis on the key elements to obtain a third document, wherein the third document is an initial description document of the test requirements; and modify the third document to obtain a second document.

[0104] In a possible implementation, the key elements include one or more of the following: a test requirement identification, a summary description of the test requirement, business rules corresponding to the test requirement, the priority of each business requirement, and the relationship between each business requirement; the second document includes test items of different dimensions of the software, and the test objectives, test conditions, test steps, and expected results corresponding to each test item.

[0105] In a possible implementation, it further includes: a modification module, which is used to modify the test requirements in the second document in response to a modification instruction for the second document, and the modification instruction includes: a priority setting instruction, a test item update instruction, and an association modification instruction.

[0106] In a possible implementation, the second document determination module 62 is specifically used to correct the document style of the third document when the third document does not meet the software specification requirements of the set field; when the logical relationship of the third document is incorrect, correct the logical relationship of the third document.

[0107] In a possible implementation, it also includes: a model optimization module, which is used to obtain an input document; input the input document into a test requirement generation model to obtain an initial document; obtain annotation information of the initial document, the annotation information includes error information in the initial document and correction suggestions; and use the initial document and annotation information to adjust the model parameters of the test requirement generation model.

[0108] In one possible implementation, the device also includes: a test content update module for real-time monitoring of software change information, wherein the change information includes at least one of the following: update log, code submission, defect report; and real-time correction of test content related to the change information in the second document based on the change information.

[0109] The device for generating software testing requirements provided in the embodiments of the present application can execute the method for generating software testing requirements provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method.

[0110] Figure 7 is a schematic diagram of the structure of an electronic device provided in this embodiment. The electronic device may include a device for generating software test requirements, such as Figure 7 As shown, the electronic device 700 includes a processor 710, a memory 720, an input device 730, and an output device 740; the number of the processor 710 in the electronic device can be one or more. Figure 7 A processor 710 is taken as an example; the processor 710, the memory 720, the input device 730 and the output device 740 in the electronic device can be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0111] The memory 720, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for generating software test requirements in the embodiment of the present application. The processor 710 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 720, that is, the method for generating software test requirements provided in the embodiment of the present application is implemented.

[0112] The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 720 may further include a memory remotely arranged relative to the processor 710, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0113] The input device 730 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device, and may include a keyboard, a mouse, etc. The output device 740 may include a display device such as a display screen.

[0114] This embodiment also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to implement the method for generating software testing requirements provided in the embodiment of the present application.

[0115] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present application is not limited to the method operations described above, and can also execute related operations in the method for generating software testing requirements provided in any embodiment of the present application.

[0116] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0117] It is worth noting that in the embodiment of the above-mentioned software testing requirement generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.

[0118] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0119] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating software testing requirements, characterized in that: The method comprises: Acquire first content input by a user, wherein the first content is a general description of the overall testing requirements of the software in a set field; The first content is analyzed using a pre-trained test requirement generation model to obtain a second document, where the second document is a complete test requirement document that meets the requirements of the set domain software specification; the test requirement generation model is constructed based on the set domain basic data, the set domain standard knowledge graph, and the set domain software specification requirements; The first content is analyzed using a pre-trained test requirement generation model to obtain a second document, including: analyzing the first content using a pre-trained test requirement generation model to obtain documents of test requirements of each dimension; for dimensions where test requirements are missing, obtaining a general description of the test requirements of the missing dimensions; analyzing the general description of the test requirements of the missing dimensions using a pre-trained test requirement generation model to obtain the test requirements of the missing dimensions; and updating the documents of the test requirements of each dimension using the test requirements of the missing dimensions to obtain a second document.

2. The method according to claim 1, characterized in that The using of the pre-trained test requirement generation model to analyze the first content to obtain a second document includes: Extracting key elements of the test requirements from the first content; Performing context analysis on the key elements to obtain a third document, wherein the third document is an initial description document of the test requirements; The third document is modified to obtain a second document.

3. The method according to claim 2, characterized in that The key elements include one or more of the following: test requirement identification, test requirement summary description, business rules corresponding to the test requirement, priority of each business requirement, and association relationship between each business requirement; The second document includes test items of different dimensions of the software, and the test objectives, test conditions, test steps, and expected results corresponding to each test item.

4. The method according to claim 3, characterized in that Also includes: In response to a modification instruction for the second document, the test requirements in the second document are modified, the modification instruction including: a priority setting instruction, a test item update instruction, and an association modification instruction.

5. The method according to claim 2, characterized in that: The modifying of the third document comprises: If the third document does not meet the software specification requirements of the set field, modify the document style of the third document; When the logical relationship of the third document is incorrect, the logical relationship of the third document is corrected.

6. The method according to claim 1, characterized in that The optimization process of the test requirement generation model includes: Get the input document; Inputting the input document into a test requirement generation model to obtain an initial document; Acquire annotation information of the initial document, wherein the annotation information includes error information and correction suggestions in the initial document; The model parameters of the test requirement generation model are adjusted using the initial document and the annotation information.

7. The method according to claim 1, characterized in that The method further comprises: Monitoring the change information of the software in real time, wherein the change information includes at least one of the following: update log, code submission, and defect report; The test content related to the change information in the second document is modified in real time based on the change information.

8. A device for generating software test requirements, characterized in that: The device comprises: A first content acquisition module, used to acquire first content input by a user, wherein the first content is a general description of the test requirements of software in a set field; A second document determination module is used to analyze the first content using a pre-trained test requirement generation model to obtain a second document, where the second document is a complete test requirement document that meets the requirements of the set domain software specification; the test requirement generation model is constructed based on the set domain basic data, the set domain standard knowledge graph, and the set domain software specification requirements; The first content is analyzed using a pre-trained test requirement generation model to obtain a second document, including: analyzing the first content using a pre-trained test requirement generation model to obtain documents of test requirements of each dimension; for dimensions where test requirements are missing, obtaining a general description of the test requirements of the missing dimensions; analyzing the general description of the test requirements of the missing dimensions using a pre-trained test requirement generation model to obtain the test requirements of the missing dimensions; and updating the documents of the test requirements of each dimension using the test requirements of the missing dimensions to obtain a second document.

9. A device for generating software test requirements, characterized in that: The device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating software test requirements as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for generating software test requirements as described in any one of claims 1 to 7 is implemented.