I just thinking about the reason behind the @isTest liking, as it is admired by compiler or for some other reasons Salesforce does.


As per developer Guide The testMethod keyword is now deprecated. Use the @isTest annotation on classes and methods instead. The @isTest annotation on methods is equivalent to the testMethod keyword'. NOTE: testMethod doesn't have any impact on the count of apex character limit like it's mentioned in the other post the only thing here is that testMethod is now deprecated and @isTest the new one which we all should prefer going forward. I've tested this by removing testmethod code and there was no change in the character count of apex.

Refer below link:


  • Any class annotated @isTest does not count towards the character limit at all, which is why no change to the total count occurs. – sfdcfox May 19 '20 at 13:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.