Writing Test Cases: Examples, Best Practices & Test Case Templates - Testmo (2024)

Test automation is on everyone's lips these days, which is why you might be wondering if writing manual test cases is still relevant. For many teams the answer is a resoundingYes. While test automation is vital,writing test cases for manual testing is still important for many reasons.

Often times tests are just too complex and expensive to automate – manual testing can sometimes be more efficient and is often leveraged to prevent critical bugs in software from reoccurring. Automation is also still not suited for more creative and empathetic test approaches. And many companies simply don't have the expertise to turn their backs on writing test cases.

That's why manual testing is still a standard approach for software developers and testers, requiring proficiency in writing test cases and a place to manage them. Many companies utilize dedicated test management solutions for this purpose, while smaller teams often take the old-school approach with Excel spreadsheets. Regardless of the tool your team chooses, even the most modern test management app doesn't automatically make you a good test case writer.

So if you're looking to improve your test case writing skills, keep reading to learn from some of our test case examples and from best practices we've learned over time.

Can we send you our next post?

Join thousands of testers & QA managers and receive our original testing content in your inbox.

We will email you occasionally when news about Testmo and testing content is published.You can unsubscribe at any time with a single click.Learn more in ourprivacy policy.

Writing Test Cases: Examples, Best Practices & Test Case Templates - Testmo (1)

Why Writing Good Test Cases Makes a Difference

Before we get into the "how," let's first examinewhyyou should care about writing good test cases in the first place:

  • Good test cases are easier to maintain.Writing test cases takes time. Consequently, if the system under test changes, you don't want to spend too much extra time updating them. Maintaining existing test cases should be as simple as possible – especially if you're not the test case author.
  • Good test cases are versatile.Nobody wants to update the entire test suite for every new feature release. Try to write nonspecific test cases that remain relevant after the system's user interface changes to save time and minimize errors in test cases caused by hasty updates.
  • Good test cases make you flexible.Finally, you can use the time saved in writing and managing test cases for other test methods, such as exploratory testing. This allows you to identify edge cases that need testing and ultimately ensure that your product delivers a great user experience.

Test Case Examples & Templates

Most importantly, a good test case should enable you to do your job as well as possible – regardless of the system under test or your test management solution.

Since many test management tools encourage testers to write overly detailed test cases, our examples should demonstrate that the quality of a test case doesn't depend on the number of fields you fill out. We sadly can't provide you with instructions on how to write the ideal test case foryourspecific scenario, but the examples below follow some of the best practices discussed later in this article.

Suppose we're developing a to-do app and need to test whether the UI correctly displays the results for creating, updating, and deleting to-do lists. Here's what some of these manual test cases could look like:

Title
Create to-do list

Description

  • Navigate to theCreate new to-do listform
  • Fill in all fields with valid test data (see test data in attachment)
  • Submit form

Expected: The newly created to-do list detail page is loaded and shows all the specified data.

Attachment
test_data_new_todo_list.txt

Title
Update to-do list

Description
Context: The user has created a to-do list.

  • Navigate to the to-do list
  • ClickUpdate
  • Fill in all fields with valid test data (see test data in attachment)
  • Submit form

Expected: The updated to-do list detail page is loaded and shows the newly entered data.

Attachment
test_data_update_todo_list.txt

Title
Delete to-do list

Description
Conext: The user has created a to-do list.

  • Navigate to the to-do list
  • Click delete
  • Confirm delete popup

Expected: The to-do list overview page is loaded, and the deleted to-do list is not listed.

Of course, this is not a complete test suite and we can think of various additional test cases for each scenario. However, these are some examples ofnonspecific test cases that are quick to write and easy to maintain.

Let's look at another example. Imagine our to-do app had a bug in the past where the CSV export of a to-do list didn't result in a valid CSV file which caused a lot of issues for users.

We decide to write another test case to ensure that this bug doesn't reoccur with new app versions. In contrast to before, we want it to be more specific and yet as flexible and maintainable as possible:

Title
Verify CSV export RFC 4180 compliancy

Description
Prerequisites: The user has created a to-do list.

  • Navigate to the export page
  • Pick CSV as export file format
  • Submit export form
  • Open CSV file in a text editor

Expected:

  • The CSV file is downloaded to the computer
  • The CSV file is RFC 4180 compliant (see sample CSV in attachment)
  • The file content matches the to-do list data in the app

