Test Case
We can define a test case as a documented scenario or condition that outlines the steps, inputs, and expected outputs required to validate a specific feature or functionality of a software/application. It serves as a guide for testers (QA team) to execute tests systematically, ensuring that the system behaves as intended and meets the desired requirements.
Test cases include unique identifiers, objectives, prerequisites, inputs, test steps, expected and actual results, and test status, providing a structured approach to testing and serving as documentation for future reference.
We can write test cases based on: Requirements, Functional Specifications, Use Cases or user Stories
Test Case Elements
Test case identifier:
A unique identifier or number assigned to each test case for easy reference and tracking.
Test objective:
A clear statement of the purpose or objective of the test case, specifying what functionality or behavior is being tested.
Test prerequisites:
Any necessary conditions or prerequisites that need to be fulfilled before executing the test case, such as specific system configuration, data setup, or environment setup.
Test inputs:
The specific inputs or data values that need to be provided to the system for the test case execution. This may include user actions, data entry, system configurations, or interactions.
Test steps: Detailed, step-by-step instructions that outline the actions and interactions necessary to execute the test case. Each step should be clear, concise, and unambiguous.
Expected results:
The expected outcome, behavior, or response of the system when the test steps are executed correctly. It should be specific, measurable, and defined in a way that allows testers to determine whether the test has passed or failed.
Actual results:
The actual outcome, behavior, or response observed during the test execution. Testers compare this with the expected results to determine if there are any discrepancies or issues.
Test status:
The overall status or result of the test case, such as "pass," "fail," or "not executed." This helps in tracking the progress of testing and identifying any failed or unresolved test cases.
Test Case Example
here is an example of what we can say its a Login Test case,
Test Case ID: TC001
Test Case Name: Login - Valid Credentials
Objective:
- To verify that a user can successfully log in using valid credentials.
Preconditions:
- The application is installed and accessible.
- The user account with valid credentials exists in the system.
Test Steps:
- Launch the application.
- Navigate to the login page.
- Enter the valid username in the username field.
- Enter the valid password in the password field.
- Click on the "Login" button.
- Wait for the system to process the login request.
Expected Result:
- The user should be redirected to the home/dashboard page.
- The system should display a success message indicating a successful login.
- The user's name or profile picture should be displayed on the page, confirming that the correct user is logged in.
Actual Result:
- The user is redirected to the home/dashboard page.
- The system displays a success message: "Login successful."
- The user's name or profile picture is displayed on the page.
- Test Status: Pass
Postconditions:
- The user remains logged in for further interactions within the application.
