How do Codecademy's The online Python Tutor interpreter 45 - - PowerPoint PPT Presentation

how do codecademy s the online python tutor interpreter
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1
slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
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
SLIDE 5

input()

slide-6
SLIDE 6

input()

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10

u = 42 x = float(input()) print(x * math.e / 2)

slide-11
SLIDE 11

26,2

u = 42 x = float(input()) print(x * math.e / 2)

slide-12
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
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
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
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
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
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
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
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
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 21
slide-22
SLIDE 22

P

  • P : program code
  • I : token_sequence
  • M : string
  • T : string → Mutation
  • R : set of Mutations
  • N : ℕ
slide-23
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
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
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
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
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
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 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
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 33
slide-34
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 35

slide-36
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
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
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
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
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 41
slide-42
SLIDE 42
slide-43
SLIDE 43

slide-44
SLIDE 44
slide-45
SLIDE 45
slide-46
SLIDE 46
slide-47
SLIDE 47
  • p = 0.047)

slide-48
SLIDE 48
slide-49
SLIDE 49

p

slide-50
SLIDE 50
slide-51
SLIDE 51

slide-52
SLIDE 52

slide-53
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
SLIDE 54

R

Insert a token Split delimited list Swap a token Remove a token Empty the input

slide-55
SLIDE 55
slide-56
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 57
slide-58
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
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
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
SLIDE 61

○ ○

○ k = 0.71 Helpfulness of InFix’s repairs depending on experience:

slide-62
SLIDE 62