Today we build the software rule of a battery charging station. A charger may charge only when the battery voltage is between 12000 and 14500 mV and the battery is not hotter than 45 °C. We write that rule as a function, test it on its edges, and build the controller from small functions.
Ask: why does a charger need such a rule? (overcharge, a hot battery can catch fire).