This question is motivated by a ton of prior questions of the form: When can I use [insert statistical technique]? In "contract programming", one cannot call a function without satisfying its preconditions. Is there an analog to this in a library of statistical functions where the necessary preconditions for a function are automatically verified prior to making the call? Or where I am obliged to manually assert that these preconditions hold (so that I am, at least, reminded of what they are) before I can call a function?
And if not, why not?