Testing is the key to successful long term development and is a critical component of the development process. And testing is key to the success of application particularly if application to be deployed to customers.
If we validate that application works as expected, that there are no unexpected behaviors, then application will run for longtime.
There are two ways of testing an application.
Check out the top Salesforce Interview Questions now!
→ 75 % of apex code must be covered by unit tests. All of those tests must complete successfully. → When deploying to a production organization we need to have 75% of apex code covered by tests.
Note: Our focus should not be on the percentage of code that is covered instead we make sure that every use of application is covered including positive and negative cases, as well as bulk and single record. This should lead to 75% or more of code being covered by unit test.
Salesforce.com recommends the following components need to test.
1. Single Records:
This includes testing to verify that a single record produces the correct, expected result
2. Bulk Records:-
Any apex code, whether a triggers, a class or on extension may be used for 1 to 200 records we must test not only the single record case, but the bulk cases as well.
3. Positive scenarios:-
This type of component testing expect a system to save a record without error.
4. Negative scenarios:-
This type of component testing expect a system to give error.
5. Restricted User:-
Test whether a user with restricted access to the objects used in code sees the expected behavior, i.e whether they can run the code or receive error messages.
For indepth understanding of Salesforce click on
You liked the article?
Like : 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.
Get stories of change makers and innovators from the startup ecosystem in your inbox