All the cool Salesforce kids are using flows these days. As a result, it’s not as popular to write apex code anymore.
However, there are moments in which flows aren’t the best choice. Apex classes can fill in those gaps and can perform some really heavy lifting.
After the apex class is written, Salesforce forces us to write a test class for it. The minimum coverage required is 75%. That means when the test class runs, 75% of the apex class must be executed. (note: why this requirement exists will be discussed in another email).
For now, the important thing to remember is that 75% isn’t enough. In the future, if you change something in the class, it’s good to have a buffer so you don’t need to also update the test class. It’s like barely staying afloat in a swimming pool and someone is pouring buckets of water on your head.
The takeaway
A “good enough” test coverage is 85%. This allows apex classes to be somewhat future-proofed. Anything more and you’re just showing off 🙂