
Ask HN: Is there a legislative equivalent to unit tests - ilovetux
Taking a look at the similarities between drafting legislation and computer programming, it strikes me as odd that legislation seems to have no corresponding notion to unit tests or integration tests.<p>The closest I can see (from a laypersons view) would be case law as one could theoretically look back at old decisions and determine if the same decisions would be made under new legislation, but that&#x27;s not how it works. It&#x27;s way more nuanced and case law actually sets legal precedents.<p>Is there a more direct corollary between unit testing and legislation?
======
smt88
Some legal changes are piloted and studied, like the various basic income
studies. It doesn't make sense for all types of laws, though.

~~~
ilovetux
Right, and you make a good point that it does not make sense for all types of
law.

I think that these studies are a good thing and I would never want to
discourage anything of the sort, but what is missing is a way to ensure
consistency of test coverage. What I mean is that one study might record a
particular measurement but a subsequent study may ignore that measurement all-
together.

Maybe what I'm thinking about exists in the form of discussions on sites like
law.stackexchange.com or as articles in legal journals read by the experts.

