Wha hat Fa Factor ors Make SQL L Test Cases Unde nderstand - - PowerPoint PPT Presentation

wha hat fa factor ors make sql l test cases unde
SMART_READER_LITE
LIVE PREVIEW

Wha hat Fa Factor ors Make SQL L Test Cases Unde nderstand - - PowerPoint PPT Presentation

Wha hat Fa Factor ors Make SQL L Test Cases Unde nderstand ndabl ble Fo For Testers? A Huma uman n Stud udy of Aut utom omatic Test Data Gene neration n Techn hnique ues By Abdullah Alsharif , Gregory M. Kapfhammer and Phil McMinn


slide-1
SLIDE 1

Wha hat Fa Factor

  • rs Make SQL

L Test Cases Unde nderstand ndabl ble Fo For Testers? A Huma uman n Stud udy of Aut utom

  • matic Test Data Gene

neration n Techn hnique ues

By Abdullah Alsharif, Gregory M. Kapfhammer and Phil McMinn

slide-2
SLIDE 2

DATABASES ARE IMPORTANT TO EVERY ORGANIZATION TESTING IS IMPORTANT BUT IT’S A TEDIOUS TASK

1

slide-3
SLIDE 3

Relational Databases

2 Database Schema

Schema can contain many complex integrity constraints

slide-4
SLIDE 4

Schema

3

slide-5
SLIDE 5

Schema

3 Data Types Integrity Constraints

slide-6
SLIDE 6

Generating Tests Automatically

4 Test Requirement: violatethe following constraint

slide-7
SLIDE 7

Generating Tests Automatically

AVM-Defaults Generates: 5 Test Requirement: violatethe following constraint

slide-8
SLIDE 8

Generating Tests Automatically

AVM-Defaults Generates: 6 Test Requirement: violatethe following constraint

slide-9
SLIDE 9

Generating Tests Automatically

AVM-Defaults Generates: DOMINO-Random Generates: 6 Test Requirement: violatethe following constraint

slide-10
SLIDE 10

Are these test understandable?

AVM-Defaults Generates: DOMINO-Random Generates: 6 Test Requirement: violatethe following constraint

slide-11
SLIDE 11

The Human Oracle Cost

Qualitative Cost

Associated with the level of comprehension required to evaluate the behavior of the test

Quantitative Cost

Associated with the test suite size and the time a human takes to evaluate each test case manually

8

slide-12
SLIDE 12

Prior Work

Created more readable values Created more readable variables Automated vs Manual tests No test comprehension factors identified 10

slide-13
SLIDE 13

Methodology – Current Generators

12 Generator host path title visit_count fav_icon_url AVM-Defaults '' '' '' '' DOMINO-RND 'hctgp' '' 'ra' 'kt'

slide-14
SLIDE 14

Methodology – Readable Variant Generators

12 Generator host path title visit_count fav_icon_url AVM-Defaults '' '' '' '' DOMINO-RND 'hctgp' '' 'ra' 'kt' AVM-LM 'Thino' 'jongo' 'jesed' 'Zesth'

slide-15
SLIDE 15

Methodology – Readable Variant Generators

12 Generator host path title visit_count fav_icon_url AVM-Defaults '' '' '' '' DOMINO-RND 'hctgp' '' 'ra' 'kt' AVM-LM 'Thino' 'jongo' 'jesed' 'Zesth' DOMINO-COL 'host_0' 'path_1' 'title_2' 3 'fav_icon_url_4'

slide-16
SLIDE 16

Methodology – Readable Variant Generators

12 Generator host path title visit_count fav_icon_url AVM-Defaults '' '' '' '' DOMINO-RND 'hctgp' '' 'ra' 'kt' AVM-LM 'Thino' 'jongo' 'jesed' 'Zesth' DOMINO-COL 'host_0' 'path_1' 'title_2' 3 'fav_icon_url_4' DOMINO-READ 'sidekick' 'badly' 'numbers' 758 'good'

slide-17
SLIDE 17

Methodology – Two Case Studies

NistWeather Schema BrowserCookies Schema 13