Attachment
RFC_4180_CSV.csv

Writing Test Cases: Examples, Best Practices & Test Case Templates - Testmo (2)

5 Best Practices for Writing Manual Test Cases

Now, let's look at five best practices for writing test cases we've learned over time. Taking them to heart will help you write better test cases and improve collaboration between testers and developers.

1. Keep it simple and consistent

It's not only aboutwhat you write; it's also abouthow you write it. Using simple language and a specific writing style will help you write tests faster and make them easier for others to understand.

But making sure the entire team's on the same page here can be tricky. We therefore recommend creating and enforcing a style guide for writing manual test cases. This guide could define best practices, writing dos and don'ts, terms and abbreviations to use, the formatting of specific sections, and so on. Check out thisTest Writing Style Guidefrom W3C to get an idea. You ideally define your own style guide based on your team's needs.

2. Start with a good test scenario

Writing good test cases is more straightforward when you have a good test scenario to begin with. And as you can imagine, poorly written test scenarios can negatively impact your test cases for several reasons. Let's look at a quick example!

Badly-scoped test scenario:Check user authentication functionality.

The problem with this scenario is that it doesn't define the test scope well. Should you write test cases for login, registration, and password reset? Suppose your colleague is working on a test scenario, "Verify user password reset," simultaneously. Now you're both writing the same test cases, wasting a lot of time.

Better-scoped test scenarios could be:

  • Verify user login functionality
  • Verify user registration functionality
  • Verify password reset functionality

If you properly scope your test scenarios, it'll be easier to differentiate between tests and work with several testers in parallel.

Writing Test Cases: Examples, Best Practices & Test Case Templates - Testmo (3)

3. Only be as specific as needed

You've probably heard the saying that testing is about being precise. However, test cases that are too specific are often inflexible and difficult to maintain. Hence, we believe thattest cases should only be as detailed as needed. They should adapt to system changes and allow testers a more flexible approach to their work.

Let's demonstrate this with an example. Suppose we have a chat app and are working on checking theUpdate usernamefunctionality. The test case below ensures that the username isn't updated if the input field is left blank:

Title
Check username update with empty username

Description
Prerequisites: Be logged in

  • Open the "Settings" page via the main navigation
  • Open the "My profile" settings page
  • Scroll to the "Update Username" section
  • Don't provide any input to the field "New username"
  • Submit the form by clicking the "Update Username" button

Expected:

  • Get message "Error: Username can't be empty."
  • Username does not update in Profile

Butwhat happens if the UI changes in the future?What if the "Settings" page isn't linked in the main menu, pages and buttons are given a different label, or the "Update Username" section is moved somewhere else? Then we'd have to rewrite all of the steps to make sure they reflect the current state of the system under test. And we'd have to do that for many test cases, which takes a lot of time.

Opting for a more vague approach saves you this trouble:

Title
Check username update with empty username

Description
Prerequisites: Be logged in and be in the profile settings

  • Scroll to update username form
  • Leave username field empty
  • Submit the form

Expected: See an update failure message.

With this version, you wouldn't have to update the test case with every slight change in the UI, but testers can still understand what to do. As a result, you can concentrate on other, more pressing, or creative tests.

4. But know when to be precise

Do testers regularly run into problems with the vague description of a test case and end the test run with an incorrect result? Then you should try writing a more specific test case and see if the testers fare better. Depending on the test case's complexity, it may take a few iterations to find the suitable accuracy.

Test cases for delicate features that work with sensitive data like passwords or credit card information also often call for more preciseness – especially if you've served your users with bugs in these features before.

You may remember theuproar Apple's macOS caused in 2017when anybody could unlock the system with the username 'root' and a blank password. To be sure that this error never happens again, the testers could write a test case that tries to reproduce this exact bug:

Title
Check login with empty password

Description

  • Start macOS
  • Click "other" on Login Screen
  • Enter username (data: root)
  • Enter password (data: empty)
  • Click enter twice

Expected: The login does not work and access is denied.

Not only can writing more accurate test cases help prevent known bugs, but it can also reduce the pressure software teams deal with by worrying less about delivering faulty software.

5. Encourage exploration

