Pro Yearly is on sale from $80 to $50! »

The measured performance of database-aware test coverage monitoring

The measured performance of database-aware test coverage monitoring

Interested in learning more about this topic? Visit this web site to see related presentations: https://www.gregorykapfhammer.com/research/presentations/

4ae30d49c8cc07e42d5a871efb9bcfba?s=128

Gregory Kapfhammer

September 14, 2007
Tweet

Transcript

  1. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study The Measured Performance of Database-Aware Test Coverage Monitoring Gregory M. Kapfhammer† Department of Computer Science Allegheny College http://cs.allegheny.edu/~gkapfham/ University of Pittsburgh, 2007 †In Conjunction with Mary Lou Soffa (UVa/CS), Panos Chrysanthis (Pitt/CS), Bruce Childers (Pitt/CS) Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  2. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? Outline 1 Introduction to Database Applications Motivation What is a Database Application? 2 Introduction to Software Testing Traditional Software Testing A New Testing Paradigm 3 Database-Aware Test Coverage Monitoring Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes 4 Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  3. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? An Interesting Defect Report Database Server Crashes When you run a complex query against Microsoft SQL Server 2000, the SQL Server scheduler may stop responding. Additionally, you receive an error message that resembles the following: Date Time server Error: 17883 Severity: 1, State: 0 Date Time server Process 52:0 (94c) ... An Input-Dependent Defect This problem occurs when one or more of the following conditions are true: The query contains a U N I O N clause or a U N I O N A L L clause that affects many columns. The query contains several J O I N statements. The query has a large estimated cost. BUG 473858 (SQL Server 8.0) Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  4. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? An Interesting Defect Report Database Server Crashes When you run a complex query against Microsoft SQL Server 2000, the SQL Server scheduler may stop responding. Additionally, you receive an error message that resembles the following: Date Time server Error: 17883 Severity: 1, State: 0 Date Time server Process 52:0 (94c) ... An Input-Dependent Defect This problem occurs when one or more of the following conditions are true: The query contains a U N I O N clause or a U N I O N A L L clause that affects many columns. The query contains several J O I N statements. The query has a large estimated cost. BUG 473858 (SQL Server 8.0) Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  5. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? Real World Example A Severe Defect The Risks Digest, Volume 22, Issue 64, 2003 Jeppesen reports airspace boundary problems About 350 airspace boundaries contained in Jeppesen NavData 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 boundaries worldwide for the March NavData update, which takes effect March 20. An Important Point Practically all use of databases occurs from within application programs [Silberschatz et al., 2006, pg. 311]. Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  6. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? Real World Example A Severe Defect The Risks Digest, Volume 22, Issue 64, 2003 Jeppesen reports airspace boundary problems About 350 airspace boundaries contained in Jeppesen NavData 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 boundaries worldwide for the March NavData update, which takes effect March 20. An Important Point Practically all use of databases occurs from within application programs [Silberschatz et al., 2006, pg. 311]. Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  7. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? Program and Database Interactions 1 D e D P m update select insert delete Basic Operation Program P creates SQL statements in order to view and/or modify the state of the relational database Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  8. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? Database Interaction Granularity P m i m j Dl Dk R R2 1 E F G H A B C D I R3 J K L Database Interactions Program P interacts with two relational databases Dk and Dl at different levels of granularity (relation, record, attribute, ...) Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  9. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Motivation What is a Database Application? Types of Applications Interaction Approach Program Location Database−Centric Applications Embedded Inside DBMS Interface Outside DBMS Testing framework relevant to all types of applications Current tool support focuses on Interface-Outside applications Example: Java application that submits SQL Strings to an HSQLDB relational database using a JDBC driver Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  10. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Traditional Software Testing A New Testing Paradigm Outline 1 Introduction to Database Applications Motivation What is a Database Application? 2 Introduction to Software Testing Traditional Software Testing A New Testing Paradigm 3 Database-Aware Test Coverage Monitoring Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes 4 Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  11. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Traditional Software Testing A New Testing Paradigm Focus on Testing Individual Components System Operating File System Virtual P Machine Graphical Interface Database Byte Code Input a 5 print ... exit Final Result: 45 Output Traditional Assumption Defects may exist in program P and/or P’s execution environment Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  12. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Traditional Software Testing A New Testing Paradigm Various Approaches to Software Testing Specification Testing Testing Random MTTF(P) = k Reliability Software Input Freq Testing Structural Input Space Techniques and Supporting Tools Structural testing requires a test coverage monitor! Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  13. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Traditional Software Testing A New Testing Paradigm Testing Environment Interactions File System Virtual Machine P Database System Operating Input a 5 print ... exit Final Result: 45 Output A New Direction in Software Testing Defects may exist in P’s interaction with its environment. This suggests the need for a database-aware test coverage monitor! Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  14. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Outline 1 Introduction to Database Applications Motivation What is a Database Application? 2 Introduction to Software Testing Traditional Software Testing A New Testing Paradigm 3 Database-Aware Test Coverage Monitoring Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes 4 Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  15. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Coverage Criteria for Database Applications select * from R delete R where A > 100 from i m 3 6 P use(R) define(R) Candidates for Coverage Monitoring Find defects in the database interactions by ensuring that the test suite covers all of the possible def-use associations and/or calling contexts Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  16. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Challenges of Database-Aware Monitoring Id ... 25 26 ... Path ... /usr/bin/bibtex /usr/bin/bison ... Method Under Test (listFiles) 2. SQL Select Files Relation Test Case (testListFiles) 4. Path(s) 3. Result Set 1. Signature SQL Statement select Path from Files where ucase(Path) like ‘%/usr/bin/bi%’ Testing Challenges Traditional coverage monitoring does not reveal how the test case causes the method to interact with the database Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  17. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Overview of the Coverage Monitoring Process Program Instrumentation Test Suite Adequacy Criterion Instrumented Program Test Coverage Monitoring Instrumented Test Suite Coverage Results Adequacy Calculation Test Requirements Adequacy Measurements Database Current Considerations Focus on the design, implementation, and performance evaluation of the instrumentation and coverage monitoring components Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  18. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Database-Aware Coverage Trees Test Case Method Invocation Database Interaction Point Database Relation Attribute Record Attribute Value Instrumentation Probes Use static and dynamic (load-time) instrumentation techniques to insert coverage monitoring probes Coverage Trees Store the coverage results in a tree in order to support the calculation of many types of coverage (e.g., data flow or call tree) Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  19. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Comparing the Coverage Trees Tree Characteristics Tree DB? Context Probe Time Tree Space CCT × Partial Low - Moderate Low DCT × Full Low Moderate - High DI-CCT Partial Moderate Moderate DI-DCT Full Moderate High Table Legend Database? ∈ {×, } Context ∈ {Partial, Full} Probe Time Overhead ∈ {Low, Moderate, High} Tree Space Overhead ∈ {Low, Moderate, High} Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  20. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Database-Aware Instrumentation Test Coverage Monitoring Instrumentation Interaction Location Interaction Type Program Test Suite Defining Using Defining-Using Important Goal Efficiently monitor coverage of database state and structure without changing the behavior of the program under test Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  21. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Phases of Coverage Monitoring Start Testing Before Probe End Testing Coverage Tree Storage Coverage Tree Coverage Tree Update Database Interaction After Probe Update Coverage Tree Initialization Start Testing Before Probe End Testing Coverage Tree Storage Coverage Tree Coverage Tree Update Database Interaction After Probe Update Coverage Tree Initialization Monitoring Operations Database-aware probes: Capture the SQL String Consult the database schema and result set meta-data Extract and analyze portions of the database state Update the coverage tree Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  22. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes Relational Differencing t1 t2 t3 A1 1 2 3 A2 2 2 3 3 4 relj Before t1 t2 t3 A1 1 2 3 A2 2 2 4 4 4 relj After Handling Database Modifications The probes use relational differencing to determine that record t2 and attribute value t2 [2] were modified by the SQL U P D A T E command Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  23. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Outline 1 Introduction to Database Applications Motivation What is a Database Application? 2 Introduction to Software Testing Traditional Software Testing A New Testing Paradigm 3 Database-Aware Test Coverage Monitoring Coverage Monitoring Basics Fundamentals of Coverage Monitoring Instrumentation Probes 4 Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  24. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Characterizing the Case Study Applications Test Suites Application # Tests Test NCSS / Total NCSS R M 13 227/548 = 50.5% F F 16 330/558 = 59.1% P I 15 203/579 = 35.1% S T 25 365/620 = 58.9% T M 27 355/748 = 47.5% G B 51 769/1455 = 52.8% Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  25. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Details about the Database Interactions Interaction Counts Application executeUpdate executeQuery Total R M 3 4 7 F F 3 4 7 P I 3 2 5 S T 4 3 7 T M 36 9 45 G B 11 23 34 Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  26. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Static Instrumentation Costs FF PI RM ST TM GB All Application 2 4 6 8 10 Static Instrumentation Time sec FF PI RM ST TM GB All 4.391 4.404 4.396 4.394 5.169 5.583 8.687 Attach probes to all of the applications in less than nine seconds Statically inserting probes increases space overhead Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  27. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Coverage Monitoring Time: Static Versus Dynamic Time Overhead Instr Tree TCM Time (sec) Per Incr (%) Static CCT 7.44 12.5 Static DCT 8.35 26.1 Dynamic CCT 10.17 53.0 Dynamic DCT 11.0 66.0 Discussion Static has poor space overhead but leads to a minimal increase in testing time. Static is less flexible than dynamic. Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  28. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Further Comparison of Static Versus Dynamic Norm Sta CCT Sta DCT Dyn CCT Dyn DCT Instrumentation Technique Tree Type GB 2 4 6 8 10 12 14 TCM Time sec Norm Sta CCT Sta DCT Dyn CCT Dyn DCT 6.939 7.626 8.026 11.084 11.435 Discussion Static is faster than dynamic / CCT is faster than DCT Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  29. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Varying Database Interaction Granularity Time Overhead DB Level TCM Time (sec) Per Incr (%) Program 7.44 12.39 Database 7.51 13.44 Relation 7.56 14.20 Attribute 8.91 34.59 Record 8.90 34.44 Attribute Value 10.14 53.17 Discussion Static supports efficient monitoring since there is a 53% increase in testing time at the finest level of interaction Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring
  30. Introduction to Database Applications Introduction to Software Testing Database-Aware Test

    Coverage Monitoring Experimental Study Experiment Design Instrumentation Costs Coverage Monitoring Costs Conclusions and Future Work Concluding Remarks A new perspective on software testing and an efficient and effective database-aware test coverage monitor Future Work Perform demand-driven instrumentation Use the coverage tree to reduce or prioritize a test suite Conduct experiments with larger database applications Resources http://cs.allegheny.edu/~gkapfham/research/diatoms/ Gregory M. Kapfhammer Database-Aware Test Coverage Monitoring