how do codecademy s the online python tutor interpreter
play

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)


  1. ● ○ ● ●

  2. How do Codecademy's The online Python Tutor interpreter 45 million users currently has 60,000 users per month learn to code?

  3. input()

  4. input()

  5. ● ● ● ● ● ●

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

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

  8. 26,2 u = 42 x = float(input()) print(x * math.e / 2) ValueError: could not convert string to float: '26,2'

  9. 26,2 29.2 u = 42 x = float(input()) print(x * math.e / 2) ValueError: could not convert string to float: '26,2'

  10. 26,2 $1.50 math.py/6 ValueError: could not ValueError: could not ValueError: could not convert string to convert string to convert string to float: '26,2' float: '$1.50' float: 'math.py/6' 29.2 1.50 3.14

  11. 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)

  12. input_a = input() input_b ● input_b = input() input_a input_c = input() c_array = [] dictionary = {} ● input_c input_a 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)

  13. 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)

  14. abcd input_a = input() *d%# input_b = input() input_c = input() #*%*d*% 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)

  15. abcd input_a = input() *d%# input_b = input() input_c = input() #*%*d*% 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]] KeyError: '#' print(c_array)

  16. abcd abcd input_a = input() *d%# *d%# input_b = input() input_c = input() #*%*d*% abcd 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]] KeyError: '#' print(c_array)

  17. ● ● ● ● ● ●

  18. ● P : program code ● I : token_sequence ● M : string P ● T : string → Mutation ● R : set of Mutations ● N : ℕ

  19. Error-message Inputs: template program P , applies? buggy input I , error message M M Apply error Apply random message mutation to I template to I Return minimized I , the repaired Duplicate I ? Run P(I) input!

  20. Current Error Action Input Message input_a = input() input_b = input() abcd KeyError: input_c = input() *d%# '#' c_array = [] #*%*d*% 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)

  21. Current Error Action Input Message input_a = input() input_b = input() Random Mutation: Remove abcd KeyError: input_c = input() random token *d%# '#' c_array = [] #*%*d*% dictionary = {} abcd for i in range(len(input_a)): *d%# dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)

  22. Current Error Action Input Message input_a = input() input_b = input() Random Mutation: Remove abcd KeyError: input_c = input() random token *d%# '#' c_array = [] #*%*d*% dictionary = {} abcd for i in range(len(input_a)): *d%# EOFError dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): c_array += dictionary[input_c[j]] print(c_array)

  23. Current Error Action Input Message input_a = input() input_b = input() Random Mutation: Remove abcd KeyError: input_c = input() random token *d%# '#' c_array = [] #*%*d*% dictionary = {} Error Message template: abcd Generate new token - either for i in range(len(input_a)): *d%# EOFError random or from bad input dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): abcd c_array += dictionary[input_c[j]] *d%# print(c_array) abcd

  24. Current Error Action Input Message input_a = input() input_b = input() Random Mutation: Remove abcd KeyError: input_c = input() random token *d%# '#' c_array = [] #*%*d*% dictionary = {} Error Message template: abcd Generate new token - either for i in range(len(input_a)): *d%# EOFError random or from bad input dictionary[input_a[i]] = input_b[i] for j in range(len(input_c)): abcd c_array += dictionary[input_c[j]] *d%# Success! print(c_array) abcd

  25. Year Number of Input-Related Bugs 2015 1,640 2016 4,440 2017 6,949 2018 12,723 Total 25,995

  26. Research Question Evaluation Metric Success Criterion RQ1: How effective is % Inputs repaired >= 80% (Ahmed et al., InFix? 2018) RQ2: How high quality Statement coverage >= 75% (Tillmann et al., are InFix's repairs? 2008) Human subjective >= 75% the quality of assessment of quality human patches (Kim et al., 2013)

  27. ● ○ ● ○ ○ ● ○ ○

  28. Probes to Solve Time (sec) Input-Error Scenarios 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

  29. Probes to Solve Time (sec) Input-Error Scenarios 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

  30. Probes to Solve Time (sec) Input-Error Scenarios 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

  31. Probes to Solve Time (sec) Input-Error Scenarios 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

  32. Probes to Solve Time (sec) Input-Error Scenarios 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

  33. ● ○ ●

  34. ● ○ ○ ● ●

  35. ● ● ● ● ●

  36. ● ● ● ● ○ ● ● ○

  37. ● ●

  38. ● p = 0.047) ● ○ ○ ● ○ ○

  39. p

  40. ● ○ ○ ● ○ ○ ● ○ ○

  41. ● ○ ○ ● ○ ○ ● ○ ○

  42. T ValueError: invalid literal for int() 'x' with base 10: 'x' ValueError: could not convert string to 'x' float: 'x' ValueError: too many / not enough values to unpack EOFError: EOF when reading a line

  43. R Insert a token Split delimited list Swap a token Remove a token Empty the input

  44. ● ● ● ValueError ○ ValueError: invalid literal for int ○ ValueError: could not convert string to float ○ ValueError: not enough/too many values to unpack

  45. Number of Threads 1 2 3 4 5 1 30.8% 36.4% 39.9% 42.6% 44.6% Maximum Number of Probes 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%

  46. Number of Threads 1 2 3 4 5 1 30.8% 36.4% 39.9% 42.6% 44.6% Maximum Number of Probes 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%

  47. Number of Threads 1 2 3 4 5 1 30.8% 36.4% 39.9% 42.6% 44.6% Maximum Number of Probes 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%

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

Recommend


More recommend