How Teachers Would Help Students to Improve Their Code

Code quality has been receiving less attention than program correctness in both the practice of and research into programming education. Writing poor quality code might be a sign of carelessness, or not fully understanding programming concepts and language constructs. Teachers play an important role in addressing quality issues, and encouraging students to write better code as early as possible. In this paper we explore to what extent teachers address code quality in their teaching, which code quality issues they observe and how they would help novices to improve their code. We presented student code of low quality to 30 experienced teachers and asked them which hints they would give and how the student should improve the code step by step. We compare these hints to the output of professional code quality tools. Although most teachers gave similar hints on reducing the algorithmic complexity and removing clutter, they gave varying subsets of hints on other topics. We found a large variety in how they would solve issues in code. We noticed that professional code quality tools do not point out the algorithmic complexity topics that teachers mention. Finally, we give some general guidelines on how to approach code improvement.

[1]  Johan Jeuring,et al.  Code Quality Issues in Student Programs , 2017, ITiCSE.

[2]  Kirsti Ala-Mutka,et al.  Journal of Information Technology Education Supporting Students in C++ Programming Courses with Automatic Program Style Assessment Supporting Students on C++ Programming Courses , 2022 .

[3]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[4]  Mauricio A. Saca Refactoring improving the design of existing code , 2017, 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII).

[5]  Erik Barendsen,et al.  Designing a rubric for feedback on code quality in programming courses , 2016, Koli Calling.

[6]  Armando Fox,et al.  Teaching Students to Recognize and Implement Good Coding Style , 2017, L@S.

[7]  Johan Jeuring,et al.  "I know it when I see it" Perceptions of Code Quality: ITiCSE '17 Working Group Report , 2018, ITiCSE-WGR.

[8]  Susan Mengel,et al.  An Empirical Study of Iterative Improvement in Programming Assignments , 2015, SIGCSE.

[9]  Yizhou Qian,et al.  Students’ Misconceptions and Other Difficulties in Introductory Programming , 2017, ACM Trans. Comput. Educ..

[10]  Naveed Arshad,et al.  Reflections on Teaching Refactoring: A Tale of Two Projects , 2015, ITiCSE.

[11]  Mohammad El-Ramly,et al.  The LAN-simulation: A Research and Teaching Example for Refactoring , 2005 .

[12]  Johan Jeuring,et al.  "I know it when I see it": Perceptions of Code Quality , 2017, ITiCSE.

[13]  Neil Brown,et al.  Novice Java Programming Mistakes , 2017, ACM Trans. Comput. Educ..

[14]  Mohammad El-Ramly,et al.  The LAN-simulation: a refactoring teaching example , 2005, Eighth International Workshop on Principles of Software Evolution (IWPSE'05).

[15]  Stephen Nutbrown,et al.  Static analysis of programming exercises: Fairness, usefulness and a method for application , 2016, Comput. Sci. Educ..

[16]  Jacob Brunekreef,et al.  Measuring static quality of student code , 2011, ITiCSE '11.

[17]  Suzanne Smith,et al.  An innovative approach to teaching refactoring , 2006, SIGCSE '06.

[18]  Marie Nordström,et al.  On the Quality of Examples in Introductory Java Textbooks , 2011, TOCE.

[19]  Steve McConnell,et al.  Code complete - a practical handbook of software construction, 2nd Edition , 1993 .

[20]  Ewan D. Tempero,et al.  Understanding semantic style by analysing student code , 2018, ACE.

[21]  Ewan D. Tempero,et al.  On the differences between correct student solutions , 2013, ITiCSE '13.

[22]  J. Eliot B. Moss,et al.  FrenchPress Gives Students Automated Feedback on Java Program Flaws , 2015, ITiCSE.

[23]  Suzanne Smith,et al.  Teaching students to build well formed object-oriented methods through refactoring , 2007, SIGCSE.