Type Checking is the process or tool of verifying that operations on values are valid according to their types.

  • It ensures that types are used correctly
  • It is a process / tool that validates or verifies types
  • It is different from Typing (typing is a property of code or a programming language)
  • It is also different from Runtime Validation (e.g., Pydantic), which checks data correctness, not code correctness

Type checking can happen:

  1. At compile time (before runtime or code execution) → Static Type Checking
  2. During runtime → Dynamic Type Checking

Static / Dynamic Type Checking / Runtime Validation

All three protect systems at different failure points:

MechanismWhat it catchesWhat it missesWhat it provides
Static type checkingTypos, wrong attributes, wrong types in codeReal runtime dataCode-level safety
Runtime validationInvalid external dataCode bugs (typos, logic)Data-level safety
Dynamic type checkingInvalid operations at runtimeSilent logical/data bugsRuntime execution safety