Investigating Static Analysis Errors in Student Java Programs

Research on students learning to program has produced studies on both compile-time errors (syntax errors) and run-time errors (exceptions). Both of these types of errors are natural targets, since detection is built into the programming language. In this paper, we present an empirical investigation of static analysis errors present in syntactically correct code. Static analysis errors can be revealed by tools that examine a program's source code, but this error detection is typically not built into common programming languages and instead requires separate tools. Static analysis can be used to check formatting or commenting expectations, but it also can be used to identify problematic code or to find some kinds of conceptual or logic errors. We study nearly 10 million static analysis errors found in over 500 thousand program submissions made by students over a five-semester period. The study includes data from four separate courses, including a non-majors introductory course as well as the CS1/CS2/CS3 sequence for CS majors. We examine the differences between the error rates of CS major and non-major beginners, and also examine how these patterns change over time as students progress through the CS major course sequence. Our investigation shows that while formatting and Javadoc issues are the most common, static checks that identify coding flaws that are likely to be errors are strongly correlated with producing correct programs, even when students eventually fix the problems. With experience, students produce fewer errors, but the errors that are most frequent are consistent between both computer science majors and non-majors, and across experience levels. These results can highlight student struggles or misunderstandings that have escaped past analyses focused on syntax or run-time errors.

[1]  Ewan D. Tempero,et al.  All syntax errors are not equal , 2012, ITiCSE '12.

[2]  J. David Morgenthaler,et al.  Evaluating static analysis defect warnings on production software , 2007, PASTE '07.

[3]  Brian Dorn,et al.  Aggregate Compilation Behavior: Findings and Implications from 27,698 Users , 2015, ICER.

[4]  Andreas Stefik,et al.  An Empirical Investigation into Programming Language Syntax , 2013, TOCE.

[5]  Stephen H. Edwards,et al.  Web-CAT: automatically grading programming assignments , 2008, ITiCSE.

[6]  Neil Brown,et al.  37 Million Compilations: Investigating Novice Programming Mistakes in Large-Scale Student Data , 2015, SIGCSE.

[7]  Ma. Mercedes T. Rodrigo,et al.  An Analysis of Java Programming Behaviors, Affect, Perceptions, and Syntax Errors among Low-Achieving, Average, and High-Achieving Novice Programmers , 2013 .

[8]  Paul Roe,et al.  Static Analysis of Students' Java Programs , 2004, ACE.

[9]  Armin Biere,et al.  Applying static analysis to large-scale, multi-threaded Java programs , 2001, Proceedings 2001 Australian Software Engineering Conference.

[10]  Michael Kölling,et al.  Meaningful categorisation of novice programmer errors , 2014, 2014 IEEE Frontiers in Education Conference (FIE) Proceedings.

[11]  Susan A. Mengel,et al.  A case study of the static analysis of the quality of novice student programs , 1999, SIGCSE '99.

[12]  N. Nagappan,et al.  Static analysis tools as early indicators of pre-release defect density , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[13]  James B. Fenwick,et al.  Another look at the behaviors of novice programmers , 2009, SIGCSE '09.

[14]  Ma. Mercedes T. Rodrigo,et al.  Predicting at-risk novice Java programmers through the analysis of online protocols , 2011, ICER.