liveBook · Manning

Negative testing

Negative testing is a technique that evaluates whether software correctly handles invalid, unexpected, unavailable, or prohibited inputs and conditions.

How 2 Manning books explain it

Effective Conversational AI

Negative testing evaluates whether a system correctly rejects, declines, or otherwise handles inputs that it should not answer or process.

How it is used
Evaluates whether a conversational solution recognizes when it should not attempt to answer or process an utterance.
How deep it goes
Distinguishes off-topic and ambiguous utterances from ordinary classifier tests, but does not assign them golden intents.
Examples
Uses utility-account questions, pop-culture trivia, and ambiguous utterances such as “account,” “that one,” and “2.”
What you can do after
Diagnose whether a bot appropriately rejects, defers, or otherwise handles off-topic and unclear user utterances.

Read how Effective Conversational AI explains negative testing →

Data-Oriented Programming: Reduce software complexity

A negative test case verifies that software behaves correctly when given invalid input or an input that should cause failure.

How it is used
Strengthens unit tests for mutations by checking behavior when an operation should fail.
How deep it goes
Demonstrates setup, execution, exception capture, and comparison, while deferring broader invalid-input categories.
Examples
Tests adding an already-existing member and expects the exact "Member already exists." exception.
What you can do after
Diagnose failure handling by verifying that invalid mutation input produces the expected exception.

Read how Data-Oriented Programming: Reduce software complexity explains negative testing →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.