Back to Top

Test Class | Test Apex Related Interview Questions

Posted on TimeMarch 6, 2026


Why we test-> To save time, to become better at our craft, and to build better software.


Why we create test data-> Naturally, the data in your production org changes over time and will be different from the data in your developer environment. 

When your tests run, either in a developer environment or in production, they have access only to the data in that org. 

So if you write tests using existing data, you can end up with deployment problems, because the data available in one environment isn’t always available in another environment.


->  Test.startTest() and Test.stopTest() => Any code between those two calls executes with a refreshed set of governor limits.


Create data-> 3 methods-> TestFactory class, @TestSetup & csv file.


0comments

Post a Comment