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
Marty DorrenMarty Dorren 

Raising average code coverage

Hello,
I'm trying to deploy to production and getting the dreaded "code coverage is 74%, needs to be 75%" error.  No matter what I try, I can't seem to get that 1%.  When I look at some of my lower percentage triggers to tighten them up, I get this analysis from the developer console:
code coverage analysis
My test seems to be blue for the beginning of many of my conditional statements, but not for the subsequent action. (as seen in red).  I been told that if I can get my percentage challenged code to test better and deploy them, that my average code coverage will get better.

I've tried deploying code that I know tested at 100% and it still won't let it deploy.  In Eclipse, I even tried to delete classes that I knew were not needed and it STILL wouldn't let me get through that average code error.  If I could get some idea how to test and cover the above code, I may have a shot.  Any advise would be appreciated.  Thanks,

Marty
JeffreyStevensJeffreyStevens
If you put a debug statement just before your IF statement - displaying the values of newIP.Status__c, and tdy, and IP_Monthly_Sched_Education_MC and newIP.RecordTypeId - I'm pretty sure you will see why the first line after  your IF statment is not getting executed during your tests. 

Remember you'll need to create test data in your tests, that satisify your condition, so the lines inside of the condition will execute. 

 
Himanshu ParasharHimanshu Parashar
HI Marty,

can you post full tirgger. nobody can have an idea with these lines without knowing context of trigger such as object on which this trigger is working, is it before or after trigger etc.

Thanks,
Himanshu