Esc
Variable Type Validation
Definition
Ensuring that a variable has the correct type.
How it Works
A developer should consider how the variable will be used throughout the program and choose the correct variable type. A developer should programmatically check if a variable has the correct (expected) type before using that variable.
Considerations
- The result of an operation on an unexpected variable type will vary based on the language.
- Note: This resource should not be considered a definitive or exhaustive coding guideline.
Artifact Relationships:
This defensive technique is related to specific artifacts. Click the artifact node for more information.
References
All
External Knowledge Base
The following references were used to develop the Variable Type Validation knowledge-base article.
(Note: the consideration of references does not imply specific functionality exists in an offering.)
Why type checking?
Reference Type: External Knowledge Base Organization: Princeton University