Smart Unit Tests - a mental model
Dec 11, 2014Pratap Lakshman

Summary
This post introduces the mental model and technical details behind 'Smart Unit Tests' (renamed to 'IntelliTest'). It explains the core mechanism of runtime instrumentation, monitoring, and constraint solving to generate unit tests. The process involves instrumenting code, running it with simple inputs, monitoring execution and coverage, identifying uncovered branches, constructing constraint systems for those branches, querying a constraint solver for new inputs, and emitting test cases only when coverage increases. It also highlights the role of assertions in bug detection.