▲ | troupo 6 days ago | ||||||||||||||||
> You can't just test every possible set of rules and object that you want to check, even though this is, of course, all that matters. If it matters, why can't you check? Will your product/app/system not run into these possible sets eventually? > So ultimately we write tests at a lower level to deal with the combinatorial explosion of possible inputs at the edge. Don't you have to write the combinatorial explosion of inputs for the unit tests, too, to test "every possible combination"? If not, and you're only testing a subset, then why not test the whole flow while you're at it? | |||||||||||||||||
▲ | globular-toast 6 days ago | parent [-] | ||||||||||||||||
You can't check because the numbers quickly become astronomical. Can you test the Python parser on all possible Python programs? Even if you limited the length of a program you're still talking about an absurdly large number of possible inputs. What you do is write more primitive components and either unit test them, prove them to be correct or make them small enough to be correct by inspection. An integration test is just testing that the interfaces do indeed fit together, it won't normally be close to testing all possible code paths internally. I think of it like building any other large machine with many inputs. You can't possibly test a car under every conceivable condition. Imagine if someone was like "but wait, did you even test going round a corner at 60mph in the wet with the radio on?!" | |||||||||||||||||
|