Test outline generation method and platform based on AI big model

Through the test outline generation method based on AI large models, high-quality test outlines are automatically generated, which solves the problems of high manual writing costs and coverage limitations, and achieves fast and efficient test outline generation, which is suitable for a variety of software testing scenarios.

CN118331889BActive Publication Date: 2024-10-08AEROSPACE SOFTWARE TECH (BEIJING) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410764960.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-08
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

The writing of existing software test outlines requires manual participation, which is limited by the knowledge level of the writers, resulting in high cost and slow speed. Moreover, historical test outlines cannot fully cover the software field and business logic, and the application scenarios are limited.

Method used

The test outline generation method based on the AI ​​large model is adopted. By inputting the requirement information and code generation instructions of the software under test into the generative large language model, the target code branch and test outline are automatically generated, and the pre-learned knowledge is used to improve the flexibility of the code branch. Stickiness and quality of the test syllabus.

Benefits of technology

It realizes the automatic generation of high-quality test outlines, improves the generation speed and quality, strengthens the model generation thinking chain, automatically generates test outlines based on demand information, and is suitable for a variety of software testing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331889B_ABST
    Figure CN118331889B_ABST
Patent Text Reader

Abstract

The disclosed embodiment relates to a test outline generation method and platform based on an AI big model, and relates to the field of software testing technology based on artificial intelligence. The method includes: inputting the requirement information and code generation instructions of the tested software into the trained outline generation model to obtain the target code branch of the tested software; wherein the outline generation model is a generative big language model; inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the tested software. The disclosed embodiment uses the generation of code branches as an intermediate process, enhances the thinking chain of the model to generate the test outline, realizes the automatic generation of the test outline according to the requirement information, improves the generation quality of the test outline, and improves the generation speed of the test outline.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of software testing technology based on artificial intelligence, and in particular to a test outline generation method and platform based on an AI big model. Background Art

[0002] With the development of software technology, software testing is becoming more and more common. Software testing can be used to determine whether the software meets user needs. Software testing is conducted based on the software testing outline.

[0003] In the related art, it is necessary to manually write the software test outline. During the writing process, the writer needs to communicate with the R&D personnel about the requirements. The quality of the software test outline is limited by the writer's knowledge level, and the labor cost is high and the writing speed is slow. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a test outline generation method and platform based on an AI big model.

[0005] The present disclosure provides a method for generating a test outline based on an AI big model, including:

[0006] Input the requirement information and code generation instructions of the software under test into the trained outline generation model to obtain the target code branch of the software under test; wherein the outline generation model is a generative large language model;

[0007] The target code branch and outline generation instruction are input into the outline generation model to obtain the target test outline of the software under test.

[0008] Optionally, the code generation indication characterizes that the statement type of the target code branch includes one or more of a conditional statement, a selection statement, a loop statement, an input exception handling statement, and a hardware fault handling statement.

[0009] Optionally, the outline generation indication indicates that the code coverage type implemented by the test point description information in the target test outline includes one or more of statement coverage, decision coverage, and condition coverage;

[0010] The step of inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test comprises:

[0011] Inputting the target code branch and the outline generation instruction into the outline generation model to obtain the test point description information;

[0012] Obtaining the judgment criterion information corresponding to the test point description information through the outline generation model;

[0013] The target test outline is generated according to the test point description information and the judgment criterion information.

[0014] Optionally, the outline generation model is an initial model before training is completed, and the training process of the outline generation model includes:

[0015] Acquire software corpus, construct terminology filling-in sample pairs according to the software corpus; wherein the terminology filling-in sample pairs include terminology gap sentences and filling-in terms corresponding to the terminology gap sentences; train the initial model according to the terminology filling-in sample pairs; and / or,

[0016] Acquire the sample code under test, the coverage type, and the sample test points; train the initial model according to the sample code under test, the coverage type, and the sample test points; wherein the coverage type includes at least one of statement coverage, decision coverage, and condition coverage; and / or,

[0017] Obtain sample demand information and demand sample code, and train the initial model according to the sample demand information and the demand sample code.

[0018] Optionally, before inputting the requirement information and code generation instructions of the software under test into the trained outline generation model to obtain the target code branch of the software under test, the method further includes:

[0019] Obtain the requirement text, and extract the requirement information in the requirement text according to the preset chapter information relationship; wherein the requirement information includes: preconditions, functional processes, extended processes, postconditions, and rule constraints.

[0020] Optionally, after inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the method further includes:

[0021] Delete the summary statement in the target test outline;

[0022] Determine the test point sequence number in the target test outline;

[0023] If there are multiple serial number patterns of the test point serial numbers, the serial number pattern with the largest number among the serial number patterns is determined as the target serial number pattern, and the test point serial numbers are unified into the target serial number pattern;

[0024] Extract the serial number hierarchy of the target test outline. If there is a serial number discontinuity in the test point serial numbers in the serial number hierarchy, determine the first discontinuity serial number in the serial number hierarchy, the previous serial number of the first discontinuity serial number, and the subsequent serial number of the first discontinuity serial number, determine the incremental serial number generated by incrementing the previous serial number, update the first discontinuity serial number to the incremental serial number, and incrementally update the subsequent serial numbers based on the incremental serial number.

[0025] Optionally, after inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the method further includes at least one of the following:

[0026] Determine the number of test items of the target test outline, and if the number of test items is less than a first quantity threshold, generate outline prompt information of the target test outline;

[0027] Determine the number of test points of each of the test items in the target test outline, and if the number of test points is less than a second number threshold, generate test item prompt information of the test item corresponding to the number of test points;

