{'fraction_non_alphanumeric': 0.02232518955349621, 'fraction_numerical': 0.008003369839932602, 'mean_word_length': 5.316489361702128, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An approach to automatic detection of variable roles in program animation

Many students have difficulties in learning to program computers. One reason that makes computer programming a difficult skill to learn is that programs deal with abstract entities, that are unrelated to everyday things. Visualization and animation is a way to make both programming language constructs and program constructs more comprehensible (Hundhausen and Stasko, 2002; Mulholland, 1998). Petre and Blackwell (1999) note that visualizations should not work in the programming language level because within-paradigm visualizations, i.e., those dealing with programming language constructs, are uninformative. Hence students learning to program benefit more from visualization of higher-level program constructs than visualization of language-level constructs. Sajaniemi (2002) has introduced the concept of the roles of variables which he obtained as a result of a search for a comprehensive, yet compact, set of characterizations of variables that can be used, e.g., for teaching programming and analyzing large-scale programs. A role characterizes the dynamic nature of a variable embodied by the sequence of its successive values as related to other variables and external events. A role is not a unique task in some specific program but a more general concept occurring in programs over and over again. Table 1 gives ten roles covering 99 % of variables in novice-level, procedural programs. Roles can be utilized in program animation to provide automatic animation of concepts that are at a higher level than simple programming language concepts. In a classroom experiment (Sajaniemi and Kuittinen, in press), traditional teaching of elementary programming was compared with role-based teaching and animation. The results suggest that the introduction of roles provides students with a new conceptual framework that enables them to mentally process program information in a way similar to that of good code comprehenders. Moreover, the use of role-based animation seems to assist in the adoption of role knowledge and expert-like programming strategies. In this paper, we will present the role concept and the role-based program animator PlanAni, and discuss possibilities to implement automatic role analysis that is needed in order to automatically animate programs provided by students.