What are test cases, test scenario and Advantages of writing test cases

What is test case:

Test case is a document which gives all possible scenarios for one particular requirement. Ideally a test case document contains set of test data like preconditions,post conditions, actual results and expected results.

Test Scenario : Is a any functionality or a test condition or a test possibility.

Software Testing Life cycle:

Software Testing Life Cycle

Why to write test case: 

Test Coverage : Test coverage is a measure of testing and to have better test coverage it is required to write all the tested cases for identified scenario. Ideally the following process will be in action.

  1. Customer will give requirement to developer.
  2. Test engineer has to spend enough time to understand the requirement 
  3. Test engineer has to identify all possible scenarios
  4. Test engineer has to write test cases for all identified scenarios.

What are benefits of writing test cases:

  1. Better Consistency :  When test cases are written for a test execution, the test engineer work will be organised better and simplified. Let us consider a scenario as an example.

When a release1.0 is being tested using existing test cases, the same test cases can be quickly executed for the next release 1.0.1, having test cases helps to identify issues which impacting the old release, this way we can achieve better consistency in test execution.

2. Avoid training : To avoid training every new test engineer on the product or requirement. Consider the following situation.

  • Test Engineer write test cases.
  • Test engineer quits the job
  • New test engineer joins

It takes lot of effort to explain every module and it takes lot of time for new tester to understand the complete requirement.

  • But if we write test cases in the beginning, then the newly joined test engineer can test application by looking in to test cases on his own.
  • Here its not necessary to train him on requirement because, if he execute test cases for couple of release on test cycles he can understand the product.

3. No dependency : To depend on process rather than person. Every company will set their own process

EX: when we get the requirement test engineer should do follow the process.

Understand requirement

identify all scenarios and document.

Prepare a test cases for each scenarios and document.

This process of documenting each and everything will remove the dependency on a person

4. Writing test cases will keep track of all the steps for a particular scenario, this is very important because complicated steps to test a scenario might be difficult to remember always.

    Let us consider an example :

          Assume that an UI distortion issue will be produced by following steps in a particular scenario

Step1 : Login into Chrome browser ( Hard to remember the platform some times, issue is only in Chrome)

Step 2: Navigate to Home page 

Step 3: Select profile from menu in the header

Step 4: Edit First name and Last Name details by giving big string

Step 5: Go back to Home page

Step 6: Navigate to Events page ( only navigating to events page will reproduce the issue)

Step 7: Go back to Home page, the header will shift 100px down leaving black pack at the top

Assuming these steps were not recorded in test cases, when build release 1.0 is given, it is hard to reproduce the same issue again quickly. 

If test cases have written, test engineer can easily follow the steps to reproduce and test the issue.

5. Test cases will ensure that complete functional and non functional testing will be done and hence test cases will give complete list of all scenarios to meet the software product quality expectations.

6. The main objective of test case is to exercise every flow in application.

7. To ensure that it satisfies the BRS that is Business Requirement Specification and SRS that is System Requirement Specifications.

8. Test cases will ensure that every functionality working as expected in every possible scenario.

9. Test cases will ensure that all the requirements have been met as per the customer requirement document.

Check an example for Test Case Template

IMPORTANT : LEARN  TO USE JIRA BUG TRACKING 

 Posted By

Vinayak Mudiyappanavar,

Trainee Test Engineer