[0028] Determine the type proportion of each test type in the target test outline, and if the type proportion is less than a preset proportion threshold, generate type prompt information of the test type; wherein the test type is the type of the test item.

[0029] The present disclosure also provides a test outline generation platform based on an AI big model, including:

[0030] A code branch generation module, used to input the requirement information and code generation instructions of the tested software into the trained outline generation model to obtain the target code branch of the tested software; wherein the outline generation model is a generative large language model;

[0031] A test outline generation module is used to input the target code branch and outline generation instruction into the outline generation model to obtain the target test outline of the software under test.

[0032] An embodiment of the present disclosure also provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement a test outline generation method based on an AI big model as provided in an embodiment of the present disclosure.

[0033] An embodiment of the present disclosure also provides a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the test outline generation method based on the AI ​​big model as provided in the embodiment of the present disclosure.

[0034] The technical solution provided by the embodiment of the present disclosure has the following advantages over the prior art: the test outline generation solution provided in the embodiment of the present disclosure, the method includes: inputting the requirement information and code generation instructions of the tested software into the outline generation model that has completed the training, and obtaining the target code branch of the tested software; wherein the outline generation model is a generative large language model; inputting the target code branch and the outline generation instruction into the outline generation model, and obtaining the target test outline of the tested software. With the above technical solution, the outline generation model has learned a lot of knowledge in advance, and the outline generation model automatically generates code branches that meet the requirement information and code generation instructions, and the code branches have good robustness, and the outline generation model automatically generates a test outline for the code branch and meets the outline generation instruction, and the test outline generated based on the code branch with good robustness has good quality. Through the above two steps, the generation of code branches is used as an intermediate process, which enhances the thinking chain of the model to generate the test outline, realizes the automatic generation of the test outline according to the requirement information, improves the generation quality of the test outline, and improves the generation speed of the test outline. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0036] In order to more clearly illustrate the embodiments of the present invention 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.

[0037] Figure 1 A flowchart of a test outline generation method based on an AI big model provided in an embodiment of the present disclosure;

[0038] Figure 2 A flowchart of another test outline generation method based on an AI big model provided in an embodiment of the present disclosure;

[0039] Figure 3 A schematic diagram of a test outline generation system provided by an embodiment of the present disclosure;

[0040] Figure 4 A schematic diagram of the structure of a test outline generation platform based on an AI big model provided in an embodiment of the present disclosure;

[0041] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

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

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

[0044] With the development of software technology, software testing is becoming more and more common. Software testing can be used to determine whether the software meets user needs. Software testing is conducted based on the software testing outline.

[0045] In the related art, it is necessary to manually write the software test outline. During the writing process, the writer needs to communicate with the R&D personnel about the requirements. The quality of the software test outline is limited by the writer's knowledge level, and the labor cost is high and the writing speed is slow.

[0046] In related technologies, current demand information and historical demand information can also be matched, and the current test outline can be generated based on the historical test outline corresponding to the successfully matched historical demand information. However, due to the differences in software domains and business logic, it is difficult for the historical test outline to achieve comprehensive coverage of the software domain and business logic, and the application scenarios of this method are relatively limited.

[0047] In the related art, key field information and key data information can also be extracted from the standardized requirement document of the interface test to generate a test outline for the interface test. However, this method is only applicable to the fixed test type of interface test, and the application scenario is also relatively limited.

[0048] In order to solve the above problems, the embodiments of the present disclosure provide a method for generating a test outline based on an AI big model, which will be introduced below in conjunction with specific embodiments.

[0049] Figure 1 A flowchart of a test outline generation method based on an AI big model provided in an embodiment of the present disclosure is provided. The test outline generation method based on an AI big model can be applied to a test outline generation platform based on an AI big model. The test outline generation platform based on an AI big model can be implemented using software and / or hardware. The test outline generation platform based on an AI big model can generally be integrated in an electronic device. Figure 1 As shown, the test outline generation method based on the AI ​​big model includes:

[0050] Step 101, input the requirement information and code generation instructions of the software under test into the trained outline generation model to obtain the target code branch of the software under test; wherein the outline generation model is a generative large language model.

[0051] The software under test may be software written in the test outline. This embodiment does not limit the type of the software under test. For example, the software under test may be flight control software for a drone. The requirement information may be information recording the requirements that the software under test needs to meet. The requirement information may include one or more of the functions, performance, constraints, user expectations of the software under test, and market expectations of the software under test.

[0052] The code generation indication may be an indication (prompt) representing the conditions satisfied by the target branch code, and the indication may be understood as a prompt word for inputting a generative large language model. The code generation indication may be set according to user requirements, etc., and this embodiment is not limited. In some embodiments of the present disclosure, the statement type representing the target code branch in the code generation indication includes one or more of a conditional (if) statement, a switch statement, a loop statement, an input exception handling statement, and a hardware fault handling statement. Among them, the conditional statement may be a statement for determining whether a given condition is satisfied and determining a corresponding operation according to the determination result. The selection statement may be a statement for making a selection. The loop statement may be a statement for repeatedly executing a specific code. The input exception handling statement may be a statement for handling input exceptions, and robustness enhancement may be achieved based on the input exception handling statement. The hardware fault handling statement may be a statement for handling hardware failures, and robustness enhancement may be achieved based on the hardware fault handling statement. The target code branch may be a code branch that meets the requirement information and code generation indication generated by the outline generation model.

