Alonso Del Arte
1 min readAug 23, 2022

--

If you had used this as your headline, this article would get fewer clicks. Likewise with a headline like "100% unit test coverage is generally unrealistic".

Salesforce Apex requires 75% passing test coverage for classes and one line for triggers. But in a group project for a training program I actually got 100% coverage for one trigger. I followed best practices for triggers and I used TDD. Then again I have not passed any Salesforce certification exams.

With testing after the fact, testing becomes a pointless chore that is forgotten under the pressure of a deadline, if it's not required like with Salesforce Apex (as far as I know there's no similar requirement for Salesforce Lightning Web Components).

Unit testing can feel kind of like a joke with Spring Boot, a Java framework. You write all those mutable classes with their getters and setters automatically generated by the integrated development environment, and a few classes that have next to nothing besides some cryptic annotations.

But with properly immutable classes, 100% test coverage is usually a more worthwhile goal, in my opinion.

--

--

Alonso Del Arte
Alonso Del Arte

Written by Alonso Del Arte

is a Java and Scala developer from Detroit, Michigan. AWS Cloud Practitioner Foundational certified

No responses yet