Course Content
Introduction to Manual Testing & QA in Web Development
Introduction to Manual Testing & QA in Web Development
Writing Test Cases
Introduction
A Test Case is a set of conditions and steps used to verify that a software application or a specific part of it functions as expected.
In software testing, it is essential to write as many test cases as possible to make sure all areas of the application are thoroughly tested and verified. The term Test Coverage defines what percentage of the Software is covered by the test cases that have been defined.
Before we start writing our own test cases, we need to understand the formal format of textually representing a Test Case. Depending upon the source of information, a test case may have varying formats. However, there are some fundamental parts which every format includes.
Test Case Template
- Test Case Description or Title: This contains some basic information about what the test case aims to check;
- Priority: This field indicates the importance and urgency of the test case, guiding the order of execution;
- Test Steps: The actual steps to perform the test;
- Test Data: The data that is supposed to be used while performing the test;
- Prerequisites: The conditions under which the test must be performed. It is also sometimes referred to as Precondition(s);
- Expected Results: The results which are expected, or needed, after performing the test. It is also sometimes referred to as Postcondition;
- Actual Results: The results that are obtained after performing the test;
- Test Status: The success status of the test case: Passed or Failed;
Example Test Cases:
Test Case 1
Following is an example of a test case which checks if a registered user can successfully login to the application:
- Test Case Description: To verify the functionality of the login form;
- Priority: Critical;
- Prerequisites: There must be an account registered in the database, having the username as "user1" and its password as "examplePassword123";
- Test Data: Username: "user1"; Password: "examplePassword123";
- Test Steps:
- Open the login page;
- Enter the username;
- Enter the password;
- Click "Login";
- Expected Results: The user is successfully logged in and redirected to the chat window;
- Actual Results: -
- Test Status: -
Test Case 2
The following test case aims to check if the chat functionality is working correctly.
- Test Case Description: To verify the functionality of the chat;
- Priority: Critical;
- Prerequisites:
- The user must be logged in using the account "testuser1";
- The user must be on the chat page;
- Test Steps:
- Select the input field;
- Enter "Hello World";
- Click "Send";
- Expected Results: The text "testuser1: Hello World" should be appended to the contents of the chatbox.
Test Case 3
Following is an example of another test case which tries to find a flaw in the program, and we will look at it in one of the upcoming chapters:
- Test Case Title: Sending an empty message in the Chat;
- Priority: High;
- Precondition:
- The user is already logged in and is on the chat page;
- Test Steps:
- Make sure the chat box input field is empty;
- Click "Send";
- Expected Result:
- No message is sent in the chat box;
In some formats, you might see a "Test Case ID", which serves as a unique identifier for the test cases.
Thanks for your feedback!