Loading
Slack製品の問い合わせ先はSalesforce Helpへ統合・変更されます続きを読む
PHPの脆弱性に関する監視状況について 続きを読む
メールアドレスがデフォルトのログイン方式となります 続きを読む
Scalability
ApexGuru Test Case Antipattern: Writing Filler Statements

ApexGuru Test Case Antipattern: Writing Filler Statements

Using meaningless code to inflate test coverage undermines code quality. Filler statements cause technical debt, missed bugs, and false code confidence. Focus on quality over quantity. Write meaningful tests for actual business logic and use coverage as a guide, not the goal.

Scope

Detection only

Detection Example

public class CodeCoverageInflationExample1 {
   public static void CodeCoverageInflation1() {

      //Filler code
      String str1 = 'Placeholder ';
      String str2 = 'Code';
      String result = str1 + str2;
      assertEquals('Placeholder Code', result);

      integer j = 0;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;
      j++;

   }	
}
 
読み込み中
Salesforce Help | Article