Skip to main content
Top

2019 | OriginalPaper | Chapter

Syntactic Generation of Practice Novice Programs in Python

Author : Abejide Ade-Ibijola

Published in: ICT Education

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

In the present day, computer programs are written in high level languages and parsed syntactically as part of a compilation process. These parsers are defined with context-free grammars (CFGs), a language recogniser for the respective programming language. Formal grammars in general are used for language recognition or generation. In this paper we present the automatic generation of procedural programs in Python using a CFG. We have defined CFG rules to model program templates and implemented these rules to produce infinitely many distinct practice programs in Python. Each generated program is designed to test a novice programmer’s knowledge of functions, expressions, loops, and/or conditional statements. The CFG rules are highly generic and can be extended to generate programs in other procedural languages. The resulting programs can be used as practice, test or examination problems in introductory programming courses. 500,000 iterations of generated programs can be found at: https://​tinyurl.​com/​pythonprogramgen​erator. A survey of 103 students’ perception showed that 93.1% strongly agreed that these programs can help them in practice and improve their programming skills.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Footnotes
1
Electives are courses not in the mainstream of the offered degree. An example is a student studying towards a Bachelor’s degree in Chemistry, who takes an introductory programming course in Python.
 
2
Java ranked first.
 
Literature
2.
go back to reference Ade-Ibijola, A.: Synthesis of social media profiles using a probabilistic context-free grammar. In: PRASA-RobMech 2017, Proceedings of Pattern Recognition Association of South Africa and Robotics and Mechatronics, pp. 104–109. IEEE (2017) Ade-Ibijola, A.: Synthesis of social media profiles using a probabilistic context-free grammar. In: PRASA-RobMech 2017, Proceedings of Pattern Recognition Association of South Africa and Robotics and Mechatronics, pp. 104–109. IEEE (2017)
3.
go back to reference Ade-Ibijola, A., Ewert, S., Sanders, I.: Abstracting and narrating novice programs using regular expressions. In: SAICSIT 2014, Proceedings of Annual Conference of the South African Institute for Computer Scientist and Information Technologists, pp. 19–28. ACM (2014) Ade-Ibijola, A., Ewert, S., Sanders, I.: Abstracting and narrating novice programs using regular expressions. In: SAICSIT 2014, Proceedings of Annual Conference of the South African Institute for Computer Scientist and Information Technologists, pp. 19–28. ACM (2014)
4.
go back to reference Ahmed, U.Z., Gulwani, S., Karkare, A.: Automatically generating problems and solutions for natural deduction. In: Proceedings of IJCAI 2013, pp. 1968–1975 (2013) Ahmed, U.Z., Gulwani, S., Karkare, A.: Automatically generating problems and solutions for natural deduction. In: Proceedings of IJCAI 2013, pp. 1968–1975 (2013)
5.
go back to reference Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Boston (1986)MATH Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Boston (1986)MATH
6.
go back to reference Alqadi, B.S., Maletic, J.I.: An empirical study of debugging patterns among novices programmers. In: Proceedings of the 2017 ACM SIGCSE Technical Symposium on Computer Science Education, pp. 15–20 (2017) Alqadi, B.S., Maletic, J.I.: An empirical study of debugging patterns among novices programmers. In: Proceedings of the 2017 ACM SIGCSE Technical Symposium on Computer Science Education, pp. 15–20 (2017)
7.
go back to reference Baker, A., Zhang, J., Caldwell, E.R.: Reinforcing array and loop concepts through a game-like module. In: CGAMES 2012, Proceedings of 17th International Conference on Computer Games, pp. 175–179. IEEE (2012) Baker, A., Zhang, J., Caldwell, E.R.: Reinforcing array and loop concepts through a game-like module. In: CGAMES 2012, Proceedings of 17th International Conference on Computer Games, pp. 175–179. IEEE (2012)
8.
go back to reference Bergin, S., Mooney, A., Ghent, J., Quille, K.: Using machine learning techniques to predict introductory programming performance. Int. J. Comput. Sci. Softw. Eng. 4(12), 323–328 (2015) Bergin, S., Mooney, A., Ghent, J., Quille, K.: Using machine learning techniques to predict introductory programming performance. Int. J. Comput. Sci. Softw. Eng. 4(12), 323–328 (2015)
9.
go back to reference Butler, M., Morgan, M.: Learning challenges faced by novice programming students studying high level and low feedback concepts. In: Proceedings of 24th ASCILITE Conference, pp. 2–5 (2007) Butler, M., Morgan, M.: Learning challenges faced by novice programming students studying high level and low feedback concepts. In: Proceedings of 24th ASCILITE Conference, pp. 2–5 (2007)
10.
go back to reference Dale, N.B.: Most difficult topics in CS1: results of an online survey of educators. ACM SIGCSE Bull. 38(2), 49–53 (2006)MathSciNetCrossRef Dale, N.B.: Most difficult topics in CS1: results of an online survey of educators. ACM SIGCSE Bull. 38(2), 49–53 (2006)MathSciNetCrossRef
11.
go back to reference Fincher, S.: What are we doing when we teach programming? In: Proceedings of 29th Annual Frontiers in Education Conference, p. 12A4 (1999) Fincher, S.: What are we doing when we teach programming? In: Proceedings of 29th Annual Frontiers in Education Conference, p. 12A4 (1999)
12.
go back to reference Foote, S.: Learning to Program. Addison-Wesley, Boston (2014) Foote, S.: Learning to Program. Addison-Wesley, Boston (2014)
13.
go back to reference Gulwani, S., Korthikanti, V.A., Tiwari, A.: Synthesizing geometry constructions. ACM SIGPLAN Not. 46(6), 50–61 (2011)CrossRef Gulwani, S., Korthikanti, V.A., Tiwari, A.: Synthesizing geometry constructions. ACM SIGPLAN Not. 46(6), 50–61 (2011)CrossRef
14.
go back to reference Haiduc, S., Aponte, J., Marcus, A.: Supporting program comprehension with source code summarization. In: ICSE 2010, Proceedings of 32nd International Conference on Software Engineering, pp. 223–226 (2010) Haiduc, S., Aponte, J., Marcus, A.: Supporting program comprehension with source code summarization. In: ICSE 2010, Proceedings of 32nd International Conference on Software Engineering, pp. 223–226 (2010)
16.
go back to reference Iqbal-Malik, S.: Role of ADRI model in teaching and assessing novice programmers. Technical report, Deakin University (2016) Iqbal-Malik, S.: Role of ADRI model in teaching and assessing novice programmers. Technical report, Deakin University (2016)
17.
go back to reference Jenkins, T.: On the difficulty of learning to program. In: Proceedings of 3rd Annual Conference of the LTSN Centre for Information and Computer Sciences, pp. 53–58 (2002) Jenkins, T.: On the difficulty of learning to program. In: Proceedings of 3rd Annual Conference of the LTSN Centre for Information and Computer Sciences, pp. 53–58 (2002)
18.
go back to reference Johnson, W.L.: Understanding and debugging novice programs. Artif. Intell. 42(1), 51–97 (1990)CrossRef Johnson, W.L.: Understanding and debugging novice programs. Artif. Intell. 42(1), 51–97 (1990)CrossRef
19.
go back to reference Lahtinen, E., Ala-Mutka, K., Järvinen, H.M.: A study of the difficulties of novice programmers. ACM SIGCSE Bull. 37(3), 14–18 (2005)CrossRef Lahtinen, E., Ala-Mutka, K., Järvinen, H.M.: A study of the difficulties of novice programmers. ACM SIGCSE Bull. 37(3), 14–18 (2005)CrossRef
20.
go back to reference Lucariello, J.M., Nastasi, B.K., Anderman, E.M., Dwyer, C., Ormiston, H., Skiba, R.: Science supports education: the behavioral research base for psychology’s top 20 principles for enhancing teaching and learning. Mind Brain Educ. 10(1), 55–67 (2016)CrossRef Lucariello, J.M., Nastasi, B.K., Anderman, E.M., Dwyer, C., Ormiston, H., Skiba, R.: Science supports education: the behavioral research base for psychology’s top 20 principles for enhancing teaching and learning. Mind Brain Educ. 10(1), 55–67 (2016)CrossRef
21.
go back to reference Malik, S.I., Coldwell-Neilson, J.: A model for teaching an introductory programming course using ADRI. Educ. Inf. Technol. 22(3), 1089–1120 (2017)CrossRef Malik, S.I., Coldwell-Neilson, J.: A model for teaching an introductory programming course using ADRI. Educ. Inf. Technol. 22(3), 1089–1120 (2017)CrossRef
22.
go back to reference Martin, J.: Introduction to Languages and the Theory of Computation. McGraw-Hill, New York (2003) Martin, J.: Introduction to Languages and the Theory of Computation. McGraw-Hill, New York (2003)
23.
go back to reference Mathrani, A., Christian, S., Ponder-Sutton, A.: PlayIT: game based learning approach for teaching programming concepts. Educ. Technol. Soc. 19(2), 5–17 (2016) Mathrani, A., Christian, S., Ponder-Sutton, A.: PlayIT: game based learning approach for teaching programming concepts. Educ. Technol. Soc. 19(2), 5–17 (2016)
24.
go back to reference Miljanovic, M.A., Bradbury, J.S.: Robot ON!: a serious game for improving programming comprehension. In: GAS 2016, Proceedings of 5th International Workshop on Games and Software Engineeing, pp. 33–36. ACM (2016) Miljanovic, M.A., Bradbury, J.S.: Robot ON!: a serious game for improving programming comprehension. In: GAS 2016, Proceedings of 5th International Workshop on Games and Software Engineeing, pp. 33–36. ACM (2016)
25.
go back to reference Özmen, B., Altun, A.: Undergraduate students’ experiences in programming: difficulties and obstacles. Turk. Online J. Qual. Inq. 5(3), 1–27 (2014) Özmen, B., Altun, A.: Undergraduate students’ experiences in programming: difficulties and obstacles. Turk. Online J. Qual. Inq. 5(3), 1–27 (2014)
26.
go back to reference Ramalingam, V., Wiedenbeck, S.: An empirical study of novice program comprehension in the imperative and object-oriented styles. In: Proceedings of 7th Workshop on Empirical Studies of Programmers, pp. 124–139. ACM (1997) Ramalingam, V., Wiedenbeck, S.: An empirical study of novice program comprehension in the imperative and object-oriented styles. In: Proceedings of 7th Workshop on Empirical Studies of Programmers, pp. 124–139. ACM (1997)
27.
go back to reference Sadigh, D., Seshia, S.A., Gupta, M.: Automating exercise generation: a step towards meeting the MOOC challenge for embedded systems. In: Proceedings of Workshop on Embedded and Cyber-Physical Systems Education, p. 2. ACM (2012) Sadigh, D., Seshia, S.A., Gupta, M.: Automating exercise generation: a step towards meeting the MOOC challenge for embedded systems. In: Proceedings of Workshop on Embedded and Cyber-Physical Systems Education, p. 2. ACM (2012)
28.
go back to reference Shargabi, A., Aljunid, S.A., Annamalai, M., Shuhidan, S.M., Zin, A.M.: Tasks that can improve novices’ program comprehension. In: Proceedings of IEEE Conference on e-Learning, e-Management and e-Services, pp. 32–37 (2015) Shargabi, A., Aljunid, S.A., Annamalai, M., Shuhidan, S.M., Zin, A.M.: Tasks that can improve novices’ program comprehension. In: Proceedings of IEEE Conference on e-Learning, e-Management and e-Services, pp. 32–37 (2015)
29.
go back to reference Sharples, M., et al.: Innovating Pedagogy 2016. Open University Innovation Report 5 (2016) Sharples, M., et al.: Innovating Pedagogy 2016. Open University Innovation Report 5 (2016)
30.
go back to reference Siegfried, R.M., Siegfried, J., Alexandro, G.: A longitudinal analysis of the Reid list of first programming languages. Inf. Syst. Educ. J. 14(6), 47 (2016) Siegfried, R.M., Siegfried, J., Alexandro, G.: A longitudinal analysis of the Reid list of first programming languages. Inf. Syst. Educ. J. 14(6), 47 (2016)
31.
go back to reference Singh, R., Gulwani, S., Rajamani, S.K.: Automatically generating algebra problems. In: AAAI 2012, Proceedings of 26th Conference on AI (2012) Singh, R., Gulwani, S., Rajamani, S.K.: Automatically generating algebra problems. In: AAAI 2012, Proceedings of 26th Conference on AI (2012)
32.
go back to reference Storey, M., Best, C., Michand, J.: SHriMP views: an interactive environment for exploring Java programs. In: Proceedings of 9th International Workshop on Program Comprehension, pp. 111–112. IEEE (2001) Storey, M., Best, C., Michand, J.: SHriMP views: an interactive environment for exploring Java programs. In: Proceedings of 9th International Workshop on Program Comprehension, pp. 111–112. IEEE (2001)
33.
go back to reference Storey, M.A.: Theories, tools and research methods in program comprehension: past, present and future. Softw. Qual. J. 14(3), 187–208 (2006)CrossRef Storey, M.A.: Theories, tools and research methods in program comprehension: past, present and future. Softw. Qual. J. 14(3), 187–208 (2006)CrossRef
34.
go back to reference Wang, T., Su, X., Ma, P., Wang, Y., Wang, K.: Ability-training-oriented automated assessment in introductory programming course. Comput. Educ. 56(1), 220–226 (2011)CrossRef Wang, T., Su, X., Ma, P., Wang, Y., Wang, K.: Ability-training-oriented automated assessment in introductory programming course. Comput. Educ. 56(1), 220–226 (2011)CrossRef
35.
go back to reference Yadin, A.: Reducing the dropout rate in an introductory programming course. ACM Inroads 2(4), 71–76 (2011)CrossRef Yadin, A.: Reducing the dropout rate in an introductory programming course. ACM Inroads 2(4), 71–76 (2011)CrossRef
36.
go back to reference Zhang, J., Atay, M., Caldwell, E.R., Jones, E.J.: Visualizing loops using a game-like instructional module. In: ICALT 2013, Proceedings of 13th IEEE International Conference on Advanced Learning Technology, pp. 448–450 (2013) Zhang, J., Atay, M., Caldwell, E.R., Jones, E.J.: Visualizing loops using a game-like instructional module. In: ICALT 2013, Proceedings of 13th IEEE International Conference on Advanced Learning Technology, pp. 448–450 (2013)
Metadata
Title
Syntactic Generation of Practice Novice Programs in Python
Author
Abejide Ade-Ibijola
Copyright Year
2019
DOI
https://doi.org/10.1007/978-3-030-05813-5_11

Premium Partner