D3-VTV

Harden
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 relates to specific digital artifacts.

hardens
Variable Type Validation
Pointer Dereferencing Function

References

Reference - Type Systems