AiPromptss
Back to browse

Automatically generate test case prompts

Given a requirement, Automatically generate test cases in the following format, for example: [+0.01s] Clmmg_VehSt=2;//VA, "Condition x" and "Meaning" need to b…

Added May 19, 20260 views0 copies
Prompt
Given a requirement,
                    Automatically generate test cases in the following format, for example:
                    [+0.01s]
                    Clmmg_VehSt=2;//VA, "Condition x" and "Meaning" need to be annotated after each signal name, for example: Condition a: Vehicle status VA
                    SwtCtl_BackligAutoModReq =1;
                    Aps_LiSwtRsnReq =1;

                    SwtCtl_BackLigIllmnSts = 1;//Output, "Output" needs to be added for output signals and annotated with meaning
                    [+0.01s]
                    Clmmg_VehSt=3;//VE
                    SwtCtl_BackligAutoModReq =1;
                    Aps_LiSwtRsnReq =1;

                    SwtCtl_BackLigIllmnSts = 1;//Output
                    [+0.01s]
                    -----------------------------------------------------------
                    The following requirements need to be strictly followed:
                    1. Add a test case description before each test case, replace "#" with "//" for explanatory text, for example, replace "### Test Case 1: Description" with "// Test Case 1: Description";
                        Also add test case design method, for example "Test Case Design Method: Requirement Analysis / Boundary Value / Equivalence Class, etc.", where requirement analysis means meeting the positive conditions of the requirement, and equivalence class means not meeting a certain condition.
                    2. Do not use "```" and "plaintext" labels, use the example format but do not output the example content, the example above is just for reference, this round should return empty, directly generate test cases.
                    3. Note that a test case can contain multiple steps, and there is continuity between the steps of a test case. If the current step of a test case does not use signals from the previous step, set the signals from the previous step that are not needed in the current step to their initial values.
                    For example:
                    [+0.01s]
                    a=1;

                    c=1;//Output
                    [+0.01s]//+0.01s represents the next step after 0.01 seconds, if the requirement mentions checking the result after a certain number of seconds, this value needs to be modified.
                    a=0;//This step does not need this variable, set it to the default value
                    b=2;

                    c=1;//Output
                    [+0.01s]
                    4. The variables from the previous test case need to be reflected in the next test case, if not used, set them to default values.
                    5. Add a line "[+0.01s]" at the end of each individual test case.
                    6. Pay attention to comprehensive test case design, including equivalence class, boundary value, and other test types. Equivalence class represents three cases where each condition in a combination condition is not met.
                        For example, conditions a&b&c, equivalence class needs to design three cases where a, b, c are not met respectively:
                        (1) a is met, b, c are not met
                        (2) b is met, a, c are not met
                        (3) c is met, a, b are not met.
                    7. Boundary values must consider the inside boundary, on the boundary, and outside the boundary.
                        For example, a<=10, design three cases a=9, a=10, a=11.
                    8. Do not perform multiple condition combination tests.
                    9. Signal values should be in decimal form, do not use hexadecimal format.
                    10. The first test case needs to initialize all signal values mentioned in the requirement, and the first test case does not need to include a design method,
                        Only the initialization case does not need a time step marker, for example, "[+0.01s]".
                    11. If the requirement contains true, replace it with 1, if it contains false, replace it with 0.

Replace text in [BRACKETS] with your own values before pasting.