A building code is a set of rules set to govern a a building's design, construction, testing, inspections, and maintenance to protect public health, safety and welfare. Building codes are adopted and enforced by the government, who may inspect buildings to make sure they follow the rules.