[0053] The outline generation model may be a generative large language model (LLM) with code branch generation function and test outline generation function. The outline generation model may be a machine learning model obtained by fine-tuning the existing generative large language model for code branch generation function and test outline generation function. For example, the outline generation model may be a model obtained by fine-tuning the Transformer-based generative pre-trained model (GPT). The large language model may be a language model with large-scale parameters and powerful computing resources.

[0054] In the embodiments of the present disclosure, the test outline generation platform based on the AI ​​big model can pre-input the requirement information and code generation instructions into the outline generation model through interface calls and the like, and input the code branch acquisition statement into the outline generation model, so that the outline generation model simulates the role of a software engineer, designs the code branch according to the requirement information and code generation instructions, and obtains the target code branch returned by the outline generation model.

[0055] In some embodiments of the present disclosure, before inputting the requirement information and code generation instructions of the tested software into the trained outline generation model to obtain the target code branch of the tested software, the test outline generation method based on the AI ​​big model further includes:

[0056] Obtain the requirement text, and extract the requirement information in the requirement text according to the preset chapter information relationship; wherein the requirement information includes: preconditions, functional processes, extended processes, postconditions, and rule constraints.

[0057] The requirement document may be a document recording the requirements met by the software under test. The requirement document may include multiple document sections. It is understandable that one or more sections in the requirement document may record requirement information. The section information relationship may be a corresponding relationship between the document sections and the document information.

[0058] The precondition may be a condition that needs to be satisfied before the software under test executes the functional flow. Based on the precondition, the failure of the functional flow execution due to external factors can be avoided. This embodiment does not limit the precondition. For example, the precondition may be that the flight control software detects that the drone is on the ground. The functional flow is also called the main functional flow. The functional flow may be the main flow that describes the software under test executing its tested function. The extended flow may be a flow for handling abnormal situations during the process of the software under test executing the functional flow. The postcondition may be a condition that is satisfied after the software under test executes the tested function. Based on the postcondition, it can be verified whether the test is successful or achieves the expected effect. This embodiment does not limit the postcondition. For example, the postcondition may be that the flight control software is in a flying state after the drone takes off. The rule constraint may be a condition rule constraint that needs to be satisfied during the process of the software under test executing the tested function. The rule constraint may include a data range constraint. For example, the rule constraint may include a wind speed range constraint and a wind direction angle range constraint when the drone takes off.

[0059] Optionally, the requirement information may be simplified according to the actual needs of the user, for example, it may be simplified into a function name and a function description, wherein the function name may be the name of the function to be tested, and the function description may be a brief description of the function to be tested.

[0060] In this embodiment, the requirement document may be a document written in accordance with a preset document writing standard, which specifies the chapter information relationship. The test outline generation platform based on the AI ​​big model can parse each chapter of the requirement document to determine whether the requirement document satisfies the chapter information relationship. If so, the document information corresponding to the target chapter preset in the requirement text is extracted to obtain the target information, and the requirement information is composed based on the target information.

[0061] In the above scheme, the extraction of requirement information in the requirement text is realized, the redundant information in the requirement text that has a weak relationship with the software function is eliminated, and the quality of the target test outline generated subsequently is improved.

[0062] Step 102, input the target code branch and outline generation instruction into the outline generation model to obtain the target test outline of the software under test.

[0063] Among them, the outline generation indication may be an indication of the conditions satisfied by the target test outline. The outline generation indication may be understood as the conditions based on which the target test outline design is based. The outline generation indication may be set according to user needs, etc., and this embodiment is not limited. In some embodiments of the present disclosure, the outline generation indication represents that the code coverage type implemented by the test point description information in the target test outline includes one or more of statement coverage, decision coverage, and condition coverage. Among them, the test point description information may be information describing the test point. The test point may be a subdivided test item in the test item, and the test point may be a test item under the test item. A test item may correspond to a function in the software under test. For example, the test item may correspond to the takeoff of a drone, and the test point under the test item may correspond to the wind speed at takeoff, the wind direction at takeoff, the engine speed at takeoff, the altitude at takeoff, etc. There are many specific granularities of the test item and the test point, which are not limited in this embodiment.

[0064] Statement coverage is also called line coverage. Statement coverage can be coverage of the executed statements in the target code branch. Decision coverage is also called branch coverage. Decision coverage can be coverage of the true value branch and false value branch of each decision in the target code branch. Condition coverage can be coverage of the value of each condition of each decision in the target code branch. Coverage can be understood as the description information of the test point.

[0065] The target test outline may be an outline for performing software testing on the software under test. This embodiment does not limit the information included in the target test outline. For example, the target test outline may include test point description information and judgment criterion information, or the target test outline may include a brief requirement description, test point description information, judgment criterion information, and a test method.

[0066] Among them, the brief requirement description can be a summary description of the requirement information. The test point description information can be information describing the test point, and the test point description information can be a description of one or more aspects of the test content. Judgment criterion information is also called test pass criteria. The judgment criterion information can be used to determine whether the test result is passed. The judgment criterion information may include the conditions met when the test result is passed, and the conditions met when the test result is not passed. Taking the flight control software of a drone as an example, the test points may include normal engine speed control and engine failure at takeoff. The judgment criterion information may include that the test result fails if the engine reaches a preset speed, and the test result fails if the engine does not reach the preset speed. The test method may include a test tool and a way to obtain the test result. For example, the test method may include obtaining the actual speed reported by the engine through a serial port assistant tool.

