- SalesforceChaCha
- Posts
- 💃 Harden Your Salesforce Solutions🕺
💃 Harden Your Salesforce Solutions🕺
The positives about negative
Good morning, Salesforce Nerds! Are you looking for a simple technique to reinforce your Salesforce designs and builds?
Are you ready to harden your Salesforce solutions!

WHAT IS IT?
What is Negative Testing?
Harden your Salesforce solutions with Negative Testing.
Negative testing involves deliberately entering invalid, unexpected, or random data into the system to ensure it handles errors gracefully 🦢.
Unlike positive testing, which verifies that the system functions correctly under normal conditions, negative testing is all about testing the system’s resilience and error-handling capabilities.
You ever watch baseball and always see the guy who is catching the ball being backed up by a player who ran wayyyy outta their way to back them up? 9 times out of 10, that backup guy ran all that way for nothing, but the rare cases the ball doesn’t hit it’s target…this is exactly why they practice backing up.
Let’s take that same concept to Salesforce.
If you create a “Number of Pets” field in your org, you may fill it out with a “3” as a test.
But what happens if you enter “-3” ?
What do you expect to happen? 🤔
What do you want to happen? 🤔🤔
Not every customer is going to fill out that lead form like you expect them to. And you need to consider what may go wrong, and then how you want the “wrong” managed 🙌.
WHY SHOULD YOU CARE?
Why Should You Care About Negative Testing?
Here are 3 reasons you should care about negative testing-
🧹 Data Integrity - Clean data, the unicorn for all CRMs, has an ally in negative testing 🤝.
🧑💻 User Experience - When a user does a negative thing, it’s a good experience to get receive a systematic response “You have done this thing. This is why it’s wrong. Try this, instead 🙂.”
💪 Harden Your Solution - Negative testing makes you think of exceptional inputs, and unknown or unexpected outputs. This is a kind of stress test on your solution that will bring it one step closer to invincible 🦸♂️!
HOW DO YOU GET IT?
How to Negative Test
Developers, this is preaching to the choir! As engineers of autonomous solutions, you learned early and often that negative testing is a requirement in your development process.
For the rest of you mortals, consider this -
When you create that permission set, you login as an excluded user to validate you cannot do the thing that the permission set allows.
Congrats, that’s negative testing 🎉!
Take this same practice into all of your solutioning process. Do what’s not supposed to be done (but that you know customers and users will do 💯!)
Great Salesforce professionals are never surprised by outputs in Production, because they’ve negative tested it to death ☠️.
MORE EXAMPLES
More Negative Test Examples
➖ If you are building a solution to upload .png files, then negative tests should include .jpegs, .pdfs, .xls, and other common data files.
➖ If you have a formula field to create user names with first initial + last name, then perhaps you want a filter for Sarah Lutz and Fred King.
➖ If you have a popup form to make record changes, then have two users each make a change, but then stagger the saving of the record change.
➖ If you have a form with a birthdate field, then enter a date in the future.
➖ If you have a popup form to make record changes, then have two users each make a change, but then stagger the saving of the record change.
➖ If you have an open text “State” field, then enter “Nevada”. Create another record and enter “NV.”
SOUL FOOD
Today’s Principle
"The people you most want to impress can see right through you." - Naval Ravikant
and now....Your Salesforce Memes



What did you think about today's newsletter? |