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

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?



Best Answer chosen by Admin (Salesforce Developers) 
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.