In this article, I am going to talk about Data. As we all know data is most important component of a successful business. Salesforce is doing lot of investment and innovation to help business to improve data quality and data representation. We have been hearing this phrase “Garbage In then Garbage Out”. As an architect we have been helping our client to ensure we are not adding garbage data in CRM. We use different rules, validations, data cleansing etc… to ensure we have good data in Salesforce.
Today, I am going to discuss a tool that helps us generate data that can be considered as garbage in real-life, but these data are going to help project delivery by reducing development time and deliverable quality. Today, this tool is being used across industry on CRM and non-CRM projects. I would be talking primarily in context of CRM
I am going to explain value of this tool using a real-life challenge during Salesforce engagements and how this tool (or similar tool) is going to help us address this challenge.
CRM Engagement Challenge
There are hundreds of challenges in delivering a successful CRM system and I am going to discuss just one of that. A typical Salesforce CRM project uses different types of Sandboxes (Developer, Pro, Partial Copy, Full) and most of the development activity happens in one or other developer or developer-pro sandboxes.
When we create a Developer or Developer-Pro sandbox, Salesforce copies the metadata from production environment, but it does not copy any transactional data like Lead, Account, Contact, Cases etc… There could be other scenario where this is new engagement and we do not have any data in Salesforce production.
In both the scenarios we get a Salesforce Developer Instance with no transactional data. Developers are supposed to do all development in this sandbox and perform proper unit testing before deploying changes to QA environment. Most of the cases we use partial copy or full copy sandbox for QA activities. If this is an existing project and for existing module, we normally get test data available in QA environment but if this is new engagement or new module we need some data in QA environment also.
Most of the time we plan for data preparation in QA environment for our QA engineers, but we ignore data requirements for doing development and unit testing. I have witnessed this in small size as well as large projects where lot of efforts are done in data preparation for QA but nothing for developer unit testing.
Lack of proper data in development environment brings lot of challenges. I am listing few that I see in most of the engagements.
- No proper unit testing in development environment and it results in large number of issues during QA
- Multiple iterations of fixes before it is closed as developer fix the issue but do not find proper data to unit test
- Breaking SDLC practice and developer starts fixing issue directly in QA environment and then they retrofit the fixes in development environment. This results in completely unmanaged QA environment and results severe production issues
- Some of the engagement I have seen development of reports and dashboards officially happens in QA environment as it requires base data to see if reports and charts are rendering properly. This is another example of poor environment management
Development Environment Data Preparation Responsibility
Well, it depends on lot of factors but at high level this should be responsibility of Engagement Architect & Development Lead. More importantly this request should come from developers who are not able to do proper unit testing because of data unavailability. Here, we are not talking about millions of records as developer org would be having storage limitation. We need few hundreds, or few thousands records with good sampling to ensure it helps doing good unit testing.
Technical Architect & Business Analyst should work together to identify the need of data for doing proper unit testing and they need to ensure they speak to project leaders and ensure that efforts are allocated accordingly.
mockaroo & Data Loader Solution
Here comes product like “mockaroo“. We have few other products but mockaroo is one that I have been using in most of the engagement. We can use free tier for our development environment as it supports 1000 rows per file. For QA environment where we may plan to do more exhaustive testing including performance testing, we can upgrade accordingly. If we do cost to value analysis it is worth putting little investment.
Let’s understand data generation and importing the data in Salesforce with one simple use case.
Use Case
We are working on Salesforce Sales Cloud project where we are extensively using Lead & Activity Management. We have Assignment Rules, Automations, Reports and Dashboards and we need good sample data to perform proper unit testing. We have Industry & Status on Lead Object and Status & Priority on Task objects. We would like to generate few hundred records to ensure our developers perform proper unit testing before they deploy the changes to test environment and they do not have to use QA environment for unit testing and developing reports and dashboards.
Salesforce Data Loader & mockaroo as a solution
We are going to use mockaroo as a product to generate sample data for us and once the data is generated, we can use Salesforce Data Loader to import the data in Salesforce. Below are the steps we are going to do for this: –
- Create External Id field on Lead and Task. If you already have an external id field, then that can be used to data import and associate task with lead.
- Use mockaroo to generate data for Lead Object
- Use custom list for Industry, Status and any other picklist fields as you needed for your use cases
- Use a sequence type to generate external id for Lead data
- Use the screenshot as reference
- Use mockaroo to generate data for Task Object
- Use custom list for Status, priority and any other picklist fields
- Use a sequence type to generate external id for Task data
- Use custom list and use Lead External Id for Lead Id field
- Use the screenshot as reference
- Use Salesforce Data Loader to import Lead data
- Use Salesforce Data Loader to import Task data. Use Lead External Id to associate Task with Lead
Lead Data mockaroo configuration & preview
Task Data mockaroo configuration & preview
Conclusion
Well, we can see how mockaroo can help us in setting up a development environment that can be used by Salesforce development team to develop and do proper unit testing. As I mentioned earlier, there are several other products that can help you generate data for development and testing. I used mockaroo as I have been using this for quite a long time and it has been meeting most of my data generation requirements.