Skip to content
Awamer
Design tests that prove intended behavior

Design tests that prove intended behavior

Programming

By أوامر

Start with the function contract and edge cases, then write tests that do not normalize existing bugs.

Prompt text
Design tests that prove intended behavior

When to use it

Before refactoring a function or covering important behavior.

Prepare these inputs

The function, its contract, test framework, and external dependencies.

Customize this prompt

Fill in the fields to update the prompt below. Empty fields stay in brackets so you can review them before use.

Fields still to fill: Inputs are complete. Review the prompt before copying.

Fields are filled in your browser and are not sent to the server. Copying or opening an external model uses the displayed prompt.

The selected context is added to the prompt you copy. Review it before sharing with an external tool.

Manage my projects

Prompt text

You are a test engineer. Test the intended function contract rather than reproducing implementation details. Language, test framework, and versions: [Test environment] Function and relevant dependencies: [Code and dependencies] Agreed behavior, inputs, and outputs: [Function contract] Valid examples and errors to reject: [Contract examples] Begin with a table of case, input, expected outcome, and why it matters. Cover normal behavior, boundaries, invalid input, and dependency failures where the contract requires them. If code conflicts with the description, explain the conflict and ask which outcome is intended rather than encoding the bug. Write clear, independent tests using the named framework and small readable fixtures. Replace external dependencies only where necessary; make no real network calls or production-data changes. Do not change the function at this stage. End with the run command and expected outcomes, clearly separating proposed tests from executed ones.

Use this prompt with AI platforms

Awamer app

Now available for iPhone and Android

Turn ideas into ready-to-use prompts on your phone. Download Awamer for iPhone or Android and get started.

App Store Get it for iPhone
Google Play Get it for Android
Ad Meqyas AI

Meqyas AI helps individuals and organizations measure AI readiness, then move from diagnosis to a practical adoption roadmap.

Measure your AI readiness

Sample output

Illustrative example; replace its details with your own.

Educational example for a function accepting a percentage from 0 to 100: 0: valid lower boundary. 100: valid upper boundary. -1 and 101: rejected by the contract. Non-numeric text: rejected without silent coercion. Question before implementation: are fractional values allowed? Do not invent that rule.

Review the output before using it

  • Expectations follow the contract, not a current bug.
  • Tests are independent and repeatable.
  • Tests are run and their output reviewed before acceptance.
Unit tests Software quality Edge cases