Skip to main content

Command Palette

Search for a command to run...

Exit Point

Updated
1 min read
Exit Point

Description:

Result (verifiable externally) obtained by executing a unit of code.

Types (RED):

let currentValue = 0;

function additionWithLogging(summand: number, logger: ILogger): number {
  /** Exit point 1 => external dependency call (D) */
  logger.log(`Will add: ${currentValue} + ${summand}`);
  /** Exit point 2 => effect, change of state (E) */
  currentValue += summand;

  /** Exit point 3 => return value (R) */
  return currentValue;
}

Every unit of code has exit point(s).

Only one exit point is verified per unit test

🇨🇴 Versión en Español

Unit Testing

Part 15 of 19

Unit tests are a tireless guard that overwatch your software to ensure it always behaves as it's expected. In this series I'll introduce to you its basic concepts.

Up next

- Body -

Of a unit of code