I can only imagine that would be a humungous task. And presumably the existence of case law makes it much harder still.
It would be quite interesting to think about what the legal equivalent of unit tests would look like. Presumably a large collections of sets of circumstances and desired legal outcomes. It seems to me that this might be an interesting output of legislatures in addition to statutes (although whether they would/should be controlled by the legisalture or judiciary is also quite an interesting question, as our existing system seems to rely quite heavily on the judiciary being able reinterpret laws in ways the original legislators most likely didn't intend)