🧪Test Case
Also known as Test, Test Scenario
One check in a test. It has a set input and a result you expect.
Think of it like
Think of it like one question on a quiz. It has one right answer.
Example
Jack writes three test cases for his login. One has the right password, one the wrong one, and one an empty box.
Why it matters
Clear test cases turn a vague hope that it works into checks a computer runs each time.
Definition
Example code
python
def test_total():
assert total([2, 3]) == 5Common mistake
Key takeaways
- 1Input, steps, result. The three parts.
- 2One thing each. One reason to fail.
- 3Named for what it checks. The name explains the fail.