Evolve Or

Definition:

  • Tests that are not maintained after SUT code evolution and still pass

Code Example:

public class TransactionTest {
  @Test
  public void shouldRecognizeTransactionsWithZeroValueAsInvalid() {
    //given
    Transaction tx = new Transaction(BigDecimal.ZERO,
    new InternalUser());
    //when
    boolean actual = tx.validate();
    //then
    assertThat(actual).isFalse();
  }

  @Test
  public void shouldRecognizeTransactionWithNegativeValueAsInvalid() {
    //given
    Transaction tx = new Transaction(BigDecimal.ONE.negate(),
    new InternalUser());
    //when
    boolean actual = tx.validate();
    //then
    assertThat(actual).isFalse();
  }
}

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring