Test Case Examples

Positive and Negative Test Cases with Examples

Learn the difference between positive and negative test cases, see practical examples, and build a balanced suite without duplicating scenarios.

By AutomationTekAI9 min read
Positive and negative QA test case examples in AutomationTekAI

Positive tests prove that intended workflows succeed. Negative tests prove that invalid or disallowed behavior fails safely. Strong coverage needs both, but each case should test a meaningful rule rather than inflate a count.

What is a positive test case?

A positive test uses valid data, a permitted role, and the expected sequence. It confirms the primary business outcome and important variations of the happy path.

What is a negative test case?

A negative test uses invalid, missing, expired, duplicate, unauthorized, or boundary-breaking input. It verifies safe rejection, no unintended side effects, and a useful error or recovery path.

Positive and negative examples

FeaturePositive exampleNegative example
LoginValid active account signs in.Wrong password is rejected without revealing whether an account exists.
CheckoutAvailable item and valid payment complete the order.Expired payment method is declined without creating an order.
APIValid authorized payload returns the documented success response.Missing required field returns the documented validation response.
File uploadSupported file within the size limit uploads.Unsupported or oversized file is blocked with guidance.

Use a simple design pattern

Given: the user, data, permissions, and system state
When: the user performs one focused action
Then: verify the result, message, state change, and side effects

Avoid duplicate cases

Do not create separate cases when the only difference is wording. Use equivalence classes and boundaries: empty, minimum, just below minimum, maximum, just above maximum, malformed, and unauthorized where those rules exist.

Using AI responsibly

Give AutomationTekAI the actual validation and permission rules, request both types, and review every result. AI may suggest useful risks, but suggestions are not requirements until the product owner or source documentation confirms them.

Review checklist

  • Does each case trace to a requirement, boundary, permission, or known risk?
  • Is the expected result observable and specific?
  • Does the negative case verify that state was not changed?
  • Are security-sensitive errors neutral and free from unnecessary disclosure?
  • Are test data and cleanup requirements clear?

Frequently asked questions

What is a positive test case?

A positive case verifies that valid input and an allowed workflow produce the expected successful result.

What is a negative test case?

A negative case verifies that invalid, missing, unauthorized, or unexpected input is rejected safely and explained clearly.

How many negative cases should I write?

There is no universal number. Prioritize documented rules, high-risk failures, boundaries, permissions, recovery behavior, and historically fragile areas.