When you write down a list of test cases for your scenario, you're likely missing out on a few. Often you'll only recognize a test case when you encounter the corresponding error in your system. To address this, good testers invest time to freely explore features to discover new test cases and issues. Not just that, but exploration also helps you discover a feature through your users' eyes and understand their needs and wants. Ultimately, this approach helps to improve the overall customer experience with your software,making you a more valuable testerfor your company. Again, the key is not to write test cases that are too specific:

  • "Navigate to the profile settings page." Instead of specifying the exact route, we let the tester decide how to get to the destination.
  • "Submit the contact form." A creative tester may have more than one idea of submitting a form – press the submit button, hitEnteron the keyboard, or even click the submit button of another form, etc.

The more you understand the system under test, the better you are at exploring it. In other words, you'll know what to look for and which aspects are more prone to errors. If you have time to explore, make the most of it and be creative.

Writing Test Cases: Examples, Best Practices & Test Case Templates - Testmo (4)

The Key to Writing Good Test Cases

Often times the key to writing good test cases is to know when to be specific and when not to. By following best practices and learning from test case examples, you can improve your test case writing skills and become a more effective tester.

Many effective software testing teams achieve their goals bycombiningmanual test cases with test automation and exploratory testing. Keeping track of the various testing efforts and methods require efficient modern test management – especially if you're currently working with simple Excel sheets that are hard to maintain or if you use an older legacy system.

If that's the case for your team, you might want to consider looking for a dedicatedtest management toolsuch as our app Testmo that you can leverage for your testing strategy – now and in the future. Or review a list of thebest test management toolsto choose a tool for your projects.

But regardless of the tools you use, investing into becoming a better test case author and improving your manual testing skills is time well spent.

Writing Test Cases: Examples, Best Practices & Test Case Templates - Testmo (5)

Start testing with Testmo free

#1 Unified Modern Test Management Software

Start Free Trial

See All Features

PS:We regularly publish original software testing & QA research, including free guides, reports and news. To receive our next postings, you cansubscribe to updates. You can also follow us onTwitterandLinkedin.

Writing Test Cases: Examples, Best Practices & Test Case Templates - Testmo (2024)

FAQs

How to write test case sample template with examples? ›

How to write Test Cases (Test Case Example)
  1. Test Case ID: #BST001.
  2. Test Scenario: To authenticate a successful user login on Gmail.com.
  3. Test Steps: ...
  4. Prerequisites: A registered Gmail ID with a unique username and password.
  5. Browser: Chrome v 86. ...
  6. Test Data: Legitimate username and password.
May 9, 2024

What is a good test case example? ›

For example, if you're developing a login system, a test case might be that an error is displayed if you enter an incorrect email address. Then you may have tests for: Not entering any email address. Adding a space at the end of an email address.

How to create test cases in Testmo? ›

By default, Testmo comes pre-configured with two case templates, namely Case (text) to manage test steps with a simple text field, and Case (steps) to enter steps in separate fields. Optionally you can enable more sub fields per step, to e.g. track the expected result, test data or other information.

How to write test cases for beginners? ›

Let's see the detailed steps for writing test cases.
  1. Step 1 – Test Case ID: ...
  2. Step 2 – Test Case Description: ...
  3. Step 3 – Pre-Conditions: ...
  4. Step 4 – Test Steps: ...
  5. Step 5 – Test Data: ...
  6. Step 6 – Expected Result: ...
  7. Step 7 – Post Condition: ...
  8. Step 8 – Actual Result:

Is writing test cases easy? ›

Writing test cases takes time. Consequently, if the system under test changes, you don't want to spend too much extra time updating them. Maintaining existing test cases should be as simple as possible – especially if you're not the test case author. Good test cases are versatile.

What is a test case in simple words with an example? ›

Test cases define how to test a system, software or an application. A test case is a singular set of actions or instructions for a tester to perform that validates a specific aspect of a product or application functionality. If the test fails, the result might be a software defect that the organization can triage.

What is the difference between test scenarios and test cases? ›

Test cases are more detailed and specific, while test scenarios are less detailed and more general. Additionally, test cases usually include the input values and expected results that should occur when the test is run, while test scenarios typically do not.

How to write test cases faster? ›

What are some tools or techniques that help you write test cases faster and easier?
  1. Use templates and standards.
  2. Use test case management tools.
  3. Use test design techniques.
  4. Use test automation tools. Be the first to add your personal experience.
  5. Use code review tools. ...
  6. Use online resources.
  7. Here's what else to consider.