[0067] In the disclosed embodiment, the test outline generation platform based on the AI ​​big model can input the outline generation instruction into the outline generation model in advance through methods such as interface calls, and input the acquisition statement of the test outline into the outline generation model, so that the outline generation model simulates the role of a test engineer, and designs the test outline according to the outline generation instruction and the target code branch that has been generated. Obtain the target test outline returned by the outline generation model. It should be noted that the target code branch can be the code branch generated by the outline generation model itself in the previous rounds of dialogue. On the basis that the outline generation model has the ability of multiple rounds of dialogue, the input of the target code branch to the outline generation model can be achieved by requiring the outline generation model to continue to complete the question and answer based on the target code branch that has been generated. The input of other data of the outline generation model can also be achieved in this way.

[0068] Figure 2 A flowchart of another test outline generation method based on an AI big model provided in an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the target code branch and outline generation instructions are input into the outline generation model to obtain the target test outline of the software under test, including:

[0069] Step 201, input the target code branch and outline generation instruction into the outline generation model to obtain the test point description information.

[0070] In the disclosed embodiment, the test outline generation platform based on the AI ​​big model can input the outline generation instruction into the outline generation model in advance through methods such as interface call, and ask questions to the outline generation model, so that the outline generation model simulates the role of a test engineer, and designs the test point description according to the generated target code branch and the outline generation instruction. The test point description information returned by the outline generation model is obtained.

[0071] Step 202: Obtain judgment criterion information corresponding to the test point description information through the outline generation model.

[0072] In an embodiment of the present disclosure, a test outline generation platform based on an AI big model can input a statement for obtaining judgment criterion information into the outline generation model, so that the outline generation model generates judgment criterion information that corresponds one-to-one to the test point description information based on the test point description information output by itself.

[0073] Step 203: Generate a target test outline according to the test point description information and the judgment criterion information.

[0074] In this embodiment, the test outline generation platform based on the AI ​​big model can perform text summarization processing on the requirement information to obtain a brief requirement description. And determine the tested data involved in the test point description information, and determine the test method corresponding to the tested data based on the relationship between the preset data type and the test method. Furthermore, the test outline generation platform based on the AI ​​big model can comprehensively summarize the brief requirement description, test point description information, judgment criteria information, and test method to obtain the target test outline.

[0075] In the above scheme, the test outline generation process is further refined into the test point description information generation process and the judgment criterion information generation process, which further enhances the thinking chain of generating the test outline through the model and improves the quality of the final generated test outline.

[0076] The test outline generation method based on the AI ​​big model provided by the embodiment of the present disclosure includes: inputting the requirement information and code generation instructions of the tested software into the outline generation model that has completed the training, and obtaining the target code branch of the tested software; wherein the outline generation model is a generative big language model; inputting the target code branch and the outline generation instruction into the outline generation model, and obtaining the target test outline of the tested software. With the above technical solution, the outline generation model has learned a lot of knowledge in advance, and the outline generation model automatically generates code branches that meet the requirement information and code generation instructions. The code branches have good robustness, and the outline generation model automatically generates a test outline for the code branch and meets the outline generation instructions. The test outline generated based on the code branch with good robustness has good quality. Through the above two steps, the generation of code branches is used as an intermediate process, which enhances the thinking chain of the model to generate the test outline, realizes the automatic generation of the test outline according to the requirement information, improves the generation quality of the test outline, and improves the generation speed of the test outline.

[0077] In some embodiments of the present disclosure, the outline generation model is an initial model before completing training, and the training process of the outline generation model includes at least one of the following:

[0078] Optionally, the training process of the outline generation model includes: obtaining software corpus, constructing term filling sample pairs based on the software corpus; wherein the term filling sample pairs include term gap sentences and filling terms corresponding to the term gap sentences; and training the initial model based on the term filling sample pairs.

[0079] The initial model may be a pre-trained generative large language model. The software corpus may be a corpus material in the software field. The source of the software corpus may include one or more of software development books, software development standards, software testing books, and software testing standards. The term-gap sentence may be a sentence obtained by hollowing out the software terms in the sentence containing the software terms. The fill-in-the-blank term may be the software term used to fill in the blank sentence.

[0080] In this embodiment, the test outline generation platform based on the AI ​​big model can process the above software corpus into sentences to obtain multiple basic sentences. Identify the software terms in the basic sentences, hollow out the software terms in the basic sentences, obtain terminology-deficient sentences, and use the software terms as the fill-in-the-blank terms corresponding to the blank sentences. Use the terminology-deficient sentences as the input of the initial model, use the fill-in-the-blank terms as the standard output of the initial model, and train the initial model. Obtain an initial model that completes the software terminology comprehension training.

[0081] In the above scheme, the initial model is trained through terminology-gap sentences and fill-in-the-blank terms, which improves the software terminology comprehension ability of the subsequently determined outline generation model, improves the ability of the outline generation model to understand requirement information, and improves the professionalism of the terminology used in the target test outline generated by the outline generation model.

[0082] Optionally, the training process of the outline generation model includes: obtaining the sample code under test, coverage type and sample test points; training the initial model according to the sample code under test, coverage type and sample test points; wherein the coverage type includes: at least one of statement coverage, decision coverage and condition coverage.

[0083] The sample code under test may be a sample code to be tested on the software, and the coverage type may be a coverage type that a preset sample test point needs to satisfy. The test sample code and coverage type may be used as a software test question. The sample test point may be used as the answer to the software test question. The sample test point is a test point that implements test coverage of the corresponding coverage type for the sample code under test. The sample test point may be understood as the answer to the software test question. The coverage type may include one or more of statement coverage, decision coverage, condition coverage, condition decision coverage, combination coverage, and path coverage.

