Coding, Development & IT Security Difficulty: Intermediate
Create Comprehensive Unit Test Cases from Function Signature and Description
This prompt instructs to act as an experienced software tester with expertise in unit testing. Based on the provided function signature and description, create detailed unit test cases that cover typical, edge, and error scenarios relevant to the function's behavior. Include test inputs, expected outputs, and any necessary setup or teardown steps. Present the output as a structured test case suite that guides the testing process from start to finish.
Act as an experienced software tester with expertise in unit testing. Based on the provided [FUNCTION SIGNATURE], placeholder and [FUNCTION DESCRIPTION], placeholder, create a comprehensive suite of unit test cases. For each test case, specify the test input values, expected output or behavior, and any required setup or teardown procedures. Ensure coverage includes normal operation, boundary conditions, and error handling scenarios. Deliver the results as a structured test case suite that guides the testing process from start to finish.
Highlighted text is a blank. Swap it for your own detail before you send the prompt.
What Create Comprehensive Unit Test Cases from Function Signature and Description produces
- {'test_case_name': 'Test with valid input', 'input': '[SPECIFIC INPUT VALUES]', 'expected_output': '[EXPECTED RESULT]', 'setup': '[SETUP STEPS IF ANY]', 'teardown': '[TEARDOWN STEPS IF ANY]'}
- {'test_case_name': 'Test with boundary input', 'input': '[BOUNDARY INPUT VALUES]', 'expected_output': '[EXPECTED RESULT]', 'setup': '[SETUP STEPS IF ANY]', 'teardown': '[TEARDOWN STEPS IF ANY]'}
- {'test_case_name': 'Test with invalid input', 'input': '[INVALID INPUT VALUES]', 'expected_output': '[EXPECTED ERROR OR EXCEPTION]', 'setup': '[SETUP STEPS IF ANY]', 'teardown': '[TEARDOWN STEPS IF ANY]'}
How to use Create Comprehensive Unit Test Cases from Function Signature and Description
Four steps, about a minute. Nothing to install and no account needed.
Copy the prompt
Use the Copy button above. The whole prompt goes to your clipboard exactly as written. Nothing is trimmed.
Fill in the blanks
Replace [FUNCTION SIGNATURE] [FUNCTION DESCRIPTION] with your own details. Everything in square brackets is a blank for you to fill in.
Paste it into your assistant
Checked against ChatGPT, Claude, Gemini. It is written as plain instructions, so paste it into whichever of them you already use.
Read the result, then push back
Compare what you get to the example below. If it is close but not right, say what to change: shorter, warmer, more specific, then ask again in the same conversation.
More prompts like Create Comprehensive Unit Test Cases from Function Signature and Description
Close neighbours in Coding, Development & IT Security, by shared subject and tagging.
- Create Comprehensive User Acceptance Testing (UAT) Plans for Projects
- Optimize Code Review Process to Enhance Constructive Feedback and Team Collaboration
- Evaluate and Integrate New Software Development Methodology into Team Workflow
- Create a Comprehensive Mobile App Development Roadmap for a Startup
- Systematic Troubleshooting and Resolution of Feature Failures After Code Changes
- Strategic Plan for Developing Features Using Unfamiliar Programming Languages
Reviews and questions
What other people got out of this prompt, and what they asked about it.
Sign in to review this prompt.
Sign In to ReviewNo reviews yet
Be the first to share how this prompt worked for you.
Ask how to customize, adapt, or use this prompt more effectively.
Sign In to AskNo questions yet
Have a question about using or customizing this prompt? Be the first to ask.