Roles of Variables in Object-Oriented Programming
San Diego Room
Monday, 11:35, 20 minutes
Petri Gerdt, University of Joensuu, Department of Computer Science
Pauli Byckling, University of Joensuu, Department of Computer Science
Jorma Sajaniemi, University of Joensuu, Department of Computer Science
Roles can be assigned to occurrences of variables in programs according to a small number of patterns of use that are both language- and algorithm-independent. Studies on explicitly teaching roles of variables to novice students have shown that roles are an excellent pedagogical tool for clarifying the structure and meaning of programs. This paper describes the results of an investigation designed to test the understandability and acceptability of the role concept and of the individual roles in novice-level object-oriented programming.
The investigation consisted of a short tutorial on roles, a brief training session on assigning roles to variables, a test evaluating the subjects' ability to assign roles, and a set of open questions concerning their opinions of roles. The responses of 43 computer science educators were analyzed. Every role was identified at least by 50% accuracy, and in typical uses of variables by 70-100% accuracy. Subjects' comments on the role concept in general were mostly positive. The role set used in the investigation turned out to be suitable for describing variable usage in novice-level programming with some supplements. The study suggests that more roles are needed in novice-level object-oriented programming than in novice-level procedural programming.