For Alex TDD & Mutation Testing Lens

Types Are Not Bureaucracy — They Are Data Geometry

In dynamic TDD, half your tests are written to guard against nulls, missing keys, and invalid combinations. A modern type system eliminates whole classes of mutants at compile time, freeing TDD to focus 100% on domain behavior.

number
string
boolean
literal / sum
null / empty
Click any fruit or branch node to inspect its structural contract.
Root: CommentThread (Record) 42 id: number author: User "Alex" name: string isMod: bool status (Sum ⋁) "published" "draft" null replies: Tree[] 🔄 Recursive Child Node
🌿

Select a node above to inspect its structural contract

Interactive
Type Anatomy (Compile-time shape) Contract
type CommentThread = {
  id: number;
  author: {
    name: string;
    isMod: boolean;
  };
  status: "published" | "draft" | null;
  replies: CommentThread[]; // Recursive!
};
Runtime Reality (Concrete Value Plucked) Instance
{
  id: 42,
  author: {
    name: "Alex",
    isMod: true
  },
  status: "published",
  replies: [ /* recursive children */ ]
}

Key insight: The type tree defines the possibility space (the geometry). A runtime object is just one specific harvest hanging from the tree's valid branches.