How to Write Your First Test Case

One of the difficulties in writing your first test case is that it’s hard to know where to start. Writing test cases is not that difficult if you understand who you’re writing for and what you’re hoping to achieve.

How to write a test case

How to write a test case

What’s the purpose of a test case?

The purpose of a test case is to:

Describe how you plan to verify (i.e. prove) that the software agrees with the specifications.

That’s it.

The next step is to demonstrate that you’ve done this correctly and haven’t modified the findings or changed the result data.

Ideally, when you finish writing the test case, you can give it to someone else, e.g. tester or developer, and they can do the testing with the test case you wrote.

Writing your first test case

Here’s how to keep you test cases practical and effective:

  1. Test Case Description – Identify the information necessary to verify the functional requirements.
  2. Requirement Traceability – Cross-reference to the number in the specification (SRS) document.
  3. Purpose – Describe the software features that will be tested; the behavior being verified, for instance, when you click A, B occurs.
  4. Procedure – Describe how to perform the test. Keep the text simple and make sure the reader doesn’t ‘interpret’ what you’ve written. For example, “Click the Save button on the menu to save the document.”).
  5. Test Data – Include the exact input data that will be provided and the output for each case. Include any manual calculations necessary to determine the outputs.

Formatting your test case

You can use either Microsoft Word or Excel. I suggest that you use tables to structure the data and make it easier to read.

  • Represent test data in tabular form
  • Create one column for input items and
  • Create one column for expected outputs

If the input data is held in an external file, identify the file name and its location.

What else would you add?

Download these templates to start

Acceptance Test Plan

Contingency Plan

Software Development Templates

Acquisition Plan

Conversion Plan

Software Requirements Specification

Action Plan

Cost Benefit Analysis

Software Testing

API Documentation

Database Design

Standard Operating Procedures (SOP)

Audience Analysis

Datasheet

Statement of Work

Availability Plan

Deployment Plan

System Administration Guide

Bill of Materials

Design Document

System Boundary

Business Case

Disaster Recovery Plan

System Design Document

Business Continuity

Disposition Plan

System Specifications

Business Plan

Documentation Plan

Technical Writing Templates

Business Process

Employee Handbook

Test Plan

Business Requirements

Error Message Guide

Training Plan

Business Rules

Expression of Interest

Transition Plan

Capacity Plan

Fact Sheet

Troubleshooting Guide

Case Study

Feasibility Study

Use Case

Change Management Plan

Functional Requirements

User Guide

Communication Plan

Grant Proposal

Verification and Validation Plan

Concept of Operations

Implementation Plan

White Papers

Concept Proposal

Installation Plan

Work Instructions

Configuration Management Plan

Interface Control Document

Software Development Templates

Acceptance Test Plan

Maintenance Plan

Software Requirements Specification

Acquisition Plan

Market Research

Software Testing

Action Plan

Marketing Plan

Standard Operating Procedures (SOP)

API Documentation

Needs Statement

Statement of Work

Audience Analysis

Operations Guide

System Administration Guide

Availability Plan

Policy Manual

System Boundary

Bill of Materials

Project Plan

System Design Document

Business Case

Proposal Manager Templates

System Specifications

Business Continuity

Proposal Template

Technical Writing Templates

Business Plan

Quality Assurance Plan

Test Plan

Business Process

Release Notes

Training Plan

Business Requirements

Request for Proposal

Transition Plan

Business Rules

Risk Management Plan

Troubleshooting Guide

Capacity Plan

Scope of Work

Use Case

Case Study

Security Plan

User Guide

Change Management Plan

Service Level Agreement (SLA)

Verification and Validation Plan

Communication Plan

Setup Guide

White Papers

Concept of Operations

Social Media Policy

Work Instructions

Concept Proposal

Contingency Plan

 

Configuration Management Plan

Conversion Plan