What is a test case?

Answer

A test case is a set of conditions under which a tester determines whether a system or feature works correctly. A well-written test case contains: (1) Test case ID: unique identifier. (2) Title: what is being tested. (3) Preconditions: state the system must be in before the test. (4) Test data: specific inputs to use. (5) Test steps: step-by-step actions to perform. (6) Expected result: what should happen if the system works correctly. (7) Actual result: what actually happened (filled in during execution). (8) Pass/Fail status. (9) Postconditions: state after the test. Good test cases are: clear, concise, repeatable, objective, and traceable to requirements. In automated testing, the test case is encoded in the test function/method itself — the docstring or name serves as the title, assertions as expected results. Tools for managing test cases: Zephyr, TestRail, qTest, Xray.