property-based testing of sparql queries - dbpl 2017dbpl2017.org/slides/dbpl-2017-7.pdf ·...
TRANSCRIPT
![Page 1: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/1.jpg)
Property-based Testing of SPARQL queries
Jesús M. Almendros-JiménezAntonio Becerra-Terón
University of Almería, SPAIN
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 2: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/2.jpg)
Type Checking and Testing of SPARQL
• SPARQL program bugs: debugging and testing
• Type Checking
• Wrongly typed(empty answers
• Testing
• Disagreement between expected behavior and answers (
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 3: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/3.jpg)
Type CheckingSELECT ?Person ?Paper ?University
WHERE
{ ?Person
?Person
?Person
?Paper
?Paper
FILTER (
Query:Universities of
Invited Talks of 2-authors papers
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 4: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/4.jpg)
Type CheckingSELECT ?Person ?Paper ?University
WHERE
{ ?Person :attends :DBPL .
?Person :affiliation
FILTER (?na >= 2) }
Wrong typing:has not
type :UniversityWrong typing:
?University has not type :Person
Wrong typing:has not type :Paper
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 5: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/5.jpg)
TestingSELECT ?Person ?Paper ?University
WHERE
{ ?Person :attends :DBPL .
?Person :affiliation ?University .
?Paper rfd:type :Invited_talk .
?Paper :numberofAuthors ?na .
FILTER (?na >= 2) }
Missing Triple!
!
Unexpected behavior!Wrong answers!!
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 6: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/6.jpg)
TestingSELECT ?Person ?Student ?University
WHERE
{ ?Person :author :Paper .
?Student :author Paper .
?Paper rfd:type :Student_Paper .
FILTER (?age <= 30) }
Wrong Triple!
?Person :age ?age
!
Unexpected behavior!Wrong answers!!
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 7: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/7.jpg)
TestingSELECT ?Person ?Paper ?University
{
?Person :attends :DBPL .
?Person :affiliation ?University .
?Paper rfd:type :Invited_talk
?Paper :numberofAuthors ?na
FILTER (?na >= 2)
}
Property:is ?Person the author of
?Paper ?
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 8: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/8.jpg)
TestingSELECT ?Person ?Student ?University
WHERE
{ ?Person :author :Paper .
?Student :author Paper .
?Paper rfd:type :Student_paper .
?Person :age ?age.
FILTER (?age <= 30) }
Property: is ?Student
younger than 30?
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 9: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/9.jpg)
Type System for SPARQL
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 10: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/10.jpg)
Testing of SPARQLOntology to XML Schema Mapping
Test Case Generation
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 11: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/11.jpg)
Type Checking and Testing of SPARQL
• Type Checking using an Ontology Reasoner (Hermit) for
• Testing using an Ontology Reasoner (Hermit) for test cases consistence
• Testing using
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 12: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/12.jpg)
Type Checking and Testing of SPARQL
Type Checking Tool results:
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 13: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/13.jpg)
Type Checking and Testing of SPARQL
Randomly generated test cases
Problem => Inconsistent Test Cases
Example:
:coauthor is irreflexive
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 14: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/14.jpg)
Type Checking and Testing of SPARQL
Testing success
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 15: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/15.jpg)
Type Checking and Testing of SPARQL
Testing fail
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 16: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/16.jpg)
Type Checking and Testing Tool
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
http://minerva.ual.es:8080/SPARQL
![Page 17: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/17.jpg)
Type Checking and Testing Tool
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
Pruning and Customization of Test Cases
![Page 18: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/18.jpg)
Benchmarks
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 19: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/19.jpg)
Benchmarks
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 20: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/20.jpg)
Conclusions and Future Work
• Testing tool based on Test Case Generation from XML Schema
• Detection of Buggy SPARQL Queries
• Extending the output property set
• White-Box Testing: Constraint Solving
16th International Symposium on Database Programming Languages (DBPL 2017), Munich, Germany
![Page 21: Property-based Testing of SPARQL queries - DBPL 2017dbpl2017.org/slides/DBPL-2017-7.pdf · Property-based Testing of SPARQL queries Jes s M. Almendros-Jim nez! Antonio Becerra-Ter](https://reader030.vdocuments.us/reader030/viewer/2022040610/5ece2c8fee11c142a623db2a/html5/thumbnails/21.jpg)
Thanks for your Attention
Jesús M. Almendros-JiménezAntonio Becerra-Terón
University of Almería SPAIN