Skip to main content
Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

Plan Your Test Case

Learning Objectives

After completing this unit, you’ll be able to:

  • Define a test case.
  • Explain the purpose of a test case.
  • Identify key considerations when planning a test case.

What Is a Test Case?

A test case is a set of instructions that outlines steps to verify whether an application’s features or functionality work as expected. Test cases are designed to align with specific application requirements and ensure the desired outcomes.

The type of testing you perform informs the test case you write. For example, during regression testing, you might write a test case to verify that creating a new contact works as expected. Even if you’ve tested this functionality before, you need to confirm that this key feature is still working.

By carefully planning test cases, your team can create an organized, systematic approach to testing, ensuring maximum coverage and quality.

What to Test

The decision of what to test isn’t one to make in isolation. Your testing should align with your business objectives, so collaborate with the business team to understand their requirements for end users. Otherwise, you risk wasting your efforts testing unrealistic scenarios that have little to no impact on the user experience. Once you have alignment with business requirements, ask yourself these key questions to guide your planning.

Question

Explanation

Which application am I testing?

Focus on applications that directly impact your users.

Am I testing a happy path or a negative path?

Test for both expected workflows (happy paths) and edge cases (negative paths) for more comprehensive coverage.

Am I testing in the UI or with an API?

Use API testing for fast data validation and manipulation, but when evaluating the end user experience, UI testing is essential.

For example, if you and your business team identify creating a new contact as a high-priority requirement, your test case might focus on testing in Sales Cloud via the UI using a happy path. This approach ensures the feature meets end users’ expectations.

However, if you want to verify all the information for the Contact fields, you still test in Sales Cloud but this time via an API. Because you’re validating data, using an API is the faster, better approach.

Limiting the scope of your test case is critical. You can’t do everything with one test case. Focus on one feature or functionality, clearly define its expected behavior, and stick to that.

Narrowing your scope helps not only with writing the test case but also with executing it and interpreting its results. The fewer variables you have to sift through when a bug appears, the easier it is to identify the cause of it.

Where to Test

Once you know what needs to be tested, decide where you need to test. This raises a few more questions to consider.

Question

Explanation

Which environment am I testing in?

Test in sandbox environments before deploying changes into production. If bugs are found, they can be resolved before they reach the end user.

Which browser am I testing in?

Test in the browsers your end users commonly use.

Which operating system am I testing in?

Test in the operating systems your end users have.

How to Test

The final consideration is how to conduct the test as it relates to your end users. Different users have different permission sets, so make sure your test case accounts for all relevant roles. Include each affected persona to increase confidence in the feature you’re validating.

With a thoughtful, structured approach to planning your test case, you can achieve efficient and impactful testing. In the next unit, you learn about writing, developing, and maintaining your test cases.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback