Reader small image

You're reading from  Salesforce for Beginners - Second Edition

Product typeBook
Published inOct 2022
PublisherPackt
ISBN-139781803239101
Edition2nd Edition
Concepts
Right arrow
Authors (2):
Sharif Shaalan
Sharif Shaalan
author image
Sharif Shaalan

Sharif Shaalan was first introduced to Salesforce as an end user in 2007. His range of experience, from a sales rep to technical architect, helped him successfully lead more than 100 implementations including projects that were showcased on the main stage at Dreamforce. In 2013, Sharif was chosen as a Salesforce MVP, and in 2020 he was inducted into the Salesforce MVP Hall of Fame. Sharif is a regular speaker at Salesforce conferences and has obtained more than 10 Salesforce certifications. He is the founder and CEO of Agile Cloud Consulting and continues to be an active Salesforce community contributor
Read more about Sharif Shaalan

Timothy Royer
Timothy Royer
author image
Timothy Royer

Timothy Royer is the VP of Delivery at Agile Cloud Consulting and a Salesforce Certified Application Architect. Timothy began his Salesforce career in 2012 as an accidental administrator and has since participated in a number of implementations in a variety of roles. Timothy has experience as a Salesforce customer, a Salesforce partner, and as a member of the Salesforce.org professional services team.
Read more about Timothy Royer

View More author details
Right arrow

Testing and Debugging

Some of the most important activities as a Salesforce professional will be testing and debugging. Setting up your testing plan will depend on the types of environments you set up for the path to production. These environments will be a combination of one or more sandboxes and your final production Salesforce instance. Once the path to production is defined, there are several stages of testing.

In this chapter, we will cover the following topics in detail:

  • Understanding the path to production
  • Setting up the path to production
  • Understanding testing types
  • Using debug logs

With the help of these topics, you will be able to set up your Salesforce sandbox strategy and create a testing plan for your deployments.

This chapter starts to broach more advanced topics related to code development. If you’re new to Salesforce administration, some of these areas may be daunting to you right now. For the scope of this...

Technical requirements

For this chapter, make sure you log in to your development org and follow along as we work through the different testing and debugging features available to a system administrator.

Understanding the path to production

The path to production is the strategy for how new features and bug fixes are delivered to your live production Salesforce org. There are different scenarios that require different strategies, including:

  • New Salesforce implementations
  • Smaller enhancement projects
  • Bug fixes

In this chapter, we will cover the new Salesforce implementation scenario.

Business use case

You are the Salesforce admin for XYZ Widgets. XYZ Widgets has been using a legacy system and has decided to move to Salesforce. You are tasked with setting up the environment strategy.

Setting up the path to production

As a best practice, you will set up the following strategy for your implementation. This strategy includes different types of sandboxes and how to use each one in the process of getting code and functionality to production:

Diagram  Description automatically generated

Figure 20.1: The path to production

  1. The developer sandboxes are used for building...

Understanding testing types

Now that we have a defined path to production, let’s look at the different types of testing. There are generally five types of testing that will be conducted:

  • Unit testing
  • System testing
  • UAT testing
  • Production testing
  • Regression testing

Unit testing

Unit tests verify whether a particular piece of code is working properly. This type of testing is done by developers as they build code. Salesforce requires 75% code coverage. Code coverage indicates how many executable lines of code in your classes and triggers have been exercised by test methods. This is important in that code can be developed in sandboxes and tested by users without unit tests. To push that code to production, the unit tests must be written and covered.

Not all implementations include code, and this type of testing is needed only when there is code being written.

System testing

This testing takes place in the SIT sandbox...

Using debug logs

As an admin, when a user reports an issue, you try to recreate it and resolve it. At times, you are unable to figure out why the issue has occurred, so you need to take a look under the hood. Salesforce offers a feature to view debug logs. The debug log contains information about each transaction, such as whether it was successful and how long it took. Depending on the filters set by your trace flags, the log can contain varying levels of detail about the transaction.

Business use case

Sam, the sales rep, has reported an issue when creating an account. When you, as the administrator, try to recreate the issue, you are unsuccessful. You will set up a debug log to get a deeper understanding of what is happening.

Creating a debug log

Let’s create a debug log for Sam. We will start on the Setup page as shown in Figure 20.2:

Figure 20.2: Navigating to debug logs

On this page, we will take the following steps:

  1. Click on Setup...

Summary

In this chapter, we understood what the path to production is and how to set it up for different scenarios. We explored the different types of testing and how they relate to the path to production and various sandbox types. Finally, we discovered how debug logs can help us further investigate issues reported by users.

With this final chapter, we have completed this book and tried to cover as many use cases and examples as possible. I hope that this encourages you to continue your journey with Salesforce, and experiment with more use cases using your development organization and Trailhead.

Questions

  1. What does SIT stand for?
  2. What does UAT stand for?
  3. What type of sandbox works well for data migration?
  4. What type of testing is done in the SIT sandbox?
  5. What type of testing is done by developers?
  6. How does a debug log help troubleshoot?

Further reading

Join our community on Discord

Join our community’s Discord space for discussions with the authors and other readers: https://packt.link/rlptF

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Salesforce for Beginners - Second Edition
Published in: Oct 2022Publisher: PacktISBN-13: 9781803239101
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Sharif Shaalan

Sharif Shaalan was first introduced to Salesforce as an end user in 2007. His range of experience, from a sales rep to technical architect, helped him successfully lead more than 100 implementations including projects that were showcased on the main stage at Dreamforce. In 2013, Sharif was chosen as a Salesforce MVP, and in 2020 he was inducted into the Salesforce MVP Hall of Fame. Sharif is a regular speaker at Salesforce conferences and has obtained more than 10 Salesforce certifications. He is the founder and CEO of Agile Cloud Consulting and continues to be an active Salesforce community contributor
Read more about Sharif Shaalan

author image
Timothy Royer

Timothy Royer is the VP of Delivery at Agile Cloud Consulting and a Salesforce Certified Application Architect. Timothy began his Salesforce career in 2012 as an accidental administrator and has since participated in a number of implementations in a variety of roles. Timothy has experience as a Salesforce customer, a Salesforce partner, and as a member of the Salesforce.org professional services team.
Read more about Timothy Royer