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
Rachel Linder 8Rachel Linder 8 

Will Changing a Test Class in Production affect Production Environment (cause errors)

I need to make some changes to some test classes that I didn't create.

Before I make those changes can you let me know the following:
  1. I am assuming I need to make these changes in our sandbox and then deploy to production. Is this correct?
  2. If I make these changes will it disrupt anything we currently have running in production? Or are these strictly used when testing during deployment of things such as triggers?
I need to avoid having any issues arise in the production environment.

I sincerely appreciate the help.
Best Answer chosen by Rachel Linder 8
Luigi FranciosiLuigi Franciosi
1. Correct
2. When you deploy new code (classes, triggers etc) you can choose which test classes to run on deployment. You can select specific test classes, run all tests, or default. These are only ran during deployment. Test classes don't get invoked when your actual 'business' logic etc classes are ran. 

All Answers

Luigi FranciosiLuigi Franciosi
1. Correct
2. When you deploy new code (classes, triggers etc) you can choose which test classes to run on deployment. You can select specific test classes, run all tests, or default. These are only ran during deployment. Test classes don't get invoked when your actual 'business' logic etc classes are ran. 
This was selected as the best answer
Rachel Linder 8Rachel Linder 8
Thank you. I will make my updates in Sandbox today and push those to production tonight. Then tomorrow I will push the new trigger over.