You need to sign in to do that
Don't have an account?
Lars Cade
Insufficient Code Coverage
I am taking my first timid steps into Apex development and have run up against a problem. Even though all the apex classes being used so far are managed or from the SalesForce App Exchange, I get an error saying I have 23% code coverage when trying to deploy. How can I determine where the fault may lie or run something to improve the situation?
Please use developer console to find out the actuall code coverage of all the classes in your org.
Please contact me in-case you need help on this.
Thanks,
Gaurav
Email: gauravgarg.nmims@gmail.com
Skype: gaurav62990
There might be some classes which might not be covered completely or atleast 75% (Requirement for deploying to the production).
If you run the all the test classes to test the custom apex classes in developer console you can check that in "Tests" tab and on the right hand side you can see the code coverage of the different classes. (Different IDEs have different way to check the code coverage)
There might be possibility that the test class you have written is not checking every condition in the apex class so you might need to modify the test class.
The ideal test class is always to check all the possible conditions of error handling not just to have code coverage.
Thank you
yes, you can write test classes for Trigger also.
Thanks,
Gaurav
For example: your trigger does something whent the custome field is updated. So create a dummy test account in test class and then update the date field in that and check whether the trigger is running as expected.
This is general idea about the test class.
You have to write the test class for almost everything you do as custom(class, trigger etc).
Reference link : https://developer.salesforce.com/page/An_Introduction_to_Apex_Code_Test_Methods
As far I have knowledge. Manage package can only be registered with salesforce when they have enough code coverage (75%) to deploy on someone's else org. Hence, contacting Manage Package support team would might not provide any help. We need to dig into your org and find out the classes / triggers which are causing this issue.
Thanks,
Gaurav