Negative Software Test Case
Jump to navigation
Jump to search
A Negative Software Test Case is a software test case whose expected outcome verifies that a software-based computing system safely rejects or handles an invalid input, prohibited state, or failure mode.
- AKA: Software Negative Test Case, Invalid-Input Software Test Case, Unhappy-Path Software Test Case.
- Context:
- It can typically be created during a test case creation task to complement nominal cases derived from a software requirement.
- It can typically specify malformed inputs, out-of-range parameters, unauthorized actions, or violated preconditions alongside the expected refusal, exception, or safe fallback behavior.
- It can typically be executed during a software-based system testing task and judged by a software test oracle that confirms the software system fails closed rather than silently accepting invalid input.
- It can typically be organized inside a test suite alongside positive cases to detect false conformity, silent data corruption, and software defect regressions.
- It can typically be recorded in a testing record and mapped via a traceability matrix to defensive system requirements.
- It can often complement an error seeding technique and black-box testing by probing boundary violations and exception-handling paths left unexercised by happy-path tests.
- It can often participate in regression testing and test driven development whenever a prior failure or security bypass is locked down as a permanent refusal check.
- It can often support a verification task and quality assurance gate by proving that permission checks, schema validators, and parser guards actively reject disallowed inputs.
- It can range from an isolated software unit test rejecting a malformed argument to an end-to-end governance or security gate test verifying refusal of an unauthorized operation across a software program.
- It can range from a deterministic boundary violation test targeting a single invalid field to an adversarial malformed-payload test exercising multi-step recovery across a software-based computing system.
- ...
- Examples:
- Input-validation negative software test cases, such as supplying an empty string, negative length, or malformed JSON payload to a software program and asserting a structured validation error.
- Authorization and governance negative software test cases, such as submitting an out-of-scope target title or missing credential to a fail-closed gate and asserting refusal with zero state mutation.
- Resource and fault-handling negative software test cases, such as exceeding a numeric ceiling or simulating a missing dependency and asserting graceful degradation rather than silent corruption.
- ...
- Counter-Examples:
- Software Test Oracle, which is the decision mechanism that judges whether observed software testing behavior matches expected behavior rather than the software test case specifying invalid inputs.
- Error Seeding Technique, which intentionally injects faults into a software program to measure defect-detection effectiveness rather than verifying safe rejection of invalid inputs.
- Test Suite, which is a collection of multiple test cases grouped for execution rather than a single negative test specification.
- See: Software Test Case, Negative Test Case, Test Case, Software Test Oracle, Error Seeding Technique, Software Unit Test, Test Suite, Software-based System Testing Task, Software-based Computing System, Software Engineering, Software Defect, Failure Mode.
References
2022
- (ISO/IEC/IEEE 29119-1, 2022) ⇒ ISO/IEC/IEEE. (2022). "Software and systems engineering — Software testing — Part 1: General concepts (ISO/IEC/IEEE 29119-1:2022)." International Organization for Standardization. Retrieved: 2026-12-03.
- Defines software test cases, test conditions, and expected results covering both valid (positive) and invalid (negative) input partitions and error-handling behavior.
2011
- (Myers et al., 2011) ⇒ Glenford J. Myers, Corey Sandler, and Tom Badgett. (2011). "The Art of Software Testing, 3rd edition." Wiley. Retrieved: 2026-12-03.
- Establishes that effective software test-case design must explicitly cover invalid and unexpected input conditions as well as valid ones so defect-revealing failure modes are exercised.