Mar 29, 2023

What is an example of a positive test case? ›

For instance, consider a login functionality where a user is required to enter a username and password. In this scenario, positive testing would involve verifying that the system allows access with the correct combination of a valid username and password.

What are basic types of test cases? ›

Types of test cases
  • Functionality test cases. ...
  • Performance test cases. ...
  • Unit test cases. ...
  • User interface test cases. ...
  • Security test cases. ...
  • Integration test cases. ...
  • Database test cases. ...
  • Usability test cases.

How do you write a test case template? ›

Follow the below-given steps to write the test cases.
  1. Step 1 – Test Case ID. Each test case should be illustrated by a unique ID. ...
  2. Step 2 – Test Case Description. ...
  3. Step 3 – Pre-Conditions. ...
  4. Step 4 – Test Steps. ...
  5. Step 5 – Test Data. ...
  6. Step 6 – Expected Result. ...
  7. Step 7 – Post Condition. ...
  8. Step 8 – Actual Result.
May 20, 2024

How to practice writing test scenarios? ›

Think Like a User: Put yourself in the shoes of the user. Write scenarios that reflect how real users will interact with the app. Prioritize Important Scenarios: Focus on the most important test scenarios first, especially if you have limited time. These are usually the features that users care about the most.

What is TestMO used for? ›

Testmo test management software is your team's central hub of all QA and testing efforts. Test management is more than just test cases: Testmo fully unifies your test cases, exploratory testing sessions & test automation integration in one single modern platform.

What are the best practices for test case naming? ›

Clearly define the purpose, preconditions, steps, expected outcomes, and post-conditions. Use descriptive names that convey the functionality being tested. Follow a consistent naming convention for easy identification and categorization. Prioritize clarity and conciseness to enhance readability and maintainability.

Top Articles
The Best DnD 5e Artificer Races
Amazon Product Manager Salary | $190K-$778K+ | Levels.fyi
Cpmc Mission Bernal Campus & Orthopedic Institute Photos
Forozdz
Asist Liberty
No Hard Feelings Showtimes Near Metropolitan Fiesta 5 Theatre
Ncaaf Reference
litter - tłumaczenie słowa – słownik angielsko-polski Ling.pl
Newgate Honda
Nier Automata Chapter Select Unlock
Lonadine
Bjork & Zhulkie Funeral Home Obituaries
Springfield Mo Craiglist
“In my day, you were butch or you were femme”
Lax Arrivals Volaris
Sand Castle Parents Guide
Navy Female Prt Standards 30 34
Salem Oregon Costco Gas Prices
Teacup Yorkie For Sale Up To $400 In South Carolina
Kashchey Vodka
Craigslist Wilkes Barre Pa Pets
Ltg Speech Copy Paste
Watson 853 White Oval
Wonder Film Wiki
Pioneer Library Overdrive
*!Good Night (2024) 𝙵ull𝙼ovie Downl𝚘ad Fr𝚎e 1080𝚙, 720𝚙, 480𝚙 H𝙳 HI𝙽DI Dub𝚋ed Fil𝙼yz𝚒lla Isaidub
Ice Dodo Unblocked 76
Obsidian Guard's Skullsplitter
How Do Netspend Cards Work?
Armor Crushing Weapon Crossword Clue
Ridge Culver Wegmans Pharmacy
Donald Trump Assassination Gold Coin JD Vance USA Flag President FIGHT CIA FBI • $11.73
Ripsi Terzian Instagram
Bozjan Platinum Coins
Composite Function Calculator + Online Solver With Free Steps
Whas Golf Card
Chase Bank Cerca De Mí
Great Clips On Alameda
A Man Called Otto Showtimes Near Amc Muncie 12
Pitchfork's Top 200 of the 2010s: 50-1 (clips)
Hannibal Mo Craigslist Pets
Boone County Sheriff 700 Report
Nina Flowers
Sarahbustani Boobs
Free Crossword Puzzles | BestCrosswords.com
Craigslist Com St Cloud Mn
Comanche Or Crow Crossword Clue
705 Us 74 Bus Rockingham Nc
Swsnj Warehousing Inc
Tropical Smoothie Address
Meee Ruh
Automatic Vehicle Accident Detection and Messageing System – IJERT
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 5461

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.