{"title":"RATest:用小例子解释错误的关系查询。","authors":"Zhengjie Miao, Sudeepa Roy, Jun Yang","doi":"10.1145/3299869.3320236","DOIUrl":null,"url":null,"abstract":"<p><p>We present a system called RATEST, designed to help debug relational queries against reference queries and test database instances. In many applications, e.g., classroom learning and regression testing, we test the correctness of a user query <i>Q</i> by evaluating it over a test database instance <i>D</i> and comparing its result with that of evaluating a reference (correct) query <i>Q</i> <sub>0</sub> over <i>D</i>. If <i>Q</i>(<i>D</i>) differs from <i>Q</i> <sub>0</sub>(<i>D</i>), the user knows <i>Q</i> is incorrect. However, <i>D</i> can be large (often by design), which makes debugging <i>Q</i> difficult. The key idea behind RATEST is to show the user a much smaller database instance <i>D</i>' ⊆ <i>D</i>, which we call a <i>counterexample,</i> such that <i>Q</i>(<i>D</i>') <i>≠ Q</i> <sub>0</sub>(<i>D</i>'). RATEST builds on data provenance and constraint solving, and employs a suite of techniques to support, at interactive speed, complex queries involving differences and group-by aggregation. We demonstrate an application of RATEST in learning: it has been used successfully by a large undergraduate database course in a university to help students with a relational algebra assignment.</p>","PeriodicalId":87344,"journal":{"name":"Proceedings. ACM-SIGMOD International Conference on Management of Data","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2019-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1145/3299869.3320236","citationCount":"5","resultStr":"{\"title\":\"RATest: Explaining Wrong Relational Queries Using Small Examples.\",\"authors\":\"Zhengjie Miao, Sudeepa Roy, Jun Yang\",\"doi\":\"10.1145/3299869.3320236\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<p><p>We present a system called RATEST, designed to help debug relational queries against reference queries and test database instances. In many applications, e.g., classroom learning and regression testing, we test the correctness of a user query <i>Q</i> by evaluating it over a test database instance <i>D</i> and comparing its result with that of evaluating a reference (correct) query <i>Q</i> <sub>0</sub> over <i>D</i>. If <i>Q</i>(<i>D</i>) differs from <i>Q</i> <sub>0</sub>(<i>D</i>), the user knows <i>Q</i> is incorrect. However, <i>D</i> can be large (often by design), which makes debugging <i>Q</i> difficult. The key idea behind RATEST is to show the user a much smaller database instance <i>D</i>' ⊆ <i>D</i>, which we call a <i>counterexample,</i> such that <i>Q</i>(<i>D</i>') <i>≠ Q</i> <sub>0</sub>(<i>D</i>'). RATEST builds on data provenance and constraint solving, and employs a suite of techniques to support, at interactive speed, complex queries involving differences and group-by aggregation. We demonstrate an application of RATEST in learning: it has been used successfully by a large undergraduate database course in a university to help students with a relational algebra assignment.</p>\",\"PeriodicalId\":87344,\"journal\":{\"name\":\"Proceedings. ACM-SIGMOD International Conference on Management of Data\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2019-06-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://sci-hub-pdf.com/10.1145/3299869.3320236\",\"citationCount\":\"5\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings. ACM-SIGMOD International Conference on Management of Data\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3299869.3320236\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings. ACM-SIGMOD International Conference on Management of Data","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3299869.3320236","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
RATest: Explaining Wrong Relational Queries Using Small Examples.
We present a system called RATEST, designed to help debug relational queries against reference queries and test database instances. In many applications, e.g., classroom learning and regression testing, we test the correctness of a user query Q by evaluating it over a test database instance D and comparing its result with that of evaluating a reference (correct) query Q0 over D. If Q(D) differs from Q0(D), the user knows Q is incorrect. However, D can be large (often by design), which makes debugging Q difficult. The key idea behind RATEST is to show the user a much smaller database instance D' ⊆ D, which we call a counterexample, such that Q(D') ≠ Q0(D'). RATEST builds on data provenance and constraint solving, and employs a suite of techniques to support, at interactive speed, complex queries involving differences and group-by aggregation. We demonstrate an application of RATEST in learning: it has been used successfully by a large undergraduate database course in a university to help students with a relational algebra assignment.