Skip to main content

Command Palette

Search for a command to run...

Exit Point

Published
1 min readView as Markdown
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