[0084] In this embodiment, the test outline generation platform based on the AI ​​big model can take the sample code and coverage type under test as the input of the initial model, take the sample test point as the standard output of the initial model, and train the initial model to obtain the initial model that completes the test point generation training.

[0085] In the above scheme, the ability of the subsequently determined outline generation model to generate test points according to the code is improved, and the correctness of the generated test points is improved.

[0086] Optionally, the training process of the outline generation model includes: obtaining sample requirement information and requirement sample code, and training the initial model according to the sample requirement information and requirement sample code.

[0087] The sample requirement information may be requirement information for training samples, and the sample requirement information may include selection branches, robust branch design, etc. The requirement sample code may be pseudo code that satisfies the sample requirement information.

[0088] In this embodiment, the test outline generation platform based on the AI ​​big model can use the sample requirement information as the input of the initial model, use the requirement sample code as the standard output of the initial model, and train the initial model to obtain the initial model that completes the code generation training.

[0089] In the above scheme, the quality of code branches generated by the subsequent outline generation model is improved.

[0090] In the test outline generation method based on the AI ​​big model provided by the embodiment of the present disclosure, the step of outputting data of each outline generation model is trainable, so special training can be performed for the steps in the logical chain of the outline generation model. In addition, code capability and code coverage are common knowledge of the initial model, and training data for code capability and code coverage is relatively easy to obtain.

[0091] In some embodiments of the present disclosure, after inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the method further includes: deleting the summary statement in the target test outline. The summary statement may be a summary statement.

[0092] In this embodiment, the test outline generation platform based on the AI ​​big model can capture summary keywords from the sentences in the target test outline, obtain summary sentences including summary keywords, and delete the summary sentences. Thus, the target test outline after deleting the summary sentences is more in line with the specification.

[0093] In some embodiments of the present disclosure, it is necessary to adjust the sequence number in the target test outline. Specifically, after the target code branch and the outline generation instruction are input into the outline generation model to obtain the target test outline of the software under test, the test outline generation method based on the AI ​​big model further includes at least one of the following:

[0094] Optionally, after inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the test outline generation method based on the AI ​​big model further includes:

[0095] Determine the test point serial numbers in the target test outline; if there are multiple serial number styles for the test point serial numbers, determine the serial number style with the largest number among the serial number styles as the target serial number style, and unify the test point serial numbers into the target serial number style.

[0096] The test point serial number may be a number before each test point description information in the target test outline. The serial number style may be a text style of the test point serial number, and the text style includes one or more of a font and a font size.

[0097] In this embodiment, the test outline generation platform based on the AI ​​big model can extract the test point serial numbers in the target test outline, determine the serial number style of each test point serial number, count the serial number style, and determine the serial number style with the largest number as the target serial number style. After determining the target serial number style, determine the serial number of the test point to be processed whose serial number style is not the target serial number style, and adjust the style of the test point serial number to be processed to the target serial number style.

[0098] In the above scheme, by adjusting the serial number styles of a relatively small number of test point serial numbers, fast and efficient unification of the test point serial number styles is achieved.

[0099] Optionally, after inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the test outline generation method based on the AI ​​big model further includes:

[0100] Determine the test point serial number in the target test outline; extract the serial number hierarchy of the target test outline, if there is a serial number gap in the test point serial number in the serial number hierarchy, determine the first interrupted serial number in the serial number hierarchy, the previous serial number of the first interrupted serial number, the subsequent serial number of the first interrupted serial number, determine the increasing serial number generated by increasing the previous serial number, update the first interrupted serial number to the increasing serial number, and update the subsequent serial numbers incrementally based on the increasing serial number.

[0101] Among them, the serial number level can be a level divided according to the structure of the test point serial number in the test point serial number. It can be understood that the test point serial numbers of the same serial number level correspond to the same upper level, which can be a test item serial number or a test point serial number, and the test point serial numbers of the same serial number level can correspond to test points of the same granularity. The first discontinuity serial number can be the serial number in the serial number level where the first numerical discontinuity appears in the text order. The previous serial number can be the previous serial number of the discontinuity serial number. The subsequent serial number can be one or more test point serial numbers after the discontinuity serial number. The increment signal can be a serial number that increments a basic numerical value based on the previous serial number. The basic numerical value can be a numerical value corresponding to the serial number level.

[0102] In this embodiment, the test outline generation platform based on the AI ​​big model can extract the test point sequence number in the target test outline, determine the sequence number structure of the test point sequence number, and determine the test point sequence numbers at the same level and with the same superior in the sequence number structure as the same sequence number level. A judgment is made for each sequence number level. If there are discontinuous test point sequence numbers in the sequence number level, it is determined that there is a discontinuity in the test point sequence number. According to the text order, the first discontinuous test point sequence number is determined as the first discontinuous sequence number. And the previous test point sequence number of the discontinuity signal in the sequence number level is determined as the previous sequence number, and one or more test point sequence numbers after the discontinuity signal in the sequence number level are determined as subsequent sequence numbers. The previous sequence number and the basic numerical value corresponding to the sequence number level are accumulated to obtain an incremental sequence number. The test outline generation platform based on the AI ​​big model can assign the incremental sequence number to the first discontinuous sequence number, and update the subsequent sequence numbers based on the new discontinuous sequence number.

[0103] In the above scheme, the problem of discontinuous test point numbers in the target test outline is solved, the output format of the test outline is made more neat, and the quality of the target test outline is improved.

