BACK TO BLOG

Best Practices for Authoring Test Cases in Software Testing

Published Date

July 15, 2024

Read

10 minutes

Written By

ACL Digital

A test case is a detailed, step-by-step document that helps testers perform multiple actions to test a particular scenario in an application. This also helps to capture the actual result against the expected result of each step to decide the overall status as PASS or FAIL.

How do you write a test case? What are the industry best practices for writing a test case? The objective of this blog is to provide guidelines for authoring test cases in a standard format before they are uploaded to test management tools (like ALM, qTest, JIRA, etc.). These guidelines will be applied to test-case authors of the same or different projects.

Test Case Author’s Roles and Responsibilities

  • dentifies test scenarios to perform testing (from past or current project/s, as applicable).
  • Modifies existing or creates new test cases using a standard template.
  • Participates in IT and business meetings to finalize test case lists.
  • Review the test cases in Excel format with the business/approver team.
  • Takes the lead in updating the test cases as per the reviewer’s comments, if required.

Test Case Authoring Pre-Requisite

Writing a test case is a critical aspect of software development and testing. Before authoring test cases, it's essential to have a clear understanding of the software requirements, specifications (SRS/FRS), and user stories. Here are some prerequisites to consider before writing test cases:

  • Requirements Understanding: Ensure that you have a thorough understanding of the software requirements. This encompasses both functional requirements (defining what the software must accomplish) and non-functional requirements (including aspects like performance, usability, security, etc.).
  • Functional Specifications: Review the functional specifications document or any other relevant documentation that describes the expected behaviour of the software.
  • User Stories or Use Cases: If the project follows Agile methodologies, review user stories or use cases to understand how users will interact with the software.
  • Test Planning: Have a test plan in place that outlines the overall testing strategy, including objectives, scope, resources, and timelines.
  • Test Environment Setup: Ensure that the necessary test environment, including hardware, software, and test data, is set up and ready for testing.
  • Testing Tools: Identify and set up any testing tools or frameworks that will be used for test case management, execution, and reporting.
  • Risk Analysis: Conduct a risk analysis to identify potential areas of risk or uncertainty in the software, which will help prioritize testing efforts.
  • Test Case Template: Define a test case template or format that includes fields such as test case ID, description, steps to reproduce, expected results, actual results, status, etc.
  • Test Case Scope: Determine the scope of test cases based on the requirements and priorities. Focus on high-priority features or areas of the software that are critical for functionality or have a high risk of failure.
  • Traceability Matrix: Establish traceability between requirements and test cases to ensure that all requirements are adequately covered by test cases.

By addressing these prerequisites, one can ensure that test cases are comprehensive, well-organized, and aligned with the goals of the software development/testing projects.

Process flow

  • Prepare test scenarios based on the project requirements.
  • Writing new test cases or modifications to existing ones based on a standard template.
  • Test case review by the Business/ Approver team (to avoid further correction)
  • Add/ Upload approved test cases to the test management tool using in-build utility.

Best Practices for Building (Standard) Test Case Template

The process of writing test cases can differ based on what exactly is being tested. Sharing test assets between development and testing teams can expedite the software testing process. However, it begins with mastering the skill of crafting test cases effectively and efficiently. Every test case can be following the below steps:

STEP 1: Test Case ID

  • The test case should have an ID. It will be easy to track and maintain, as well as in the case of test case revisions in the future.

STEP 2: Test Case Name

  • A meaningful name in the “Test Case Name” field should be provided and the same should be used as file name when individual excel files are maintained for test cases.

STEP 3: Description

  • This should be a short description of the test case objective.

STEP 4: Module Name

  • Each test case must have at least one module name.

STEP 5: Author Name

  • The test case author cannot be an approver.

STEP 6: Approver Name

  • The name should be Subject Matter Expert (not the same as a test case author).

STEP 7: Prerequisites

  • Any necessary conditions or prerequisites required before executing the test case should be mentioned in this field.

STEP 8: Step Number

  • Check for the correct numbering.
  • For convenience, the number of test steps should not be lengthy hence should not exceed 25-30 steps.
  • If a portion “A” of the process is required before the next portion “B”, they can be separated into two test cases, and test case “A” will be a pre-requisite for test case “B”. Indicate that in the first step of the test case “B”.

