Understanding the importance of testing
Through the years that I have been working in Salesforce, I have too often encountered the following scenarios:
- Developer receives problem
- Developer writes code
- Developer tests through the user interface (UI)
- They then declare the work as finished and hand it over to the testing team or customer for review
- Developer writes test methods to achieve 75% code coverage
- And then, developer deploys the code
The fact that the developer has declared the work as finished before the testing is complete is incorrect and should be discouraged as a practice. As a general rule, code without tests is not finished. A more correct order here would be the following:
- Developer receives problem
- Developer writes code
- Developer writes test methods to achieve at least 95% code coverage
- Developer tests through the UI
- They then declare the work as finished and hand it over to the testing team or customer for review...