Salesforce: should Test.loadData be used?

There is an option to load data for test from Static Resource in CSV format

List<sObject> ls = Test.loadData(Account.sObjectType, 'myResource');

Some people consider this as a best way to overcome a problem of permanent test failures on production because of ‘some client guy has manually added a new validation rule on production or added a new required field without running all unit tests’. Those people believe that it would be easier to teach config team members to load new static resources with all required fields instead of getting back to developers to fix unit tests.

However, we still don’t use it since in my humble opinion it sounds like shooting  a mosquito with a cannon.

I wonder what is your opinion on this?

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s