In C++ Macros - As noted you can remove the code entirely - You can also use a macro that resolves to a different value For code - Add a flag. - Add a class that manages flags Larger apps would use the second. Your code then tests the flag. There are various ways the flags can be set: command line, config file, database. There are various ways to manage the class itself. Could be static or use a builder pattern. Example of flag usage
if (myFlagClass.IsSet("TestFlag131")) ....
For systems (not just an app) can use special values in an API. The code of the target service looks for those special values and returns a fixed, or even variable, result. This is somewhat useful in verifying end to end enterprise functionality.