| ▲ | skissane a day ago | |
I don’t think that’s right. Unit tests check whether a specific code module is implemented correctly given its (implicit) specification. Good “laws” are independent of the structure of the code. Tests may be a useful source for inferring what the laws are, but much of the actual content of the tests aren’t “laws” at all. | ||
| ▲ | serf a day ago | parent | next [-] | |
I think the premise is more that if one is given a grouping/constellation of unit tests that one can derive generalized laws by looking at what behavior those tests were checking for or against. if there are a dozen unit tests trying to determine if some regex can escape a sensitive area, then one can derive a generalized 'don't let the regex escape from here' type rule -- or at least you could theoretically. I'm sure in reality that'd be a big minefield much like harness self-skill-writing has been. | ||
| ▲ | schlich 17 hours ago | parent | prev [-] | |
you might be interested in property-based testing, which somewhat enumerates tests based on invariance and induction | ||