Bugs?! Where do they come from?
summary
Claim: many bugs stem from overusing primitive types and missing domain invariants. Demonstrations use C#/.NET custom structs and classes — custom value types like Price, PercentageDiscount, Rating and ID — with explicit conversions and operator overloads to encode invariants so the compiler prevents swapping values and removes repeated runtime guards. Integration with ASP.NET model binding replaces duplicated checks, unit tests stay small, and the codebase shrinks. Empirical note: large apps rarely need more than ~100 such types. compiler-enforced invariants and ASP.NET model binding make it work.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:07What are bugs
- 5:25Constraint checking
- 11:51Checking problems
- 13:38Types and values
- 16:55Custom types
- 21:36ID types
- 26:59DRY principle
- 32:39Type obsession
- 37:35Reducing bugs
related talks
49mFixing the Billion Dollar Mistake
30mStrings are Evil: Methods to hide the use of primitive types
50mCracking the Code to Secure Software
28mTesting Isn't Enough: Fighting Bugs with Hacks
51m82 Bugs I Collected in a Year You Won’t Believe Made It to Production
42m82 Bugs I Collected in a Year You Won’t Believe Made It to Production
50m#BugsZero
45mProperty based tests for the masses
