using dynamic invariant detection to support the testing
play

Using Dynamic Invariant Detection to Support the Testing and - PowerPoint PPT Presentation

Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications Gregory M. Kapfhammer Department of Computer Science Allegheny College http://www.cs.allegheny.edu/ gkapfham/ University of Ulm January


  1. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software and Data are Everywhere Program Program Program Program Program Program Program Program Program Program Program Program Program Program Program Program Desktop Desktop Desktop Desktop Mobile Mobile Mobile Mobile Computer Computer Computer Computer Computer Computer Computer Computer Computer Computer Computer Computer Server Server Server Server Program Program Program Program Program Program Program Program Program Program Program Program Program Program Program Household Household Household Household Scientific Scientific Scientific Scientific Network Network Network Appliance Appliance Appliance Appliance Device Device Device Device Router Router Router Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  2. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software Complexity and Data Enormity Computer Software Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  3. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software Complexity and Data Enormity Computer Software Lines of Code Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  4. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software Complexity and Data Enormity Computer Software Lines of Code Numerous Features Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  5. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software Complexity and Data Enormity Computer Software Lines of Code Numerous Feature Features Interactions Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  6. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software Complexity and Data Enormity Computer Software Lines of Execution Code Environments Numerous Feature Features Interactions Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  7. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software Complexity and Data Enormity Software entities are more complex for their size than per- haps any other human construct - Frederick P . Brooks, Jr. Computer Software Lines of Execution Code Environments Numerous Feature Features Interactions Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  8. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software Complexity and Data Enormity Software entities are more complex for their size than per- Prediction: in 2011, 1.8 zettabytes (i.e., 1.8 trillion giga- bytes) of data will be created - IDC Digital Universe Study haps any other human construct - Frederick P . Brooks, Jr. Computer Software Lines of Execution Code Environments Numerous Feature Features Interactions Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  9. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software and Data are Evolving Program Execution Environment Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  10. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software and Data are Evolving Program Program Execution Execution Environment Environment Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  11. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software and Data are Evolving Program Program Execution Execution Environment Environment Program Changed because of the addition of a new feature or the correction of a defect Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  12. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software and Data are Evolving Program Program Execution Execution Environment Environment Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  13. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software and Data are Evolving Program Program Program Execution Execution Execution Environment Environment Environment Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  14. Introduction Database Applications Dynamic Invariants Conclusion Software and Data Challenges Software and Data are Evolving Program Program Program Execution Execution Execution Environment Environment Environment Execution Environment Changed due to modifica- tion of a kernel, device driver, or relational database Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  15. Introduction Database Applications Dynamic Invariants Conclusion Relational Database Challenges An Interesting Defect Report Database Server Crashes Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  16. Introduction Database Applications Dynamic Invariants Conclusion Relational Database Challenges An Interesting Defect Report Database Server Crashes When you run a complex query against Microsoft SQL Server 2000, the SQL Server scheduler may stop respond- ing. Additionally, you receive an error message that resem- bles the following: Date Time server Error: 17883 Sever- ity: 1, State: 0 Date Time server Process 52:0 (94c) ... Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  17. Introduction Database Applications Dynamic Invariants Conclusion Relational Database Challenges An Interesting Defect Report Input-Dependent Defect Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  18. Introduction Database Applications Dynamic Invariants Conclusion Relational Database Challenges An Interesting Defect Report Input-Dependent Defect This problem occurs when one or more of the following con- ditions are true: The query contains a UNION clause or a UNIONALL clause that affects many columns. The query contains several JOIN statements. The query has a large estimated cost. BUG 473858 (SQL Server 8.0) Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  19. Introduction Database Applications Dynamic Invariants Conclusion Relational Database Challenges Real-World Defective Database Application The Risks Digest, Volume 22, Issue 64, 2003 Jeppesen reports airspace boundary problems About 350 airspace boundaries contained in Jeppesen Nav- Data are incorrect, the FAA has warned. The error occurred at Jeppesen after a software upgrade when information was pulled from a database containing 20,000 airspace bound- aries worldwide for the March NavData update, which takes effect March 20. Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  20. Introduction Database Applications Dynamic Invariants Conclusion Relational Database Challenges Real-World Defective Database Application The Risks Digest, Volume 22, Issue 64, 2003 Jeppesen reports airspace boundary problems About 350 airspace boundaries contained in Jeppesen Nav- Data are incorrect, the FAA has warned. The error occurred at Jeppesen after a software upgrade when information was pulled from a database containing 20,000 airspace bound- aries worldwide for the March NavData update, which takes effect March 20. Practically all use of databases occurs from within applica- tion programs [Silberschatz et al., 2006, pg. 311] Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  21. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Structured Query Language The structured query language (SQL) is an established stan- dard and a query and manipulation language for relational database management systems (RDBMS) Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  22. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Structured Query Language The structured query language (SQL) is an established stan- dard and a query and manipulation language for relational database management systems (RDBMS) A schema is a collection of table definitions: CREATE TABLE person ( id INT, name VARCHAR(100) NOT NULL, age INT(3), PRIMARY KEY (id) ) Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  23. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Structured Query Language The structured query language (SQL) is an established stan- dard and a query and manipulation language for relational database management systems (RDBMS) The data manipulation language supports several operations: SELECT name FROM person WHERE age >= 30 AND age <= 40 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  24. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Structured Query Language The structured query language (SQL) is an established stan- dard and a query and manipulation language for relational database management systems (RDBMS) The data manipulation language supports several operations: UPDATE person SET name = Jan WHERE id = 2 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  25. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Structured Query Language The structured query language (SQL) is an established stan- dard and a query and manipulation language for relational database management systems (RDBMS) The data manipulation language supports several operations: INSERT INTO person (id, name, age) VALUES (1, John, 38) Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  26. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Structured Query Language The structured query language (SQL) is an established stan- dard and a query and manipulation language for relational database management systems (RDBMS) The data manipulation language supports several operations: DELETE FROM person WHERE id = 2 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  27. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Relational Database Tables id name age 1 Chalker Conrad 12 2 Abby Clulow 14 3 David Rogan 18 4 Stacie Reckling 32 5 Megan Hartnup 29 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  28. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Relational Database Tables id name age 1 Chalker Conrad 12 2 Abby Clulow 14 3 David Rogan 18 4 Stacie Reckling 32 5 Megan Hartnup 29 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  29. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Relational Database Tables id name age 1 Chalker Conrad 12 2 Abby Clulow 14 3 David Rogan 18 4 Stacie Reckling 32 5 Megan Hartnup 29 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  30. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Relational Database Tables id name age 1 Chalker Conrad 12 2 Abby Clulow 14 3 David Rogan 18 4 Stacie Reckling 32 5 Megan Hartnup 29 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  31. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Relational Database Tables id name age 1 Chalker Conrad 12 2 Abby Clulow 14 3 David Rogan 18 4 Stacie Reckling 32 5 Megan Hartnup 29 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  32. Introduction Database Applications Dynamic Invariants Conclusion Relational Databases Relational Database Tables id name age 1 Chalker Conrad 12 2 Abby Clulow 14 3 David Rogan 18 4 Stacie Reckling 32 5 Megan Hartnup 29 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  33. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Program Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  34. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Relational Database Program Management System Database State Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  35. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Data Manipulation Language (DML) Statements select Relational Database Relational Database Program Management System Management System query Database State Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  36. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Data Manipulation Language (DML) Statements update Relational Database Relational Database Program Management System Management System modify Database State Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  37. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Data Manipulation Language (DML) Statements insert Relational Database Relational Database Program Management System Management System modify Database State Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  38. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Data Manipulation Language (DML) Statements delete Relational Database Relational Database Program Management System Management System modify Database State Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  39. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Data Definition Language (DDL) Statements create table Relational Database Relational Database Program Management System Management System modify Database Structure Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  40. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Database Applications Data Definition Language (DDL) Statements create table Relational Database Relational Database Program Management System Management System modify Can we categorize the dif- ferent ways of implementing Database database applications? Structure Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  41. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  42. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Approach Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  43. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Program Approach Location Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  44. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Program Approach Location Interface Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  45. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Program Approach Location Interface Embedded Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  46. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Program Approach Location Outside Interface Embedded RDBMS Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  47. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Program Approach Location Outside Inside Interface Embedded RDBMS RDBMS Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  48. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Program Approach Location Outside Outside Inside Interface Interface Embedded RDBMS RDBMS RDBMS Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  49. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Categorizing Database Applications Database Applications Interaction Program Approach Location Outside Outside Inside Interface Interface Embedded RDBMS RDBMS RDBMS Java application that submits SQL strings to HSQLDB using JDBC Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  50. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications DML Command Relational Database Relational Database Program Management System Management System Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  51. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications DML Command Relational Database Relational Database Program Management System Management System Database Database State Structure Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  52. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications Only the database administrator can add new constraints to the schema! DML Command Relational Database Relational Database Program Management System Management System Database Database State Structure Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  53. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications The programmers encode the constraints in the program’s source code! DML Command Relational Database Relational Database Program Management System Management System Constraint C i Database Database State Structure Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  54. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications The programmers encode the constraints in the program’s source code! DML Command Relational Database Relational Database Program Management System Management System Constraint C i Constraint C j Database Database State Structure Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  55. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications The programmers encode the constraints in the program’s source code! DML Command Relational Database Relational Database Program Management System Management System Constraint C i Constraint C j Database Database State Structure Constraint C k Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  56. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications Constraints C i , C j , C k should be encoded in the schema! DML Command Relational Database Relational Database Program Management System Management System Constraint C i Constraint C j Database Database State Structure Constraint C k Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  57. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications Goal : extract C i , C j , C k from the source code of the program DML Command Relational Database Relational Database Program Management System Management System Constraint C i Constraint C j Database Database State Structure Constraint C k Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  58. Introduction Database Applications Dynamic Invariants Conclusion Programs and Databases Evolution of Database Applications Goal : extract C i , C j , C k from the source code of the program DML Command Relational Database Relational Database Program Management System Management System Database Database Database State Structure Structure Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  59. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariants Definition An invariant is a mathematical property that holds through some set of transformations Motivating Examples • 0 × y = 0 • | x | ≥ 0 C • d = π Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  60. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariants Definition An invariant is a mathematical property that holds through some set of transformations Motivating Examples • 0 × y = 0 • | x | ≥ 0 C • d = π Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  61. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariants Definition An invariant is a mathematical property that holds through some set of transformations Motivating Examples • 0 × y = 0 • | x | ≥ 0 C • d = π Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  62. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariants Definition An invariant is a mathematical property that holds through some set of transformations Motivating Examples • 0 × y = 0 • | x | ≥ 0 C • d = π Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  63. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Program Invariants Invariant with respect to: • State class Invariant { 1 • Input/Output static int x = 0; 2 public static int nextX() { 3 if( ++x > 10 ) Simple Examples 4 x = 0; 5 • 0 ≤ x ≤ 10 return x + 1; 6 • 1 ≤ nextX() ≤ 11 7 } } 8 • nextX() = ( x + 1 ) mod 11 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  64. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Program Invariants Invariant with respect to: • State class Invariant { 1 • Input/Output static int x = 0; 2 public static int nextX() { 3 if( ++x > 10 ) Simple Examples 4 x = 0; 5 • 0 ≤ x ≤ 10 return x + 1; 6 • 1 ≤ nextX() ≤ 11 7 } } 8 • nextX() = ( x + 1 ) mod 11 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  65. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Program Invariants Invariant with respect to: • State class Invariant { 1 • Input/Output static int x = 0; 2 public static int nextX() { 3 if( ++x > 10 ) Simple Examples 4 x = 0; 5 • 0 ≤ x ≤ 10 return x + 1; 6 • 1 ≤ nextX() ≤ 11 7 } } 8 • nextX() = ( x + 1 ) mod 11 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  66. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Program Invariants Invariant with respect to: • State class Invariant { 1 • Input/Output static int x = 0; 2 public static int nextX() { 3 if( ++x > 10 ) Simple Examples 4 x = 0; 5 • 0 ≤ x ≤ 10 return x + 1; 6 • 1 ≤ nextX() ≤ 11 7 } } 8 • nextX() = ( x + 1 ) mod 11 Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  67. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Dynamic Invariants Definition A dynamic invariant is a property that is observed to hold during a series of executions • Not guaranteed for all possible executions • May reflect property of: • Program • Inputs Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  68. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Dynamic Invariants Definition A dynamic invariant is a property that is observed to hold during a series of executions • Not guaranteed for all possible executions • May reflect property of: • Program • Inputs Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  69. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Daikon Invariant Detector Daikon [Ernst et al. 2001] is a dynamic invariant detection engine originally designed for traditional C and Java programs Detection Process • Collect data traces for variables at program point s • Compare to pool of potential invariants • Output remaining invariants that meet confidence threshold Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  70. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Daikon Invariant Detector Daikon [Ernst et al. 2001] is a dynamic invariant detection engine originally designed for traditional C and Java programs Detection Process • Collect data traces for variables at program point s • Compare to pool of potential invariants • Output remaining invariants that meet confidence threshold Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  71. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  72. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Program Program’ Instrument Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  73. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Program Test Suite Program’ Instrument Execute Trace File Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  74. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Program Test Suite Potential Invariants Program’ Dynamic Invariants Instrument Execute Trace File Daikon Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  75. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Program Test Suite Potential Invariants Program’ Dynamic Invariants Instrument Execute Trace File Daikon Supporting Techniques Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  76. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Program Test Suite Potential Invariants Program’ Dynamic Invariants Instrument Instrument Execute Trace File Daikon Supporting Techniques Instrumentation Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  77. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Program Test Suite Potential Invariants Program’ Dynamic Invariants Instrument Instrument Execute Execute Trace File Daikon Supporting Techniques Instrumentation Test Suite Execution Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  78. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Program Test Suite Potential Invariants Program’ Dynamic Invariants Instrument Instrument Execute Execute Trace File Daikon Daikon Supporting Techniques Statistical Analysis Instrumentation Test Suite Execution Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  79. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Invariant Detection Process Refer to [Ernst et al. 2001] for additional details about these techniques Program Test Suite Potential Invariants Program’ Dynamic Invariants Instrument Instrument Execute Execute Trace File Daikon Daikon Supporting Techniques Statistical Analysis Instrumentation Test Suite Execution Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  80. Introduction Database Applications Dynamic Invariants Conclusion Traditional Invariant Detection Applications of Daikon Applications of dynamic invariants in software engineering: • Programmer understanding • Run-time checking • Integration testing • Interface discovery • Test-input generation • Test-suite reduction • Many additional techniques Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  81. Introduction Database Applications Dynamic Invariants Conclusion Database-Aware Invariant Detection Structural Mapping Program Element Database Element Program Point Table Variable Column Occurence Row Detect invariants for: • Individual columns • Between columns in a given row id name age employed . . . 1 ’John Smith’ 38 5 . . . 2 ’Jan Downing’ 22 2 . . . Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  82. Introduction Database Applications Dynamic Invariants Conclusion Database-Aware Invariant Detection Structural Mapping Program Element Database Element Program Point Table Variable Column Occurence Row Detect invariants for: • Individual columns • Between columns in a given row id name age employed . . . 1 ’John Smith’ 38 5 . . . 2 ’Jan Downing’ 22 2 . . . Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  83. Introduction Database Applications Dynamic Invariants Conclusion Database-Aware Invariant Detection Structural Mapping Program Element Database Element Program Point Table Variable Column Occurence Row Detect invariants for: • Individual columns • Between columns in a given row id name age employed . . . 1 ’John Smith’ 38 5 . . . 2 ’Jan Downing’ 22 2 . . . Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  84. Introduction Database Applications Dynamic Invariants Conclusion Database-Aware Invariant Detection Data Mapping Daikon Concepts • Representation type • int • double • String • int[] • Comparability Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  85. Introduction Database Applications Dynamic Invariants Conclusion Database-Aware Invariant Detection Data Mapping Group Name SQL Types Java Type CHAR VARCHAR 1 Text String TEXT INTEGER NUMERIC 2 Integer int BIT FLOAT DOUBLE REAL 3 Decimal double DECIMAL BLOB 4 Binary byte[] BIT 5 Text Set SET String[] DATETIME 6 Datetime String TIMESTAMP 7 Date DATE String 8 Time TIME String 9 Interval INTERVAL int 10 Primary Key reference INTEGER Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

  86. Introduction Database Applications Dynamic Invariants Conclusion Database-Aware Invariant Detection Data Mapping Handling NULL Values • NULL is a possible value for any SQL type • Daikon does not accept null for primitive representation types such as int • Introduce synthetic variable for each NULL -able column • Representation type is hashcode ( reference ) • Value is either null or a constant Kapfhammer Allegheny College Using Dynamic Invariant Detection to Support the Testing and Analysis of Database Applications

Recommend


More recommend