What is Negative Testing?
Negative testing verifies that a system handles invalid input, unexpected conditions, and misuse gracefully, returning proper errors instead of crashing, corrupting data, or exposing vulnerabilities.
Free to start · 7-day trial on paid plans
In depth.
Positive (happy-path) testing confirms the system works with valid input. Negative testing, sometimes called sad-path or failure testing, confirms it behaves correctly when things go wrong: empty fields, wrong data types, out-of-range values, malformed payloads, expired tokens, duplicate submissions, and dependency failures.
Negative testing is closely tied to boundary value analysis and equivalence partitioning, which help generate invalid classes systematically rather than guessing. For APIs it means asserting correct status codes (400, 401, 403, 409, 422) and clear error messages; for UIs it means validation messages and disabled actions; for security it overlaps with input validation against injection and overflow.
The skill interviewers look for is judgment: you cannot test every invalid input, so you choose high-risk, high-likelihood negative cases. Strong testers think like an adversary and like a confused user simultaneously, covering both malicious and accidental misuse.
Why interviewers ask about this.
Many defects and security issues live on the unhappy path. Interviewers ask about negative testing to see whether you design for failure, not just confirm the happy path, which separates thorough testers from box-tickers.
Example scenario.
A signup form passes all happy-path tests. Negative testing reveals that submitting an existing email returns a 500 instead of a friendly 409, an empty password is accepted client-side but rejected with a stack trace server-side, and pasting 10,000 characters into the name field times out the request. Each is a defect the happy path never touches.
Interview tip.
Give a concrete negative case you caught and tie your approach to boundary value analysis and equivalence partitioning. Mention expected error codes/messages, that shows you test the failure contract, not just that it "errors".
Frequently asked questions.
What is the difference between positive and negative testing?
Positive testing checks the system works with valid input on the happy path. Negative testing checks it handles invalid input and unexpected conditions gracefully, with proper errors and no crashes or data corruption.
How do you decide which negative cases to test?
Use boundary value analysis and equivalence partitioning to enumerate invalid classes, then prioritize by risk and likelihood, you cannot test every invalid input, so focus on high-impact, high-probability misuse.
Related Terms
Explore related glossary terms to deepen your understanding.
Related Resources
Dive deeper with these related interview prep pages.
Free QA career tools, no account needed
Instant and private, everything runs in your browser. Try them before you sign up.
QA Resume Checker
Instant 0-100 score on automation keywords, impact, and ATS formatting.
QA Cover Letter Generator
A tailored 3-paragraph QA cover letter from your resume and a job post.
QA Application Tracker
Drag-and-drop kanban to track every QA application from Applied to Offer.
QA Take-Home Test Generator
A realistic take-home assignment with a scenario, tasks, and a rubric.
QA LinkedIn Headline Generator
A recruiter-searchable headline, About section, and skills list.
QA STAR Story Builder
Structure a QA behavioral answer with the STAR method and instant checks.
QA Bug Report Generator
Build a clean, reproducible bug report for Markdown, Jira, or plain text.
Boundary Value Analysis Generator
Generate boundary value and equivalence partitioning test cases from a range.
QA Metrics Calculator
Calculate DRE, defect leakage, defect density, and pass rate with interpretation.
QA Test Plan Generator
Build a structured test plan (scope, approach, criteria, risks) in Markdown.
Ready to Ace Your QA Interview?
Practice explaining negative testing and other key concepts with our AI interviewer.
Join 1,200+ QA engineers already practicing with AssertHired.
Start your free QA interview