[0104] In some embodiments of the present disclosure, after inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the test outline generation method based on the AI ​​big model further includes at least one of the following:

[0105] First, determine the number of test items in the target test outline. If the number of test items is less than a first quantity threshold, generate outline prompt information of the target test outline.

[0106] The number of test items may be the total number of test items in the test outline. The first number threshold may be a preset minimum number of test items. The outline prompt information may be information for prompting that the number of test items in the target test outline is too small.

[0107] In this embodiment, the test outline generation platform based on the AI ​​big model can count the number of test items for the tested software function in the target test outline, and determine whether the number of test items is less than the first number threshold. If so, it means that the number of test items is too small, and then generate outline prompt information for the target test outline. Thus, an automatic prompt for too few test items is achieved.

[0108] Secondly, the number of test points of each test item in the target test outline is determined. If the number of test points is less than a second number threshold, test item prompt information of the test item corresponding to the number of test points is generated.

[0109] The number of test points may be the number of test points under each test item in the test outline. The second number threshold may be a preset minimum value of the number of test points. The test item prompt information may be information for prompting that the number of test points under the test item is too small.

[0110] In this embodiment, the test outline generation platform based on the AI ​​big model can count the number of test points under each test item, obtain the number of test points corresponding to each test item, determine the test item with the number of test points less than the second number threshold as the target test item, and generate test item prompt information for the target test item. Thus, an automatic prompt for too few test points is realized.

[0111] Third, determine the type ratio of each test type in the target test outline. If the type ratio is less than a preset ratio threshold, generate type prompt information of the test type; wherein the test type is the type of the test item.

[0112] Among them, the test type may include at least one of the following: functional test, performance test, interface test, human-computer interaction interface test, data boundary test, capacity test, margin test, security test, etc. Data boundary test can be a test for the boundary data value of the data range. Capacity test can be a test for the test result to reach the maximum data volume. Margin test can be a test of performance redundancy. Type proportion can be the ratio of the number of a test type to the number of test items in the test outline. The preset proportion threshold can be the minimum value of the preset type proportion. Type prompt information can be information used to prompt uneven test types.

[0113] In this embodiment, the test outline generation platform based on the AI ​​big model can determine the test type of each test item, and count the number of each test type, divide the number by the number of test items, and obtain the type ratio corresponding to the test type. If there is at least one type ratio that is less than the preset ratio threshold, it means that the number of test items corresponding to the test type is too small, and the type prompt information of the test type is generated. Thus, an automatic prompt is realized when the test type ratio is too small.

[0114] Next, the test outline generation method based on the AI ​​big model in the embodiment of the present disclosure is further explained through a specific example. Figure 3 Schematic diagram of a test outline generation system provided by an embodiment of the present disclosure. The test outline generation system may be a system for implementing the test outline generation method. Figure 3 As shown, the test outline generation system includes a requirement parsing module, a large model calling module, an outline format adjustment module, and a data statistics module, wherein the requirement parsing module is used to determine whether the requirement document conforms to the chapter information relationship, and if so, extract the requirement information in the requirement document according to the chapter information relationship. The large model calling module is used to call the outline generation model and obtain the output of the outline generation model. The outline format adjustment module is used to adjust the format of the target test outline output by the outline generation model. The data statistics module is used to count various types of data of the target test outline.

[0115] like Figure 3 As shown, first, the requirement parsing module parses the requirement document to determine whether the requirement document meets the chapter information relationship. If so, the requirement information is extracted from the requirement document according to the chapter information relationship. The requirement information includes: test case name, test case description, precondition, test process, extended process, postcondition, and test rules.

[0116] Furthermore, the large model calling module calls the outline generation model to obtain the target test outline.

[0117] Specifically, the large model calling module can require the outline generation model to simulate a software engineer, design key code branches according to the requirement information, and obtain the target code branches output by the outline generation model. The key code branches include but are not limited to conditional statements, selection statements, loop statements, input exception handling statements, and hardware fault handling statements.

[0118] The large model calling module requires the outline generation model to act as a test engineer, determine the test point description information based on the target code branch and perform code coverage on the target code branch. The code coverage includes: statement coverage, decision coverage, and condition coverage. The large model calling module requires the outline generation model to provide the passing criteria corresponding to the above test point description information.

[0119] Furthermore, the outline format adjustment module adjusts the format test point numbers of the target test outline output by the outline generation model, and removes the summary statement in the target test outline.

[0120] Furthermore, the data statistics module performs data statistics, including but not limited to the number of test items, the number of test points, the distribution of test types, etc., and numbers the test items.

[0121] The training process of the outline generation model includes: training the initial model's ability to understand software evaluation terms through books or standards. Building a training set based on software test questions to enhance the initial model's correct understanding of test knowledge. The training set includes questions on various code coverage.

[0122] The test outline generation method based on the AI ​​big model provided in the embodiment of the present disclosure solves the problem of many software fields and wide business logic required for evaluation because the generative big model has a lot of knowledge. And the initial model is fine-tuned, and the generation of the test outline is divided into two steps: designing code branches and generating test point description information. Since the outline generation model has learned a lot of knowledge in advance, the code branch has good robustness. The test outline generated based on the code branch is more likely to guide testers to find software problems, and the quality of the test outline is high. And the output process of the outline generation model for each problem is trainable. Code capability and code coverage belong to the general knowledge of the generative big model, and training data is easy to obtain. In the embodiment of the present disclosure, a thinking chain of the generative big model is constructed to guide the outline generation model to output a test outline that meets the software evaluation standards.

