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
okaylah52okaylah52 

When migrating an Apex class, should its test class be migrated too?

Please pardon this newbie question and provide the link if this has been answered before

 

I develop an Apex class X. I write another Apex class Y as a test class of X. When I migrate X to production, do I have to migrate Y too?

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
srisomsrisom
Yes.  When migrating to production, all of the tests are run and the coverage needs to satisfy the 75%.  If the test is not there already then you need to migrate it.