slide-18
SLIDE 18

Methodology – Survey/Questionnaire

15 Schema

slide-19
SLIDE 19

Methodology – Survey/Questionnaire

Test INSERTs 16 Schema

slide-20
SLIDE 20

Methodology – Survey/Questionnaire

The Human Oracle: Which INSERT will be rejected by the DBMS? 17 Test INSERTs Schema

slide-21
SLIDE 21

Methodology – Participant Assignments

Each integrity constraint has two test case – a violation and a satisfaction

slide-22
SLIDE 22

Methodology – Participant Assignments

slide-23
SLIDE 23

Methodology – Participant Assignments

Test cases were randomized for each participant in the group

slide-24
SLIDE 24

Methodology – Human Study

SILENT STUDY - 25 PARTICIPANTS THINK ALOUD STUDY – 6 PARTICIPANTS

18

slide-25
SLIDE 25

Methodology – The Think-Aloud Study

  • 5 participants with only prompting with a "why?"
  • A 6th participant that is an "experienced industry engineer" to

corroborate the other 5 participant's comments

20

slide-26
SLIDE 26

Research Questions

RQ1: Success Rate in Comprehending the Test Cases

How successful are testers at correctly comprehending the behavior of schema test cases generated by automated techniques?

RQ2: Factors Involved in Test Case Comprehension

What are the factors of automatically generated SQL INSERT statements that make them easy for testers to understand?

21

slide-27
SLIDE 27

RQ 1 Success Rate – The Silent Study Results

  • In conclusion, we observed that AVM-Default is the most easily comprehended
  • In contrast, the most difficult to comprehend is DOMINO-RANDOM
  • The remaining techniques fall in between these two extremes

23 Technique Correct Responses Incorrect Responses Score Ranking AVM-DEFAULTs 76 12 84% 1 DOMINO-COL 67 23 74% 2 AVM-LM 65 25 72% = 3 DOMINO-READ 65 25 72% = 3 DOMINO-RANDOM 55 35 61% 5

slide-28
SLIDE 28

What are the factors that contributed to this success rate?

24

slide-29
SLIDE 29

Default Values can help "to skip over to get to the important data" "the NOT NULL constraints are the easiest to spot" Default Values can show the "differences and similarities between INSERTs"

slide-30
SLIDE 30

Default Values can help "to skip over to get to the important data" "the NOT NULL constraints are the easiest to spot" Default Values can show the "differences and similarities between INSERTs"

  • It is Easy to Identify

When NULL Violates NOT NULL Constraints

  • Empty Strings Look Strange,

But They Are Helpful

slide-31
SLIDE 31

"CHECK constraint should be a NOT NULL by default" "the path [a FOREIGN KEY] is NULL which is not going to work" NULLs are confusing with Foreign Keys and CHECK Constraints

slide-32
SLIDE 32

"CHECK constraint should be a NOT NULL by default" "the path [a FOREIGN KEY] is NULL which is not going to work" Negativenumbers "takes more time to do mental arithmetic" Negative numbers are "not realistic" Negative NumbersRequire More Comprehension Effort NULLs are confusing with Foreign Keys and CHECK Constraints

slide-33
SLIDE 33

"CHECK constraint should be a NOT NULL by default" "the path [a FOREIGN KEY] is NULL which is not going to work" Negativenumbers "takes more time to do mental arithmetic" Negative numbers are "not realistic" Negative NumbersRequire More Comprehension Effort Random string are "garbage data" Random strings "are horrible, they are more distinct" NULLs are confusing with Foreign Keys and CHECK Constraints Random Strings Require More Comprehension Effort

slide-34
SLIDE 34

RQ2 Factors – Think Aloud Study Results

  • Participants raised issues concerning the use of NULL, suggesting its

judicious use in test data generation

  • Positive comments about default values and readable strings
  • Dislike of negative numbers and random strings

27

slide-35
SLIDE 35

Conclusion and Recommendations

NULLs are confusing for human testers Do not use negative numbers as they require testers to think harder Use simple repetitions for unimportant test values Use human readable strings values rather than random strings

28