Detecting Overcomplicated Conditions in Student Code AutomaticallyGlobal
Code quality is an important component of programming practice, so it is essential to teach it to programming learners. Conditional statements, one of the first programming constructs novices encounter, can already exhibit numerous issues. However, identifying these issues manually and explaining them to novices is time-consuming, and many of their variations lack automatic detection methods. In this work, we introduce five issues found in novice code and present automatic detectors for each. Our detectors leverage a satisfiability-modulo-theory solver called Z3 to determine whether a set of conditions is satisfiable, enabling the identification of unnecessary or redundant conditions. Lastly, we analyze the prevalence of these issues in a large dataset of novice code.