STEP 9: Step Details

  • This should be concise, with just enough wording to describe testing actions to the tester.
  • It should be specific and unambiguous to the tester.
  • Pre-requisites should be defined only at the beginning of the test case and not in the middle, end, or at every step.
  • The test case should have at least one screenshot or other objective evidence for the most critical test step(s).
  • In a test case, if a test step calls another test step#, verify that the referred test step # is the correct one. If the test step is deleted or added, make sure to update the referred test step number.
  • While executing the test case, make sure that the tester will not have to go back and forth to complete the test steps. The instructions with similar actions should be grouped together to create a sequence.
  • If a step can be executed out of sequence and is an independent step, add a note to the step instruction.
  • If the existing test cases or steps from previous projects are used, make sure to remove non-applicable steps, as this leads to redundant test case modification defects in UAT.
  • The step details and expected results should have proper traceability when any condition involved in testing and output is based on the selected option or condition.
  • Write clear instructions when a certain activity needs to be performed by the tester to complete a test step. Do not assume these instructions can be taken care of during the test case execution.
  • If the field names, messages, screens, reports, etc. are defined using quotes, there should be a 100% match. If you do not have a 100% match, do not put any wording in quotes. Incorrect wording with quotes will require a test case modification defect.

STEP 10: Step Tester

  • Only one tester role should be mentioned for a single step/ row

STEP 11: Expected Result

  • Define clear criteria for what constitutes a “Passed” test step.
  • The “Expected Result” should describe the behaviour of the system that is expected after accomplishing the “Step Details”. It must be phrased in definitive statements.
  • Ask testers to attach at least one screenshot or file, where appropriate, for the most critical steps.
  • If any master data sheet reference is given in the test case, use the exact file name and location.
  • Make sure there is no “Expected Result” in the content of “Step Details” and no instructions in “Expected Result”.
  • When asking to record the data in the actual result, ensure the user knows exactly what to record.;
  • If a step has more than one expected output and the screenshot only shows some of it, mention it in the Expected Result. This helps later during screenshot verification by the reviewer or an auditor.

STEP 12: Actual Result

  • Captures real-time test results when executed on the software or system under test.

STEP 13: Test Status

  • Provide the final status (pass or fail) of a test case after performing a test.

Test Case Approval and Upload

Test cases undergo a review process to ensure accuracy, completeness, and alignment with the requirements. This review may involve peers, stakeholders, or quality assurance (QA) professionals.

Reviewer’s Responsibility (Business/ Approver)

  • Review the test case in Excel step-by-step with respect to functional and non-functional coverage.
  • Review all the test cases to make sure they cover the objective of the project or change request.
  • Perform a quality review of test cases and provides feedback to the author.
  • Works with the test case Author to finalize test cases after review comments are addressed.

Approval Of Test Cases

  • Once the test cases have been reviewed and verified, they are submitted for approval to the designated authority, such as a QA lead, project manager, or product owner. The approver evaluates the test cases against the acceptance criteria and approves them if they meet the required standards.

Upload To Test Management Tool

  • After approval, the test cases are uploaded to the test management system or tool used by the testing team. This system serves as a central repository for storing, organizing, and managing test cases, test suites, and test execution results.

Test Template Example (To Be Designed)

Test Template

Conclusion

Well-structured test cases are meticulously designed with clear objectives, ensuring they cover all critical aspects of the software or system being tested. These result-oriented test cases are crafted to produce meaningful outcomes that provide actionable insights into the quality and reliability of the software under test. They are designed not just to identify bugs or issues but also to validate that the software meets its intended requirements and performs as expected under various conditions. A structured approach to writing a test case also facilitates clearer communication between stakeholders, enhances the reproducibility of test results, and supports continuous improvement in software quality assurance processes.

At ACL Digital, we follow a holistic approach to quality assurance, combining industry best practices with our domain expertise. Our Test Automation Centre of Excellence offers a complete test automation solution with custom-built automation frameworks. Talk to our consultants to learn about our QA Testing offerings. Reach us at business@acldigital.com

About the Author

ACL Digital

Related Posts