Salesforce Tests for Org

0 votes
Is it necessary for each APEX class to have its own test class?

Currently dealing with tests in an organisation where 80% of APEX tests are contained under a single test class, which does not appear to be the ideal approach.
Mar 14 in SalesForce by surbhi
• 3,810 points
21 views

1 answer to this question.

0 votes
Yes, I believe that having all of the organization's tests in a single class is not a good idea. Some of the disadvantages that I perceive are:

Large classes enhance dependency, which means that several developers are more likely to work on the same class, increasing complexity.
It's more difficult to properly "scope" your tests when all the test methods are included in one large class. It is easier to understand what is being tested and to extend the class coherently when an independent class has test methods for a specific class.

Because only one method per class can be marked with the @testSetup annotation (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex testing testsetup using.htm), you can make greater use of the @testSetup annotation by using distinct classes.
These are some of the reasons (among many others) why you should separate your test methods into classes.
answered Mar 15 by CoolCoder
• 4,360 points

Related Questions In SalesForce

0 votes
0 answers

How to take test.salesforce.com while deployment as salesforce login url for api connection logic app?

In logic app i'm using salesforce connector after deployment ...READ MORE

Mar 1 in SalesForce by surbhi
• 3,810 points
90 views
0 votes
1 answer

How to take test.salesforce.com while deployment as salesforce login url for api connection logic app?

you are not passing the parameterValues, use ...READ MORE

answered Mar 2 in SalesForce by surbhi
• 3,810 points
63 views
0 votes
0 answers

How to Write the Test class for Salesforce Apex Aura Enabled class?

stuck in here to write a test ...READ MORE

Mar 15 in SalesForce by surbhi
• 3,810 points
29 views
0 votes
1 answer

Can we create a record for Event object through lwc in Salesforce?

You can check list of supported obejcts ...READ MORE

answered Apr 5 in SalesForce by CoolCoder
• 4,360 points
61 views
+2 votes
2 answers

Salesforce Interview questions

Here are some questions very important for ...READ MORE

answered Jan 11, 2019 in Career Counselling by Suresh
• 720 points
1,829 views
0 votes
1 answer

How to connect to salesforce from tableau?

Hi, follow these steps to connect to Salesforce: 1. ...READ MORE

answered Mar 25, 2019 in Tableau by Cherukuri
• 33,010 points
287 views
0 votes
1 answer

Power BI - Salesforce

Hi, Follow below steps: 1. Go to Data source. 2. ...READ MORE

answered Mar 25, 2019 in Power BI by Cherukuri
• 33,010 points
173 views
0 votes
1 answer

What is the best training for Salesforce ADM-201 Exam?

Hi @Vardhan, I took Edureka's Salesforce Training that covers all ...READ MORE

answered Jun 3, 2021 in Others by Jaya
• 140 points

edited Dec 22, 2021 by Soumya 202 views
0 votes
1 answer

How can we create salesforce developer account for salesforce essentials?

Developer.salesforce.com is where you can sign up ...READ MORE

answered Mar 3 in SalesForce by CoolCoder
• 4,360 points
63 views
0 votes
1 answer

How to take test.salesforce.com while deployment as salesforce login url for api connection logic app?

You are not passing the parameterValues, use ...READ MORE

answered Mar 9 in SalesForce by CoolCoder
• 4,360 points
117 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP