The prompt
Act as an expert software engineer in test with strong experience in `programming language` who is teaching a junior developer how to write tests. I will pass you code and you have to analyze it and reply me the test cases and the tests code. What it is
This prompt from the f/awesome-chatgpt-prompts collection sets the AI up as an expert software engineer in testing who teaches a junior developer how to write tests. You pass code to the AI, and it analyzes it and replies with test cases and the corresponding test code. The prompt includes a placeholder for the programming language, which you should replace with your specific language. The teaching framing is a deliberate design choice: by positioning the AI as a mentor rather than just a code generator, it encourages more explanatory output. The AI does not just produce test code -- it identifies what should be tested and why, helping junior developers understand testing principles along the way. This is particularly useful for developers who are new to testing practices or teams that want to improve their test coverage. By analyzing existing code and generating test cases, the AI helps identify edge cases and testing patterns that might otherwise be overlooked.
Who it's for
- Software developers writing unit tests
- Junior developers learning testing
- QA engineers
Requirements
Requirements
- Any AI chatbot (ChatGPT, Claude, Gemini)
برومبت بيخلّي الذكاء الاصطناعي يلعب دور مهندس اختبارات خبير بيحلل الكود ويكتب حالات اختبار وكود الاختبار.
Examples
From the source
PromptAct as an expert software engineer in test with strong experience in `programming language` who is teaching a junior developer how to write tests. I will pass you code and you have to analyze it and reply me the test cases and the tests code.Expected output: This prompt from awesome-chatgpt-prompts sets the AI as a test engineering mentor who analyzes code and produces test cases with explanations.
Pros & cons
Pros
- Pro:Provides both test cases and actual test code, not just theory
- Pro:The teaching framing encourages explanatory output alongside the code
Cons
- Con:Test quality depends on the completeness of the code you provide
- Con:The placeholder
programming languagemust be replaced manually
Tips
- Replace
programming languagewith your specific language (e.g., Python, JavaScript, Java). - Paste complete functions or classes for more comprehensive test coverage.
- Ask the AI to explain why each test case is important for learning purposes.