Unit testing versus system testing
When it comes to testing Apex code, we know the drill: write good tests to cover your code, assert its behavior, and obtain at least 75% coverage. The Salesforce Platform will not allow you to deploy or package code for a production environment unless you obtain this amount of code coverage or higher. You also must cover your Apex Trigger code, even if it’s only a single line, as you will soon see is the case with the implementation of the Apex Triggers in this book.
It is not just for sake of good practice that Salesforce requires 75% coverage; Salesforce runs all Apex tests uploaded to the platform as part of its internal platform regression testing strategy. They look for the difference in test results (regardless of if your test passes or fails) between the current production version of the platform and the upcoming release. This way, Salesforce can find and fix regressions in the platform before even rolling out the platform...