Input validation as a metric for quality

You want DbC checking enabled in development/integration versions of the software only (not in production versions). E.g. compiled programming languages with built-in support implement this with conditional “injection” of the DbC logic during compile time. “By throwing a compiler switch, Contracts code can be enabled or can be withdrawn from the compiled code.” (D’s Contract Programming vs C++'s). C++17 supports DbC as well (Support for contract based programming in C++). I don’t know if it is implemented in C++ compilers already and how. (If the language does not have built-in support the “manual” conditional “injection” of DbC logic is a potential source for errors. This applies on the ROS level as well.)

1 Like