+ Start a Discussion
RaviKumarRaviKumar 

Consider we have overall 90% code coverage however there is one class which have 0% code coverage. Can we still able to deploy that class on production?

Q)Consider we have overall 90% code coverage however there is one class which have 0% code coverage. Can we still able to deploy that class on production?
A)Some one giving answer that, Yes. Minimum 1% required for every trigger and there is no such restriction for Apex class.

I have found the above question & Answer in one Blog.My doubt is
------>
Is this answer Correct? If yes, In SFDC Documentation they provided that : "
1.At least 75% of your Apex code must be covered by unit tests, and all of those tests must complete successfully.
2.All classes and triggers must compile successfully.
"
What's exactly does it mean...............................................................?

Will Any One Suggest that could take me out with clarity in this issue..
Thanks in Advance..

 
Best Answer chosen by RaviKumar
BalajiRanganathanBalajiRanganathan
The answer to the question is 'yes'. The 75% provided by salesforce is for overall coverage in your org.  when ever you deploy any code to production, all the unit test cases written in the org will be executed and code coverage is caluclated for all the classes. the overall coverage in the org should be greater than 75%  and each trigger should have atleast 1% code coverage otherwise you will not able to deploy the code to produciton. 

when deploying code to production, you will not able to deploy it if it has any compilation issue.

All Answers

BalajiRanganathanBalajiRanganathan
The answer to the question is 'yes'. The 75% provided by salesforce is for overall coverage in your org.  when ever you deploy any code to production, all the unit test cases written in the org will be executed and code coverage is caluclated for all the classes. the overall coverage in the org should be greater than 75%  and each trigger should have atleast 1% code coverage otherwise you will not able to deploy the code to produciton. 

when deploying code to production, you will not able to deploy it if it has any compilation issue.
This was selected as the best answer
NK@BITNK@BIT
Yes, Overall code coverage should be more than 75% and should all test class pass the test.
RaviKumarRaviKumar
Thank you for your reply Mr.BalajiRanganathan  and Mr.NK@BIT

@BalajiRanganathan "It means that A class may have 0%, a class may have 40% and another has 80%. What finally satisfied is when we deploy all classes together should have 75% code coverrage.
Individual may have 75% or 0% or 55% it doesn't matter
.
No need of that each and every class should have 75% code coverage"

Am i reaching your point Mr.BalajiRanganathan.

Thanks Once agiain.

 
BalajiRanganathanBalajiRanganathan
Yes you got it.