You have to make sure your test cases exercise every possible code path. German demogroup .theprodukkt made a demo one time, .kkreiger, a first-person shooter game in 96kb. They used a technique like this to strip every line of source code that was not hit during a playtest. But the playtester didn't press the up-arrow in the main menu, so that doesn't work. More importantly they didn't get hit by any bullets, so in the final release the player is invulnerable because the code that handles damage was never compiled.
Edit: more informative link https://fgiesen.wordpress.com/2012/04/08/metaprogramming-for...