Skip to main content
Arrange/Act/Assert

Also known as

Given/When/Then

Intent

Arrange/Act/Assert (AAA) is a pattern for organizing unit tests. It breaks tests down into three clear and distinct steps:

  1. Arrange: Perform the setup and initialization required for the test.
  2. Act: Take action(s) required for the test.
  3. Assert: Verify the outcome(s) of the test.

iluwatarAbout 2 minTestingIdiomTesting
Callback

Intent

Callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time.

Also known as

  • Event-Subscription
  • Listener

Explanation

Real world example


iluwatarAbout 2 minFunctionalAsynchronousDecouplingIdiomReactive
Combinator

Also known as

  • Function Composition
  • Functional Combinator

Intent

The Combinator pattern is intended to enable complex functionalities by combining simple functions into more complex ones. It aims to achieve modularization and reusability by breaking down a task into simpler, interchangeable components that can be composed in various ways.


iluwatarAbout 3 minFunctionalIdiomReactive
CRTP

Also known as

  • Recursive Type Bound
  • Recursive Generic
  • Static Polymorphism
  • Mixin Inheritance

Intent

Curiously Recurring Template Pattern (CRTP) is used to achieve a form of static polymorphism by having a class template derive from a template instantiation of its own class, allowing method overriding and polymorphic behavior at compile time rather than at runtime.


iluwatarAbout 3 minStructuralExtensibilityIdiomInstantiation