Best Practices for Writing Test Cases

21 / Jun / 2017 by Rohit Yadav 0 comments

What is a Test Case?

Set of conditions or variables used by testers to determine whether a system works as expected are Test Cases. iphone 6 plus silicone cases These help in validating the coverage of an application.

A test case should be :

  • Easy to understand and execute
  • Accurate
  • Easy to trace as per requirements
  • Repeatable
  • Reusable

Test cases include :

Test cases include various fields which help in traceability of test as per the requirements. Following are the fields which are most likely to be a part of a test case :

  1. Test Case ID – This is a unique ID for identification of a particular test case.
  2. Description – This comprises of a brief detail about what is going to be tested.
  3. Pre-condition – This includes any pre-requisite before moving towards the steps to test.
  4. Test Steps - This includes a step-wise approach to test a particular test case.
  5. Expected Result – This covers what should happen.
  6. Actual Result – This encompasses of what actually happened.
  7. Status (Pass/Fail) – This involves the status of a test case after performing a test, whether a test case was passed or failed.

Best practices to write a test case :

Test cases which are easy to execute are considered as good test cases. bulky iphone 8 plus case They make the testing process more efficient by saving time and effort. peel iphone 8 plus case We can achieve this by following these 10 best practices :

1) Keeping it Simple and Easy to Understand

A good test case is the one which is easy to understand and execute for the testers. To be a good test case, it should be simple and organized category-wise. Different grouping techniques could be splitting the test cases based on user story or modules like browser specific behaviors etc. This makes it easy to review and maintain. flash phone case iphone 6 plus Information given in the test cases should be clear to testers, developers and other stakeholders involved in the project.

2) Including End User Perspective

The end user perspective is a key element when it comes to maintaining the quality of software. Therefore, before drafting a test case, it’s important to think like an end user. striped iphone 6 plus cases Understanding the requirement and the functionality aspects covered by the end user’s perspective will help in identifying test scenarios that arise in real life business conditions.

3) Using Correct Naming Conventions

Naming the test cases in a way that makes it easy for stakeholders to identify as it will help create good and readable test cases. These also help in traceability as per requirements.

4) Providing Test Case Description

A proper test case description will allow users to understand what is being tested and how. iphone 6 plus cases rick and morty Relevant details like the test environment, test data and tools to be used should also be provided.

5) Including Assumptions

All the assumptions and preconditions that are applicable to the test case should be specified clearly in the test case document.

6) Providing Steps Involved

Steps involved to test a test case should be clearly specified so that if any other person performs the test they would be clear about what all steps to follow.

7) Giving Details Of Test Data

The details of the test data for execution of the test case especially in cases where the same data can be reused helps in saving time for the creation of the test data for each cycle to be run. Aim for maximum coverage by choosing a few select values from each equivalence class.

8) Making it Reusable

Ensuring that there is no dependency or conflict among test cases helps in making it modular.


Leave a comment -