SLIDE 1
How do Codecademy's The online Python Tutor interpreter 45 - - PowerPoint PPT Presentation
How do Codecademy's The online Python Tutor interpreter 45 - - PowerPoint PPT Presentation
How do Codecademy's The online Python Tutor interpreter 45 million users currently has 60,000 users per month learn to code? input() input() u = 42 x = float(input()) print(x * math.e / 2)
SLIDE 2
SLIDE 3
- ○
SLIDE 4
How do Codecademy's
45 million users
learn to code? The online Python Tutor interpreter currently has 60,000 users per month
SLIDE 5
input()
SLIDE 6
input()
SLIDE 7
SLIDE 8
SLIDE 9
SLIDE 10
u = 42 x = float(input()) print(x * math.e / 2)
SLIDE 11
26,2
u = 42 x = float(input()) print(x * math.e / 2)
SLIDE 12
26,2
u = 42 x = float(input()) print(x * math.e / 2)
ValueError: could not convert string to float: '26,2'
SLIDE 13
26,2
u = 42 x = float(input()) print(x * math.e / 2)
ValueError: could not convert string to float: '26,2'
29.2
SLIDE 14
26,2
ValueError: could not convert string to float: '26,2'
29.2 $1.50
ValueError: could not convert string to float: '$1.50'
1.50 math.py/6
ValueError: could not convert string to float: 'math.py/6'
3.14
SLIDE 15
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
SLIDE 16
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
- input_b
input_a
- input_c
input_a
SLIDE 17
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
SLIDE 18
abcd *d%# #*%*d*%
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
SLIDE 19
abcd *d%# #*%*d*%
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array) KeyError: '#'
SLIDE 20
abcd *d%# #*%*d*%
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array) KeyError: '#'
abcd *d%# abcd
SLIDE 21
SLIDE 22
P
- P : program code
- I : token_sequence
- M : string
- T : string → Mutation
- R : set of Mutations
- N : ℕ
SLIDE 23
Error-message template applies? Apply error message template to I Duplicate I? Apply random mutation to I Run P(I) Inputs: program P, buggy input I, error message M Return minimized I, the repaired input! M
SLIDE 24
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
Current Input Error Message Action abcd *d%# #*%*d*% KeyError: '#'
SLIDE 25
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
Current Input Error Message Action abcd *d%# #*%*d*% KeyError: '#' Random Mutation: Remove random token abcd *d%#
SLIDE 26
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
Current Input Error Message Action abcd *d%# #*%*d*% KeyError: '#' Random Mutation: Remove random token abcd *d%# EOFError
SLIDE 27
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
Current Input Error Message Action abcd *d%# #*%*d*% KeyError: '#' Random Mutation: Remove random token abcd *d%# EOFError Error Message template: Generate new token - either random or from bad input abcd *d%# abcd
SLIDE 28
input_a = input() input_b = input() input_c = input() c_array = [] dictionary = {} for i in range(len(input_a)): dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)
Current Input Error Message Action abcd *d%# #*%*d*% KeyError: '#' Random Mutation: Remove random token abcd *d%# EOFError Error Message template: Generate new token - either random or from bad input abcd *d%# abcd Success!
SLIDE 29
SLIDE 30
SLIDE 31
SLIDE 32
Year Number of Input-Related Bugs 2015 1,640 2016 4,440 2017 6,949 2018 12,723 Total 25,995
SLIDE 33
SLIDE 34
Research Question Evaluation Metric Success Criterion RQ1: How effective is InFix? % Inputs repaired >= 80% (Ahmed et al., 2018) RQ2: How high quality are InFix's repairs? Statement coverage >= 75% (Tillmann et al., 2008) Human subjective assessment of quality >= 75% the quality of human patches (Kim et al., 2013)
SLIDE 35
- ○
- ○
○
- ○
○
SLIDE 36
Input-Error Scenarios Probes to Solve Time (sec) Year Total Repaired % Med Avg Med Avg 2015 1,640 1,582 96.5 1 2.98 0.87 1.12 2016 4,440 4,683 94.8 2 3.23 0.88 1.16 2017 6,949 6,590 94.8 2 3.47 0.90 1.23 2018 12,723 11,947 93.9 2 3.70 0.88 1.28 Total 25,995 24,559 94.5% 2 3.50 0.88 1.23
SLIDE 37
Input-Error Scenarios Probes to Solve Time (sec) Year Total Repaired % Med Avg Med Avg 2015 1,640 1,582 96.5 1 2.98 0.87 1.12 2016 4,440 4,683 94.8 2 3.23 0.88 1.16 2017 6,949 6,590 94.8 2 3.47 0.90 1.23 2018 12,723 11,947 93.9 2 3.70 0.88 1.28 Total 25,995 24,559 94.5% 2 3.50 0.88 1.23
SLIDE 38
Input-Error Scenarios Probes to Solve Time (sec) Year Total Repaired % Med Avg Med Avg 2015 1,640 1,582 96.5 1 2.98 0.87 1.12 2016 4,440 4,683 94.8 2 3.23 0.88 1.16 2017 6,949 6,590 94.8 2 3.47 0.90 1.23 2018 12,723 11,947 93.9 2 3.70 0.88 1.28 Total 25,995 24,559 94.5% 2 3.50 0.88 1.23
SLIDE 39
Input-Error Scenarios Probes to Solve Time (sec) Year Total Repaired % Med Avg Med Avg 2015 1,640 1,582 96.5 1 2.98 0.87 1.12 2016 4,440 4,683 94.8 2 3.23 0.88 1.16 2017 6,949 6,590 94.8 2 3.47 0.90 1.23 2018 12,723 11,947 93.9 2 3.70 0.88 1.28 Total 25,995 24,559 94.5% 2 3.50 0.88 1.23
SLIDE 40
Input-Error Scenarios Probes to Solve Time (sec) Year Total Repaired %Repaired Med Avg Med Avg 2015 1,640 1,582 96.5 1 2.98 0.87 1.12 2016 4,440 4,683 94.8 2 3.23 0.88 1.16 2017 6,949 6,590 94.8 2 3.47 0.90 1.23 2018 12,723 11,947 93.9 2 3.70 0.88 1.28 Total 25,995 24,559 94.5% 2 3.50 0.88 1.23
SLIDE 41
SLIDE 42
- ○
SLIDE 43
- ○
○
SLIDE 44
SLIDE 45
- ○
- ○
SLIDE 46
SLIDE 47
- p = 0.047)
- ○
○
- ○
○
SLIDE 48
SLIDE 49
p
SLIDE 50
SLIDE 51
- ○
○
- ○
○
- ○
○
SLIDE 52
- ○
○
- ○
○
- ○
○
SLIDE 53
T
ValueError: invalid literal for int() with base 10: 'x' 'x' ValueError: could not convert string to float: 'x' 'x' ValueError: too many / not enough values to unpack EOFError: EOF when reading a line
SLIDE 54
R
Insert a token Split delimited list Swap a token Remove a token Empty the input
SLIDE 55
SLIDE 56
- ValueError
○ ValueError: invalid literal for int ○ ValueError: could not convert string to float ○ ValueError: not enough/too many values to unpack
SLIDE 57
SLIDE 58
Number of Threads 1 2 3 4 5 1 30.8% 36.4% 39.9% 42.6% 44.6% 5 64.1% 72.7% 77.3% 80.3% 82.6% 10 73.6% 81.0% 84.5% 86.7% 88.4% 20 80.5% 86.1% 88.8% 90.6% 91.7% 30 83.1% 88.2% 90.5% 92.0% 93.0% 60 86.7% 91.0% 92.7% 93.8% 94.5% 500 92.5% 94.5% 95.3% 95.8% 96.1% Maximum Number of Probes
SLIDE 59
Number of Threads 1 2 3 4 5 1 30.8% 36.4% 39.9% 42.6% 44.6% 5 64.1% 72.7% 77.3% 80.3% 82.6% 10 73.6% 81.0% 84.5% 86.7% 88.4% 20 80.5% 86.1% 88.8% 90.6% 91.7% 30 83.1% 88.2% 90.5% 92.0% 93.0% 60 86.7% 91.0% 92.7% 93.8% 94.5% 500 92.5% 94.5% 95.3% 95.8% 96.1% Maximum Number of Probes
SLIDE 60
Number of Threads 1 2 3 4 5 1 30.8% 36.4% 39.9% 42.6% 44.6% 5 64.1% 72.7% 77.3% 80.3% 82.6% 10 73.6% 81.0% 84.5% 86.7% 88.4% 20 80.5% 86.1% 88.8% 90.6% 91.7% 30 83.1% 88.2% 90.5% 92.0% 93.0% 60 86.7% 91.0% 92.7% 93.8% 94.5% 500 92.5% 94.5% 95.3% 95.8% 96.1% Maximum Number of Probes
SLIDE 61
- ○
○ ○
- ○
○ k = 0.71 Helpfulness of InFix’s repairs depending on experience:
SLIDE 62