Exit Point

Description:
Result (verifiable externally) obtained by executing a unit of code.
Types (RED):
- Return value. (Easiest to verify).
- Effect, change of state
- Dependency, call to external. (Hardest to verify)
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






