Rotten Green Test

Definition:

  • A test that passes (is green) but contains assertions that are never executed

Code Example:

@Test
public void testListWindowsNewBucket() throws Exception {
  . . .
  BucketLeapArray leapArray = new BucketLeapArray(sampleCount,
          intervalInMs);
  . . . .
  List<WindowWrap<MetricBucket>> list = leapArray.list();
  for (WindowWrap<MetricBucket> wrap : list) {
    assertTrue(windowWraps.contains(wrap));
  }
  . . . .
}

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring