Quick question: is it enough to create guards/checks in languages like Ruby or Javascript to make sure that a parameter that is passed in is the type you expect? I try to set default values in the method/function declarations to at least return an empty set if I can live with it. Only time I have had a dynamic language do weird things is with PHP, but that was due to my lack of understanding of how PHP handles empty…
One problem with runtime checks is that they of course only work at runtime but you also must manually assert against them. A bulk of your test suite now exists just to execute runtime paths through your code to trigger your guards at all. Then your tests often have to duplicate the very assertions that you already specified in your guards. Another problem is that your runtime guards are often ad-hoc and can drift fr…
You do bring up a good point with testing (which I don't always do, but I try to at least do runtime checks).
I follow you on the data model part. I think that's where a test framework is super handy.