What is it about?

The article compares the knowledge of introductory (CS1) and intermediate (CS2) students on two crucial code structure topics: 1) "directly returning boolean expressions instead of using if statements to return boolean literals" and 2) "unique vs. repeated code within if and else." This comparison is conducted through various assessment lenses. Our assessment encompasses the following tasks: Code writing: Requesting students to write short code targeting the mentioned topics. Code editing: Providing students with code containing structure violations and asking them to refactor it. Code tracing: Asking students to determine the output of correctly structured code for given inputs. Code readability: Presenting students with code blocks featuring the same functionality but different structures and asking them to select the structure they find easier to read. Identification of correct structure: Presenting students with code blocks having the same functionality but different structures and asking them to identify the structure preferred by an expert programmer. We discovered that CS2 students significantly outperformed CS1 students in most tasks and for both topics. The difference in the percentage of correct responses between CS2 and CS1 students ranged from 0.5% in code editing of unique vs. repeated code (not statistically significant) to 21% in the identification of the correct structure for directly returning boolean expressions, indicating that growth in student knowledge is not uniform across different tasks. In addition, we found that even CS2 students' performance was far below ceiling, particularly in code editing, code writing, and code readability tasks, where a large majority of students could not implement the correct structure or did not consider it the most readable. Overall, this study indicates that, while student knowledge of code structure may improve sufficiently in some aspects, such as the identification of the correct structure, over a semester of regular instruction where examples of correct and incorrect code structure usage are provided, it is insufficient for students to correctly implement code structure topics.

Featured Image

Why is it important?

This study responds to the essential question of whether student knowledge of code structure naturally grows as they gain programming experience. We found that student knowledge of code structure encompasses various skills. Regular instruction in code structure, which focuses on illustrating instances of correct and incorrect code structures to students, may be sufficient for some skills ( such as identification of correct structure) but falls short in other areas that require students to implement correct structures. Our findings are relevant not only to code quality research but also to all research on assessing student knowledge of programming as it indicated that using different tasks to assess student knowledge provided a more complete picture of what they know and where they struggle—an insight that was not attainable when examining student knowledge through a single task such as code writing.

Read the Original

This page is a summary of: Growth in Knowledge of Programming Patterns: A Comparison Study of CS1 vs. CS2 Students, March 2024, ACM (Association for Computing Machinery),
DOI: 10.1145/3626252.3630865.
You can read the full text:

Read

Contributors

The following have contributed to this page