how-to-write-test-cases-in-manual-testing

10 Tips On How To Write Test Cases In Manual Testing

Writing effective test cases is a fundamental skill for any manual tester. Well-crafted test cases ensure the software functions as it should and is a detailed guide for consistently and accurately conducting testing.

In this post, we'll cover 10 essential tips for writing clear, concise, and comprehensive test cases in manual testing, with plenty of examples to illustrate best practices.

We can help you drive manual testing as a key initiative aligned to your business goals

Contact us

What makes a good test case?

Before jumping into the tips, let's define what constitutes a good test case. A high-quality test case should be:

  • Clear and concise: The steps and expectations should be simple and easy to understand.
  • Comprehensive: The test case should cover all relevant functional and non-functional scenarios.
  • Traceable: Each test case should map directly to a specific requirement.
  • Reusable: A good test case should be applicable in different scenarios or testing cycles.
  • Maintainable: It should be easy to update when requirements or features change.

writing-good-test-case

With these characteristics in mind, let's review tips for writing test cases.

10 tips for writing effective test cases manually

1. Understand the requirements thoroughly

The most fundamental step in creating good test cases is understanding the requirements inside and out. Without a comprehensive grasp of what the software is supposed to do, you may miss key scenarios or misunderstand what needs to be tested.

For example, consider a requirement for a hotel booking system: "The user should be able to book a hotel room by selecting check-in and check-out dates."
Think about every possible scenario:

  • What happens if the check-in date is past?
  • What if the check-out date is before the check-in date?
  • How should the system behave if the selected dates are during a public holiday?

Breaking down such requirements and listing potential cases helps identify both positive and negative test scenarios.

2. Use a structured and consistent format

Using a structured format is crucial for ensuring clarity and consistency. The format should include a unique ID, title, preconditions, steps, expected result, and actual result. This structure makes it easy for others to execute the test case and understand what's being tested.

Here's a structured example for a banking application:

test-case-example

3. Write clear and descriptive titles

Each test case title should be descriptive enough to convey the purpose of the test without needing to read through the entire case. Doing so makes the test case easier to locate and also provides a quick overview of what it covers.
Compare the following:

  • Generic Title: "Test Account Management"
  • Descriptive Title: "Verify That an Account Can Be Created, Updated, and Deleted Successfully"

If you look at this example of an e-commerce system – Verify Adding Multiple Products to Cart with Different Quantities –  this title clearly specifies the feature under test, making it easier for someone reviewing the test suite to understand its intent at a glance.

4. Include preconditions and post-conditions

Defining preconditions and postconditions ensures that the test environment is correctly set up before the test and that the system is stable afterward.
For example, in a social media application, consider the test case:

preconditions-and-post-conditions

Preconditions help establish the state required for the test, while post-conditions ensure that the system behaves as expected once the test is executed.

5. Focus on one objective per test case

Each test case should have a single focus. Combining multiple objectives into one test case can make it harder to pinpoint the source of a failure.
For instance, in a content management system (CMS):
Instead of: Verify Article Creation, Approval, and Publishing in a Single Test Case, break it into:

  1. Verify That a New Article Can Be Created with Valid Inputs.
  2. Verify That an Article Can Be Approved by an Admin User.
  3. Verify That an Approved Article Can Be Published on the Website.

Having separate test cases for each step makes debugging easier and improves traceability.

6. Use meaningful test data

Meaningful test data is crucial for effective test execution. Real-world examples should be used whenever possible to make the test data relevant, aiding in understanding how the software will behave under realistic conditions.
For a payment gateway system:

  • Valid Test Data: Credit card number 4111 1111 1111 1111, expiry date 12/24, and CVV 123.
  • Invalid Test Data: Credit card number 1234 5678 9101 1121, expiry date 00/00, and CVV abc.

Using a variety of test data (valid, invalid, boundary, special characters) will ensure you catch edge cases and data-specific bugs.

7. Prioritize test cases based on risk and importance

If you have a large number of test cases, prioritize them based on the criticality of the feature and the impact of potential failures. This approach allows you to focus on the most crucial areas first.
For example, in an online food delivery system:

  • High Priority: Placing an order and making a payment.
  • Medium Priority: Viewing restaurant details.
  • Low Priority: Changing profile picture.

