Assisting Students in Finding Their Own Bugs in Programming Exercises using Verification and Group...

Preview:

DESCRIPTION

 

Citation preview

Ho Chi Minh City University of Technology, VietnamFaculty of Computer Science and EngineeringLab for Systems Analysis and VErification (SAVE)

Assisting Students in Finding Their Own Bugs inProgramming Exercises using Verification and

Group Testing Techniques

Long H. Pham, Nam P. Mai, Mai H. Dinh, Tho T. Quan, Hung Q. Ngo

November 5, 2013

Outline1. Student Program Correctness Problem

2. Our approach

3. Framework

4. How it works

5. Case study

6. Experiment

7. Issues & Future works

Verification and Group Testing Techniques

1. Student Program Correctness Problem

• Traditional method: read all programs to verify

⇒ 999 999 999 LOC ?

• Automated assessment system: execute, pass all test cases

⇒ test suite cover all possible errors ?

⇒ real execution is potentially dangerous for the system ?

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 3/24

Verification and Group Testing Techniques

2. Our approach• Static methods & Automation

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 4/24

Verification and Group Testing Techniques

3. Framework

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 5/24

Verification and Group Testing Techniques

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 6/24

Verification and Group Testing Techniques

• Exercise list

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 7/24

Verification and Group Testing Techniques

• Bubble sort problem

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 8/24

Verification and Group Testing Techniques

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 9/24

Verification and Group Testing Techniques

4. How it works

• Component point of view

• System point of view

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 10/24

Verification and Group Testing Techniques

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 11/24

Verification and Group Testing Techniques

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 12/24

Verification and Group Testing Techniques

5. Case study

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 13/24

Verification and Group Testing Techniques

• Bubble sort algorithm with the 10th line is logically wrong

• The 10th line belongs to block S5 ⇒ S5 is expected as the error block.

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 14/24

Verification and Group Testing Techniques

• The testing matrix for above program has 1343 rows and 51 columns

• Loop structure ⇒ compact testing matrix to 11 rows and 9 columns

• The test outcome after running test cases is {0 1 0 1 1 1 1 1 1 1 0}

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 15/24

Verification and Group Testing Techniques

• The error block is highlighted with red color

⇒ programmer can easily know where the problem is and fix it withouttoo much effort.

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 16/24

Verification and Group Testing Techniques

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 17/24

Verification and Group Testing Techniques

6. Experiment

• 6 well-known algorithms, with some different implementations

• Each implementation has exactly one bug

⇒ test whether the system can localize these bugs or not

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 18/24

Verification and Group Testing Techniques

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 19/24

Verification and Group Testing Techniques

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 20/24

Verification and Group Testing Techniques

• The result of our experiment is shown in the table and figure below

• The figure shows the chart comparing right localizations with wronglocalizations in each algorithm.

• The detailed numbers of right/wrong localizations are in the table.

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 21/24

Verification and Group Testing Techniques

• Successfully 19 times in total 22 implementations

• 3 remained implementations are not localized successfully because thegenerated test suite is not good enough

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 22/24

Verification and Group Testing Techniques

7. Issues & Future works

• Path explosion

• Missing code

Mai H. Dinh | SAVE | Ho Chi Minh City University of Technology, Vietnam 23/24

Thanks for your listenning.Question?

Recommended