Ask HN: Is there a legislative equivalent to unit tests

1 points by ilovetux ↗ HN
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.

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's not how it works. It's way more nuanced and case law actually sets legal precedents.

Is there a more direct corollary between unit testing and legislation?

2 comments

[ 1.6 ms ] story [ 15.8 ms ] thread
Some legal changes are piloted and studied, like the various basic income studies. It doesn't make sense for all types of laws, though.
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.