[0123] Figure 4 The present invention provides a schematic diagram of a test outline generation platform based on an AI big model, which can be implemented by software and / or hardware, or integrated in an electronic device. Figure 4 As shown, the platform includes:

[0124] The code branch generation module 401 is used to input the requirement information and code generation instructions of the tested software into the trained outline generation model to obtain the target code branch of the tested software; wherein the outline generation model is a generative large language model;

[0125] The test outline generation module 402 is used to input the target code branch and outline generation instruction into the outline generation model to obtain the target test outline of the software under test.

[0126] Optionally, the test outline generation platform based on the AI ​​big model further includes:

[0127] An information extraction module is used to obtain the requirement text before inputting the requirement information and code generation instructions of the software under test into the trained outline generation model to obtain the target code branch of the software under test, and extract the requirement information in the requirement text according to a preset chapter information relationship; wherein the requirement information includes: preconditions, functional flows, extended flows, postconditions, and rule constraints.

[0128] Optionally, the code generation indication characterizes that the statement type of the target code branch includes one or more of a conditional statement, a selection statement, a loop statement, an input exception handling statement, and a hardware fault handling statement.

[0129] Optionally, the outline generation indication indicates that the code coverage type implemented by the test point description information in the target test outline includes one or more of statement coverage, decision coverage, and condition coverage;

[0130] The test outline generating module 402 is used to:

[0131] Inputting the target code branch and the outline generation instruction into the outline generation model to obtain the test point description information;

[0132] Obtaining the judgment criterion information corresponding to the test point description information through the outline generation model;

[0133] The target test outline is generated according to the test point description information and the judgment criterion information.

[0134] Optionally, the test outline generation platform based on the AI ​​big model further includes:

[0135] A deletion module, configured to delete a summary statement in the target test outline after inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test;

[0136] A sequence number determination module, used to determine the test point sequence number in the target test outline;

[0137] a pattern unification module, configured to, if there are multiple serial number patterns of the test point serial numbers, determine the serial number pattern with the largest number among the serial number patterns as a target serial number pattern, and unify the test point serial numbers into the target serial number pattern;

[0138] The discontinuity processing module is used to extract the serial number hierarchy of the target test outline. If there is a serial number discontinuity in the test point serial numbers in the serial number hierarchy, the first discontinuity serial number, the previous serial number of the first discontinuity serial number, and the subsequent serial number of the first discontinuity serial number in the serial number hierarchy are determined, and the increasing serial number generated by increasing the previous serial number is determined, the first discontinuity serial number is updated to the increasing serial number, and the subsequent serial numbers are incrementally updated in sequence based on the increasing serial number.

[0139] Optionally, the test outline generation platform based on the AI ​​big model further includes:

[0140] An outline prompting module, configured to determine the number of test items in the target test outline after inputting the target code branch and the outline generation indication into the outline generation model to obtain the target test outline of the software under test, and to generate outline prompting information of the target test outline if the number of test items is less than a first quantity threshold;

[0141] A test item prompt module, used to determine the number of test points of each test item in the target test outline, and if the number of test points is less than a second number threshold, generate test item prompt information of the test item corresponding to the number of test points;

[0142] A type prompt module is used to determine the type proportion of each test type in the target test outline, and if the type proportion is less than a preset proportion threshold, generate type prompt information of the test type; wherein the test type is the type of the test item.

[0143] Optionally, the outline generation model is an initial model before completing the training, and the test outline generation platform based on the AI ​​big model further includes:

[0144] The first training module is to obtain software corpus, construct terminology filling-in sample pairs according to the software corpus; wherein the terminology filling-in sample pairs include terminology gap sentences and filling-in terms corresponding to the terminology gap sentences; train the initial model according to the terminology filling-in sample pairs; and / or,

[0145] The second training module is used to obtain the sample code under test, the coverage type, and the sample test point; train the initial model according to the sample code under test, the coverage type, and the sample test point; wherein the coverage type includes at least one of statement coverage, decision coverage, and condition coverage; and / or,

[0146] The third training module is used to obtain sample demand information and demand sample code, and train the initial model according to the sample demand information and the demand sample code.

[0147] The test outline generation platform based on the AI ​​big model provided in the embodiments of the present disclosure can execute the test outline generation method based on the AI ​​big model provided in any embodiment of the present disclosure, and has the functional modules and beneficial effects corresponding to the execution method.

[0148] Figure 5 The structure diagram of an electronic device provided by the embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the electronic device 500 includes one or more processors 501 and a memory 502 .

[0149] The processor 501 may be a central processing unit (CPU) or other forms of processing units having a test outline generation capability and / or an instruction execution capability, and may control other components in the electronic device 500 to perform desired functions.

[0150] The memory 502 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 501 may run the program instructions to implement the test outline generation method based on the AI ​​large model of the embodiment of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0151] In one example, the electronic device 500 may further include: an input device 503 and an output device 504 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0152] In addition, the input device 503 may also include, for example, a keyboard, a mouse, and the like.

[0153] The output device 504 can output various information to the outside, including the determined distance information, direction information, etc. The output device 504 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0154] Of course, to simplify, Figure 5 Only some of the components related to the present disclosure in the electronic device 500 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 500 may also include any other appropriate components.

[0155] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the test outline generation method based on the AI ​​big model provided by the embodiment of the present disclosure.

[0156] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Python, Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0157] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the test outline generation method based on the AI ​​big model provided by the embodiment of the present disclosure.

