What is the difference between positive and negative testing?
Answer
Positive tests show that valid input and expected user paths produce the intended result. Negative tests challenge invalid input, forbidden actions, unavailable dependencies and incorrect sequences, then verify safe rejection, useful feedback and preserved state. Negative testing is not random invalid data; it is derived from risks and rules.
Strong answer includes
- valid path versus controlled misuse
- checks safe failure and state preservation
- derives negative cases from risks
Practical example
For a fund-transfer form, positive tests confirm that transferring 100 dollars between two valid accounts with sufficient balance succeeds and updates both balances correctly. Negative tests try transferring a negative amount, transferring more than the available balance, and submitting the form twice quickly to check for a double-charge race condition — each should be rejected with a clear error and leave both account balances unchanged.