3 ms·
assuming you are asking about sql select statements, the problem is knowing what the correct answer is so you can test against it. for most data, you don't, and
by zabzonk 4y ago
assuming you are asking about sql select statements, the problem is knowing what the correct answer is so you can test against it. for most data, you don't, and probably cannot know this.
not a unique problem with sql, btw.
- RobinL 4y agoYou can know what the answer is against a small test dataset though. Obviously the challenge is ensuring it's representative, that you hit the edge cases of real data etc. But it's better than nothing
- zabzonk 4y agoi have never worked with a small dataset. mocking one doesn't work, for the reasons you suggest, and others. basically you cannot test queries against a big database. you just have to hope for the best.
- taeric 4y agoJust, what? This sounds terrible. Why can't you run a test query against a large dataset? If need be, anonymize your data set into an integ environment, and go nuts. Could there be a data combination that surprises you someday? Certainly. Most queries, though, are much much simpler than that and can, in fact, be tested.