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.

The prompt

77 words2 blanks to fill in

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.

  1. Copy the prompt

    Use the Copy button above. The whole prompt goes to your clipboard exactly as written. Nothing is trimmed.

  2. 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.

  3. 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.

  4. 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.

Share Create Comprehensive Unit Test Cases from Function Signature and Description:

Reviews and questions

What other people got out of this prompt, and what they asked about it.

No reviews yet

Be the first to share how this prompt worked for you.