Loading
PHP 취약성 모니터링 현황에 대해더 많이 읽기

Apex Code Coverage: Avoid Meaningless Test Statements to Inflate Coverage Ratio

게시 일자: Oct 5, 2026
상세 설명

Apex code coverage measures the percentage of your org's Apex code that is executed by test methods. This article explains why intentionally inflating that percentage with meaningless statements is discouraged, and what Salesforce may require if it's found in your org.

솔루션

Why Meaningless Test Statements Are a Problem

In Apex code development, we don't recommend increasing your org's code coverage ratio by intentionally creating Apex classes or methods containing meaningless, redundant statements — for example, unnecessary variable assignments or repeated calculations that aren't actually used by your application.

If code deployed to production skips a test that should have been run, these meaningless statements can cause unintended behavior or issues. They also skew the true upper limit of Apex characters used in your org, since the code technically counts toward your character limit without providing real test value.

What Salesforce May Ask For

When Salesforce reviews your org's Apex character upper limit, we look at the details behind that number. If meaningless statements are found inflating your code coverage, Salesforce may ask you to modify the Apex code to remove them.

Knowledge 기사 번호

000382195

 
로드 중
Salesforce Help | Article