You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: unit_tests/prompts.py
+16-5Lines changed: 16 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
PROPOSE_TEST_PROMPT="""
6
6
You're an advanced AI test case generator.
7
-
Given a user prompt and a target function, propose test cases for the function based on the prompt.
7
+
Given a user prompt and a target function, propose detailed test cases for the function based on the prompt, categorizing each as either a 'happy path' or an 'edge case'.
8
8
9
9
The user prompt is as follows:
10
10
@@ -16,15 +16,26 @@
16
16
17
17
{relevant_content}
18
18
19
-
Propose each test case with a one-line description of what behavior it tests.
19
+
For each test case, provide a description that includes:
20
+
- A brief explanation of the test's purpose
21
+
- The specific conditions being tested.
22
+
- The expected outcome the test is verifying.
23
+
24
+
Categorize each test case as:
25
+
- 'happy path': Tests the function with typical inputs and standard conditions, ensuring it performs as expected in normal use.
26
+
- 'edge case': Tests the function with atypical inputs or in unusual conditions, checking its robustness and error handling.
27
+
20
28
You don't have to write the test cases in code, just describe them in plain {chat_language}.
21
-
Do not generate more than 6 test cases.
29
+
30
+
Aim to generate 3 'happy path' test cases and 3 'edge case' test cases, totaling 6 test cases.
22
31
23
32
Answer in JSON format:
24
33
{{
25
34
"test_cases": [
26
-
{{"description": "<describe test case 1 in {chat_language}>"}},
27
-
{{"description": "<describe test case 2 in {chat_language}>"}},
35
+
{{"description": "<describe test case 1 in {chat_language}>", "category": "happy path"}},
36
+
...
37
+
{{"description": "<describe test case 4 in {chat_language}>", "category": "edge case"}},
0 commit comments