This way, you can manage time effectively and ensure that the core functionalities are thoroughly tested.

8. Cover both positive and negative scenarios

While focusing on positive test scenarios is natural, negative scenarios are just as important. They test how the software handles invalid inputs, unexpected user actions, and errors.
For example, in an employee management system:

  • Positive Test Case: Verify that a new employee can be added with valid inputs.
  • Negative Test Case: Verify that the system displays an error message if the employee's age is less than 18.

Covering negative scenarios ensures your application can handle incorrect data and prevent security vulnerabilities.

9. Utilize boundary value analysis and equivalence partitioning

For fields that accept a range of values, use boundary value analysis and equivalence partitioning to test edge cases and representative values.

Consider a discount coupon system:
If a coupon is valid for orders between $10 and $100, test with:

  • Boundary Values: $9.99, $10, $100, and $100.01.
  • Equivalence Partitions: $15 (valid) and $5 (invalid).

This approach ensures that the system correctly handles inputs at the boundaries of the valid range.

10. Regularly review and update test cases

As software evolves, test cases must be updated to reflect changes in requirements, new features, and enhancements because outdated test cases can lead to false positives or negatives.
For instance, if a new feature is added to track patient vaccination records in a healthcare management system, update relevant test cases to include this feature.
Conducting periodic reviews of your test suite helps maintain relevance and effectiveness.

Conclusion

Creating effective test cases is a blend of technical expertise and thoughtful analysis. Thus, if you understand requirements, use a structured format, include clear objectives, and leverage various testing techniques, you can write test cases that are easy to follow, thorough, and provide maximum coverage.

How can Global App Testing help you with test cases?

At Global App Testing, we understand that well-defined test cases are essential for a seamless and efficient testing process. However, creating or formatting test cases can be time-consuming, especially when there are specific requirements to follow. That's why we offer tailored services to help you get started with high-quality test cases, whether you need them created from scratch or adapted to fit the right format.

gat-test-case

Get started right away with test cases built for you

If you don't already have test cases in the required format, don't worry. We offer flexible solutions to ensure your testing process begins smoothly. Our services range from converting your existing test cases to building fresh ones entirely. Either way, we'll ensure you're ready to go in just a few days.

Here's how we can help:

5-Oct-04-2024-09-03-21-0993-PM

1. Build test cases from scratch

Don't have test cases yet? No problem! We can create them for you from scratch, ensuring they align perfectly with your testing needs and platform. You can expect your test cases to be ready within 3-5 days, so you'll be prepared to launch testing quickly and efficiently.
This is an ideal option if you're starting from the ground up or need help ensuring your test cases are comprehensive and properly structured for maximum effectiveness.

2. Adapt existing test cases

If you already have test cases that are not in the format required for our platform, we can adapt them for you. We take your existing test cases, rewrite them as needed, and ensure they fit seamlessly into our system – all at a reduced cost compared to starting from scratch.
This service is perfect for those who already have a solid foundation of test cases but need to modify them for compatibility with platforms such as TestRail, Zephyr Squad, or GitHub.

3. Build test cases for specific integrations

We also provide support for test cases that are compatible with popular platforms like TestRail, Zephyr Squad, and GitHub. Our expert team can create test cases directly within these platforms' formats, enabling you to launch tests immediately with a few clicks.

  • TestRail: We'll build test cases ready to use with TestRail integration, allowing for seamless management and execution.
  • Zephyr Squad: Have a Zephyr setup? We can create or format test cases in a way that's optimized for Zephyr Squad, enabling you to kick off testing straight from the platform.
  • GitHub: Need test cases that sync with your GitHub repository? No problem – our team can deliver cases that integrate smoothly with GitHub for express testing.

gat-integrations

At Global App Testing, our goal is to simplify your testing efforts, whether you're building new test cases or adapting existing ones. Ready to get started? Schedule a call today to request a test case creation service, or talk to us to learn more about how we can assist with your testing process.

We can help you drive manual testing as a key initiative aligned to your business goals

Contact us

Keep learning

9 Types of Manual Testing You Need To Know About
How to Implement Smoke Testing In Production? [Guide]
6 Best Test Reporting Tools Worth Considering