Do Code Smells Hamper Novice Programming

Recently, block-based programming languages like Alice, Scratch and Blockly have become popular tools for programming education. There is substantial research showing that block-based languages are suitable for early programming education. But can block-based programs be smelly too? And does that matter to learners? In this paper we explore the code smells metaphor in the context of block-based programming language Scratch. We conduct a controlled experiment with 61 novice Scratch programmers, in which we divided the novices into three groups. One third receive a non-smelly program, while the other groups receive a program suffering from the Duplication or the Long Method smell respectively. All subjects then perform the same comprehension tasks on their program, after which we measure their time and correctness. The results of the experiment show that code smell indeed influence performance: subjects working on the program exhibiting code smells perform significantly worse, but the smells did not affect the time subjects needed. Investigating different types of tasks in more detail, we find that Long Method mainly decreases system understanding, while Duplication decreases the ease with which subjects modify Scratch programs.

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

[2]  Rich Gossweiler,et al.  Alice: a rapid prototyping system for building virtual environments , 1994, CHI Conference Companion.

[3]  Marc Roper,et al.  A novel software visualisation model to support software comprehension , 2004, 11th Working Conference on Reverse Engineering.

[4]  Shinji Kusumoto,et al.  CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code , 2002, IEEE Trans. Software Eng..

[5]  Diana Franklin,et al.  Hairball: lint-inspired static analysis of scratch projects , 2013, SIGCSE '13.

[6]  Tiago L. Alves,et al.  Deriving metric thresholds from benchmark data , 2010, 2010 IEEE International Conference on Software Maintenance.

[7]  Barbara M. Moskal,et al.  Evaluating the effectiveness of a new instructional approach , 2004 .

[8]  Christopher Scaffidi,et al.  Smell-driven performance analysis for end-user programmers , 2013, 2013 IEEE Symposium on Visual Languages and Human Centric Computing.

[9]  Radu Marinescu,et al.  Detecting design flaws via metrics in object-oriented systems , 2001, Proceedings 39th International Conference and Exhibition on Technology of Object-Oriented Languages and Systems. TOOLS 39.

[10]  Gregorio Robles,et al.  Dr. Scratch: Automatic Analysis of Scratch Projects to Assess and Foster Computational Thinking , 2015 .

[11]  Arie van Deursen,et al.  Detecting and refactoring code smells in spreadsheet formulas , 2013, Empirical Software Engineering.

[12]  Michel R. V. Chaudron,et al.  Interactive Views to Improve the Comprehension of UML Models - An Experimental Validation , 2007, 15th IEEE International Conference on Program Comprehension (ICPC '07).

[13]  Kathryn T. Stolee,et al.  Refactoring pipe-like mashups for end-user programmers , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[14]  Eric Rosenbaum,et al.  Scratch: programming for all , 2009, Commun. ACM.

[15]  Thomas W. Price,et al.  Comparing Textual and Block Interfaces in a Novice Programming Environment , 2015, ICER.

[16]  Jochen Quante,et al.  Do Dynamic Object Process Graphs Support Program Understanding? - A Controlled Experiment. , 2008, 2008 16th IEEE International Conference on Program Comprehension.

[17]  Daniela Cruzes,et al.  The evolution and impact of code smells: A case study of two open source systems , 2009, 2009 3rd International Symposium on Empirical Software Engineering and Measurement.

[18]  Mordechai Ben-Ari,et al.  Learning computer science concepts with scratch , 2010, ICER '10.

[19]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[20]  Felienne Hermans,et al.  Code smells in spreadsheet formulas revisited on an industrial dataset , 2015, 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[21]  Randy F. Pausch,et al.  Teaching objects-first in introductory computer science , 2003, SIGCSE.

[22]  Gregorio Robles,et al.  Automatic detection of bad programming habits in scratch: A preliminary study , 2014, 2014 IEEE Frontiers in Education Conference (FIE) Proceedings.