Skip to content

Commit 22bc1d6

Browse files
committed
fix: prompt
1 parent 2134276 commit 22bc1d6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

backend/src/main/java/ch/xxx/aidoclibchat/usecase/service/CodeGenerationService.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,16 @@ public class CodeGenerationService {
6565
4. Generate a test class for the source class and use the context classes as sources for creating the test class.
6666
5. Use the code of the test class as test example.
6767
6. Generate tests for each of the public methods of the source class.
68-
69-
Your additional guidelines:
70-
1.Implement the AAA Pattern: Implement the Arrange-Act-Assert (AAA) paradigm in each test, establishing necessary preconditions and inputs (Arrange), executing the object or method under test (Act), and asserting the results against the expected outcomes (Assert).
71-
2.Test the Happy Path and Failure Modes: Your tests should not only confirm that the code works under expected conditions (the 'happy path') but also how it behaves in failure modes.
72-
3.Testing Edge Cases: Go beyond testing the expected use cases and ensure edge cases are also tested to catch potential bugs that might not be apparent in regular use.
73-
4.Avoid Logic in Tests: Strive for simplicity in your tests, steering clear of logic such as loops and conditionals, as these can signal excessive test complexity.
74-
5.Leverage TypeScript's Type System: Leverage static typing to catch potential bugs before they occur, potentially reducing the number of tests needed.
75-
6.Handle Asynchronous Code Effectively: If your test cases involve promises and asynchronous operations, ensure they are handled correctly.
76-
7.Write Complete Test Cases: Avoid writing test cases as mere examples or code skeletons. You have to write a complete set of tests. They should effectively validate the functionality under test.
7768
78-
Generate the complete source code of the test class implementing the tests.
69+
Your additional guidelines:
70+
1.Implement the AAA Pattern: Implement the Arrange-Act-Assert (AAA) paradigm in each test, establishing necessary preconditions and inputs (Arrange), executing the object or method under test (Act), and asserting the results against the expected outcomes (Assert).
71+
2.Test the Happy Path and Failure Modes: Your tests should not only confirm that the code works under expected conditions (the 'happy path') but also how it behaves in failure modes.
72+
3.Testing Edge Cases: Go beyond testing the expected use cases and ensure edge cases are also tested to catch potential bugs that might not be apparent in regular use.
73+
4.Avoid Logic in Tests: Strive for simplicity in your tests, steering clear of logic such as loops and conditionals, as these can signal excessive test complexity.
74+
5.Leverage Java's Type System: Leverage static typing to catch potential bugs before they occur, potentially reducing the number of tests needed.
75+
6.Write Complete Test Cases: Avoid writing test cases as mere examples or code skeletons. You have to write a complete set of tests. They should effectively validate the functionality under test.
76+
77+
Generate the complete source code of the test class implementing the tests.
7978
8079
{testExample}
8180

0 commit comments

Comments
 (0)