Software Testing Artifacts – Detailed Guide

3. Test Case

What is a Test Case?

A Test Case is a documented set of preconditions or prerequisites, procedures and postconditions or expected results used by a tester to determine that the system undergoing the test satisfies the requirements, i.e. works correctly or not is called a test case.

It contains test data, test steps and conditions to verify the particular feature or functionality of the software.

A test case can comprise multiple test scripts and are a part of the test suite containing multiple test cases.

It can be of two types:

  1. High-level test case: A test case containing abstract information for input data, preconditions, expected results, postconditions, and related actions according to test conditions is called a high-level test case.
  2. Low-level test case: A test case containing factual information for input data, preconditions, expected results, postconditions, and related actions according to test conditions is called a low-level test case.
READ  15 Top Cloud Computing Service Provider Companies

How to write good test cases? 

Some best practices for writing a good test case:

1. Software Testing Techniques Implementation

Since it is not possible to check every possible test case, the software testing techniques help testers identify test cases with the maximum probability of finding defects. Here are some of the software testing techniques:

  • Equivalence Partition (EP): The EP technique partitions that range of values having similar behaviour in equal parts or groups.
  • Error guessing technique: This testing technique is not a formal method of testing and relies heavily on a tester’s experience. The technique involves anticipating or guessing the errors that might arise in manual testing.
  • Boundary Value Analysis (BVA): This software testing technique defines boundaries for a specified range of values.
  • State Transition technique: When due to a particular action, software behaviour changes from one state to another, then we use this software testing technique.

2. Test Case creation according to end-user

Software is developed for an end-user, and so the test cases should be created according to the end-user. Thus, test cases must meet the client’s requirements and should be easy to operate.

3. No Assumptions

The functionality and features of the software application should not be assumed and must adhere to the Specification documents.

4. Consistency in test case results.

The test cases must generate consistent and same results each time the test is executed, irrespective of the person conducting the test.

5. No test cases should be repeated

There are already a considerable number of test cases, and thus there is no need to repeat already defined test cases. In case a test case is required by any other test case then call it using the Test case ID from the preconditioned column.

READ  Regression Testing

6. Simple and Transparent

The test cases must be simple, clear and concise for anyone to understand and not just the author.

Strong language like enter data, go to the home page, click on this, and similar should be used so that the test steps can be easy to understand, and the test execution can become faster.

7. Review from peers

Once the test case creation is complete, it should be reviewed from the colleagues or peers to uncover defects in the test case design that the author may have missed.

8. Ensure 100% Coverage

A traceability matrix is used to ensure 100% test coverage so that no functions or conditions specified in the software requirement are left untested.

9. Test Environment stability

The test cases used in a particular environment should not render it useless. Once the test case execution is complete, the test environment must return to its pre-test state, especially in configuration testing.

10. Identifiable test cases

The test cases must have proper ID so that they can are easily identifiable during defect tracking or software requirement identification at a later stage.

Apart from the above practices, here is a few information that the tester must include while drafting the test case:

  • No more than 15 steps should be present in a test case.
  • Test Case must contain information about how system testing will happen.
  • Actions, expected results, inputs and outputs must be included.
  • Offer an alternative to prerequisite tests.
  • The test setup must contain information like hardware, operating system, version of application under test, security access, software, time of day, physical or logical data, prerequisites, and other setup related information pertinent to requirements under test.
  • A description of what software or functionality is undergoing testing should be present.
  • Proofs or attachments related to testing should be present.
  • Comments on inputs expected results, and purpose should be in the automated test script.
  • Use Active case language in the test script.
READ  API Testing Tutorial

Test Case Template

Following elements are a part of the test case template. However, often companies use test case management tools, and thus the template or format for test cases is determined by that tool.

Test Suite IDIt denotes the test suite ID to which the test case belongs.
Test Case IDIt is the test case ID.
Test Case SummaryIt defines the objective or summary of the test case.
Related RequirementIt is the requirement ID that the test case traces or relates.
PrerequisitesThese are the preconditions or pre requisites that need to be satisfied before the test execution begins.
Test Script/ProcedureIt is the step-by-step procedure of the test execution.
Test DataThe test data or related links that will be used in the test.
Expected ResultThe expected test case results.
Actual ResultThe actual test case results after conducting the test.
StatusIt can be either pass of fail. Other status includes ‘Not Executed’ in case testing is not performed and ‘Blocked’ in case testing is blocked.
RemarksComments related to test case or test execution.
Created ByName of the test case author.
Date of CreationDate of creation of the test case.
Executed ByName of the person who conducted the test.
Date of ExecutionDate of execution of the test.
Test EnvironmentSoftware or Hardware or Network used for test execution.

Test Case Example Format of Standard Test Cases

Test Suite IDTS1
Test Case IDTC1
Test Case SummaryTo verify checkout functionality of a product
Related RequirementRS1
Prerequisites1. User is logged in.2. Cart is added with products.
Test Script/Procedure1. After product addition, click checkout button.2. Enter address and contact details.3. Select payment method.4. Enter details related to payment method.5. Make payment.
Test Data1. Address, and contact details.2. Payment Method: Credit card, Debit card, UPI, Wallet, Net Banking.3. Payment details
Expected Result1. If payment details are valid, redirect back from payment gateway and display payment successful message.2. If payment details are invalid, redirect back from payment gateway and display payment unsuccessful message.
Actual Result1. If the payment details are valid, the results are as expected.2. If payment details are invalid, the results are as expected.
RemarksThe checkout functionality works correctly.
Created ByJohn
Date of Creation04-19-2020
Executed ByMary
Date of Execution05-12-2020
Test EnvironmentOS: Windows 10Browser: Chrome 85

Test Case Management Tools

The automation tools used in managing and maintaining the test cases are called test management tools.

Their main features are:

1. Traceability: Test Cases, requirements, and their execution are all interlinked by tools such that each of them can be traced to each other to check the test coverage.

2. Test Case execution and result recording: Tools make test case execution and recording of results obtained very easy.

3. Test case Protection: Version control should not be inadequate as the test cases need to be reused and hence should be protected from being lost or corrupted. Some features included for this are:

  • Versioning
  • Off-Site backup
  • Naming and numbering conventions
  • Read-only access
  • Controlled access

4. Documentation of test cases: The test management tools can be used to expedite test case creation using a template.

5. Automated defect tracking: The failed tests can be automatically linked to the bug tracker in test management tools and assigned to developers, along with being tracked by email notifications.