Split Logic

Definition:

  • When the test logic is split into several test objects and their specific assertions

Code Example:

public class AddToCartTests {
    @Test
    public void testAddToCart() {
        // Test adding product to cart
    }

    @Test
    public void testCartIsEmptyAfterCheckout() {
        // Checkout process
        // Assert that cart is empty
    }
}

public class CheckoutTests {
    @Test
    public void testCheckout() {
        // Checkout process
    }
}

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring