Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Writing Test Cases | Software Testing in Practice
Introduction to Manual Testing & QA in Web Development
course content

Contenido del Curso

Introduction to Manual Testing & QA in Web Development

Introduction to Manual Testing & QA in Web Development

1. Introduction to Software Testing & QA
2. Software Testing in Practice
3. Functional Testing
4. Non-Functional Testing

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:
    1. Open the login page;
    2. Enter the username;
    3. Enter the password;
    4. 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:
    1. The user must be logged in using the account "testuser1";
    2. The user must be on the chat page;
  • Test Steps:
    1. Select the input field;
    2. Enter "Hello World";
    3. 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:
    1. The user is already logged in and is on the chat page;
  • Test Steps:
    1. Make sure the chat box input field is empty;
    2. Click "Send";
  • Expected Result:
    1. 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.

1. What is a test case?
2. Which of the following is NOT a fundamental part of a test case?
3. What should the Test Case Description contain?

What is a test case?

Selecciona la respuesta correcta

Which of the following is NOT a fundamental part of a test case?

Selecciona la respuesta correcta

What should the Test Case Description contain?

Selecciona la respuesta correcta

¿Todo estuvo claro?

Sección 2. Capítulo 1
We're sorry to hear that something went wrong. What happened?
some-alt