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
sridhar sridharsridhar sridhar 

Some classes in PRODUCTION have 0 % code coverage

HI all, 
Request you to give a detaild explanation... if possible provide any snippet code. thanks 

i am keep on hitting while deploying classes into production  Organigaion code coverage is 45%. 
I noticed that some classes and triggers have 0% code coverage. 

1.How it could be possible to deploy a calss having 0% code coverage??. 
2. there is no test classes for few classes.. How it could be possible? 
3. for few classes have hidden code... how to sort out managed packes code coverage problem??
4. unmanaged packages have test classes and methods  in the apex class?? ... does it creating 0% code coverage issue to the classes?? 
 
Best Answer chosen by sridhar sridhar
sfdcsushilsfdcsushil
For deploying to production, overall code coverage(including all classes) should be greater than 75%. Individual classes may have 0% coverage.  All triggers must have at least 1% covered. Managed package code coverage does not count as its in separate namespace. Unmanaged packages, i believe they work similar to your regular code. Make sure you run local tests while deploying. 

All Answers

sfdcsushilsfdcsushil
For deploying to production, overall code coverage(including all classes) should be greater than 75%. Individual classes may have 0% coverage.  All triggers must have at least 1% covered. Managed package code coverage does not count as its in separate namespace. Unmanaged packages, i believe they work similar to your regular code. Make sure you run local tests while deploying. 
This was selected as the best answer
Amit Chaudhary 8Amit Chaudhary 8
Please check below app Exchange product to get code coverage of each classes
1) https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000DXzlpEAD

Let us know if this will help you
 
Ian Blanchard 4Ian Blanchard 4

I am hoping you can help me. We just downloaded an unnamed package of an org we are to continue development on, it had more than 75% coverage to be able to make the unmanaged package. Yet once I had it downloaded and ran the test I have 0% test coverage.. Any suggestions would be greatly appreciated.
Ian Blanchard 4Ian Blanchard 4
I have no idea why this was sent under Ian's name but my name is Daniel Cadwell  https://trailhead.salesforce.com/me/daniel-cadwell
I am hoping you can help me. We just downloaded an unnamed package of an org we are to continue development on, it had more than 75% coverage to be able to make the unmanaged package. Yet once I had it downloaded and ran the test I have 0% test coverage.. Any suggestions would be greatly appreciated.