function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
srinu jsrinu j 

I have three class A,B and C with test code coverages are 60%,90% and 75% respectively. When I want to deploy these three classes together, How many classes will be deployed? Hi friends this interview question, please help me?

Sumit Kumar Singh 9Sumit Kumar Singh 9
I think all 3 should get deployed, because the avg is 75%.
Maharajan CMaharajan C
Hi srinu,

I think B & C should get deployed because we need a minimum 75% code coverage to deploy the classes in Production.

Thanks.
Raj
(Sweet Potato Tec)
Amit Chaudhary 8Amit Chaudhary 8
Hi srinu j,

Its depend on total number of line in all 3 classes. Its doesnt means that if one class have 100% code coverage then that class will deploy in production. Over all code coverage should be more then 75%.

If you have over all code coverage is more then 75% and one class have 60% code coverage then also that class will deploy in production.

Please check below post how salesforce is calcuating the overall code coverage.
1) https://developer.salesforce.com/blogs/developer-relations/2012/11/how-code-coverage-works.html
2) http://help.salesforce.com/HTViewSolution?id=000199478

Please let us know if this will help you

 
Vijay NagarathinamVijay Nagarathinam
Hi Srinu,

I think the three classes should be deployed to production if the org average code coverage is above 75%, If the org avg code coverage is less than 75% that time the three classes not deployed to production.

Thanks,
Vijay