How to write test cases in software testing with example

by Klaus on February 6, 2020

in Articles

A test case contributes to being a set of specific actions which are executed for verifying a certain functionality or feature of the product. A test case is regarded as a crucial component of the life cycle of the software testing which plays an integral role in validating the application under test or AUT.

With test cases, it is possible for the testers for validating if a specific software app is free from flaws, errors and bugs and ensuring that it is working in the right way, as preferred by the end user. If you want to learn how to write the test cases, you need to know about the basic writing skills, pay minute attention to every detail.

Test cases for a specific module are known to be grouped into the certain test suite. Test sessions are inclusive of a wide array of test cases, since more than one scenario is tested here.

Benefits of writing test cases

Writing effective tests is useful to the test team offering Software Testing & QA services in preparing and ensuring the good test coverage across the app. However, writing the test cases has a broader effect on the user experience and quality assurance. Test cases are useful in revealing a plethora of information which plays a vital role in bringing an improvement in the quality of the software.

A well-written and well-defined test cases is useful to the tester for understanding as well as executing the tests

At the time of writing the test cases, the tester needs to think from the user point of view and include all the prerequisite details. If you put extensive efforts for writing great test cases, you will be capable of saving an ample amount of time as well as efforts.

A well written test brings out a significant difference between a poorly tested app and a well-tested software application. Writing high quality of test cases plays a vital role in bringing out the flaws and errors in the software and launching a high quality of product in the market.

Tips for writing test cases in software testing

Here are some tips that will be useful to you in writing the test cases in software testing:

Using a strong title

A strong title is considered to be the foundation of a well written test case. It is recommended to name these test cases along with the similar lines, like the modules, you are going to test. For instance, if you want to test the login page, it is essential to name the title of the specific test cases as “Login Page”. In certain cases, if the tools that are being used for testing the software are not doing this, you should be including a unique identifier in the test case’s title and thus you need to refer to the identifier, in place of a long title.

Choose a strong description

With the description, the tester should be capable of understanding what they will test. At times, this specific section includes specific pertinent details like the test case, the test environment, and certain preconditions. You should ensure that the description can be read easily and communicate the higher level goals of the test easily.

Including the preconditions and assumptions

You require including specific assumptions which are applicable to the test. In addition to this, you require including certain preconditions that needs to be accomplished before the execution of the test. These details should include the page in which the user should begin software testing, dependency on the environment of the test, as well as certain setup requirements which should be accomplished before conducting the test. The details are useful in keeping the steps of the test concise and short.

Make sure to keep the steps of the test concise and clear

You should ensure that the test cases are simple. You need to remember that the tester who is writing the test cases and the tester, executing the test case might be different. The test cases should be inclusive of the required information and data for the execution of the test. It is recognized to be the vital part of test cases. It is a must to keep this specific section concise and clear. However, you should ensure to include all the important details. It is recommended to write the test cases in a way that anyone can perform the test.

Inclusion of the expected result

With the expected result, the tester will gain information about what they are going to experience after the result of different test steps. It is useful for the tester in determining whether a test case is fail or pass.

Ensuring its reusability

A good test case is known to be reusable always and offers long term value to the specific software testing team. As you make the test case reusable, you will be capable of saving a lot of time.

Sample of test cases

Here is an example of a specific test case for Gmail Login:


Here Login Page will be the title.


A registered user should be capable of login into successfully.


The user should be registered already along with an email ID and password.


The browser of the end user supports Gmail.

Test steps

  • In this step, you require navigating towards
  • In the email field, you need to enter the email ID of the registered user
  • Now, you require tapping on the “Next” button
  • After this, you need to enter the password of the registered user
  • Now, hit on “Sign In”.

Expected result

A page that displays the inbox of the gmail user will load which will showcase new messages at the upper part of the page.

With well-written test cases, you will be capable of finding a plethora of usability issues and other gaps in the early design. Besides this, it helps in developing empathy for the end users. You will be capable of learning more about the product with the aid of well written test cases.


{ 3 comments… read them below or add one }

Arjun Singh April 13, 2020 at 07:58

Wow… You have done a tremendous job to collect and share this huge amount of strongly important information for all webmasters. One place with amazing information loaded.
Thank you so much!

Ruby Simmons January 19, 2021 at 10:17

Great article.

Sneha Khartad March 12, 2021 at 08:47

Nice article!!


Previous post:

Next post: