Gerdt P. (2007)
A System for the Automatic Detection of Variable Roles
Licenciate Thesis, Department of Computer Science, University of Joensuu, Finland.
Abstract: The roles of variables are a new concept developed by Sajaniemi in 2002 when he was looking for a way to convey programming knowledge to novice programmers. The roles has been successfully utilized in teaching programming to novices, and they can provide experts with an approach to analysing and processing large-scale programs.
In this thesis we present the ADVR system, a machine learning application that automatically detects a subset of the roles. An essential feature of the ADVR system is the use of a set of flow characteristics (FCs), which are algorithmically defined descriptions of variable behavior. The ADVR system is based on a dual machine learning process: In the learning mode the ADVR system is given a set of programs along with role information for the variables in the programs. The ADVR system detects what FCs the variables have, replace the variable with the role of the variable, and thus creates role-FC profiles. The ADVR system stores the role-FC profiles in a role-FC database.
In the matching mode the ADVR system examines what FCs apply to each of the variables of the programs that it gets as input. The FC detection process produces variable-FC profiles, which are sets of FCs that apply for each of the variables. The ADVR system does not get variable role information as input in the matching mode, instead it consults its role-FC database: the system finds roles for the variables by comparing role-FC profiles and variable-FC profiles.
We have evaluated the ADVR system by making the system detect roles for a set of programs from three programming textbooks. The correct roles were provided by researchers. The ADVR system detected 93.3 % of the roles correctly. From the promising evaluation results we conclude that the FC-based automatic detection of variable roles is feasible, and that the set of FCs seems to be adequate for the task.
Last updated: March 29, 2007