[0158] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0159] 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.

[0160] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure 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 test outline generation method based on AI big model, characterized in that: include: Obtaining a requirement text, and extracting requirement information in the requirement text according to a preset chapter information relationship; wherein the requirement information includes: preconditions, functional processes, extended processes, postconditions, and rule constraints; Input the requirement information and code generation instructions of the software under test into the trained outline generation model to obtain the target code branch of the software under test; wherein the outline generation model is a generative large language model, and the statement type of the target code branch represented by the code generation instruction includes one or more of a conditional statement, a selection statement, a loop statement, an input exception handling statement, and a hardware fault handling statement; Inputting the target code branch and the outline generation indication into the outline generation model to obtain the target test outline of the software under test; wherein the outline generation indication represents the code coverage type implemented by the test point description information in the target test outline, including one or more of statement coverage, decision coverage, and condition coverage, and the outline generation model is an initial model before completing the training; the inputting the target code branch and the outline generation indication into the outline generation model to obtain the target test outline of the software under test comprises: inputting the target code branch and the outline generation indication into the outline generation model to obtain the test point description information; obtaining the judgment criterion information corresponding to the test point description information through the outline generation model; generating the target test outline according to the test point description information and the judgment criterion information; The training process of the outline generation model includes: Acquire software corpus, construct terminology filling-in sample pairs according to the software corpus; wherein the terminology filling-in sample pairs include terminology gap sentences and filling-in terms corresponding to the terminology gap sentences; train the initial model according to the terminology filling-in sample pairs; and / or, Acquire the sample code under test, the coverage type, and the sample test points; train the initial model according to the sample code under test, the coverage type, and the sample test points; wherein the coverage type includes at least one of statement coverage, decision coverage, and condition coverage; and / or, Obtain sample demand information and demand sample code, and train the initial model according to the sample demand information and the demand sample code.

2. The method according to claim 1, characterized in that After inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the method further includes: Delete the summary statement in the target test outline; Determine the test point sequence number in the target test outline; If there are multiple serial number patterns of the test point serial numbers, the serial number pattern with the largest number among the serial number patterns is determined as the target serial number pattern, and the test point serial numbers are unified into the target serial number pattern; Extract the serial number hierarchy of the target test outline. If there is a serial number discontinuity in the test point serial numbers in the serial number hierarchy, determine the first discontinuity serial number in the serial number hierarchy, the previous serial number of the first discontinuity serial number, and the subsequent serial number of the first discontinuity serial number, determine the incremental serial number generated by incrementing the previous serial number, update the first discontinuity serial number to the incremental serial number, and incrementally update the subsequent serial numbers based on the incremental serial number.

3. The method according to claim 1, characterized in that After inputting the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test, the method further includes at least one of the following: Determine the number of test items in the target test outline, and if the number of test items is less than a first number threshold, generate outline prompt information of the target test outline; Determine the number of test points of each of the test items in the target test outline, and if the number of test points is less than a second number threshold, generate test item prompt information of the test item corresponding to the number of test points; Determine the type proportion of each test type in the target test outline, and if the type proportion is less than a preset proportion threshold, generate type prompt information of the test type; wherein the test type is the type of the test item.

4. A test outline generation platform, characterized in that: include: An information extraction module is used to obtain a requirement text and extract requirement information in the requirement text according to a preset chapter information relationship; wherein the requirement information includes: preconditions, functional processes, extended processes, postconditions, and rule constraints; A code branch generation module is used to input the requirement information and code generation instructions of the tested software into the trained outline generation model to obtain the target code branch of the tested software; wherein the outline generation model is a generative large language model, and the statement type of the target code branch represented by the code generation instruction includes one or more of a conditional statement, a selection statement, a loop statement, an input exception handling statement, and a hardware fault handling statement; A test outline generation module is used to input the target code branch and the outline generation instruction into the outline generation model to obtain the target test outline of the software under test; wherein the outline generation instruction represents the code coverage type implemented by the test point description information in the target test outline, including one or more of statement coverage, decision coverage, and condition coverage, and the outline generation model is an initial model before completing the training; the test outline generation module is used to: input the target code branch and the outline generation instruction into the outline generation model to obtain the test point description information; obtain the judgment criterion information corresponding to the test point description information through the outline generation model; generate the target test outline according to the test point description information and the judgment criterion information; The test outline generation platform also includes: A first training module is used to obtain software corpus, construct terminology filling-in sample pairs according to the software corpus; wherein the terminology filling-in sample pairs include terminology gap sentences and filling-in terms corresponding to the terminology gap sentences; train the initial model according to the terminology filling-in sample pairs; and / or, The second training module is used to obtain the sample code under test, the coverage type, and the sample test point; train the initial model according to the sample code under test, the coverage type, and the sample test point; wherein the coverage type includes at least one of statement coverage, decision coverage, and condition coverage; and / or, The third training module is used to obtain sample demand information and demand sample code, and train the initial model according to the sample demand information and the demand sample code.

5. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the test outline generation method described in any one of claims 1-3 above.

6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the test outline generation method described in any one of claims 1-3 above.

Citation Information

Patent Citations

  • Engineering file generation method and system based on large language model

    CN116402024A

  • Control method and device for intelligent education flexible electronic paper display screen based on chatGPT

    CN117557423A

  • Course-related test question generation method and device, equipment, medium and product

    CN117874171A

  • Test case generation method and device, electronic equipment and storage medium

    CN117971698A

  • System that conducts dialogs using artificial intelligence

    US11990139B1