Novice programmers might benefit from code refactoring, but refactoring tools are mostly available in development environments requiring more experience than most novices possess. This paper describes a project to augment a pedagogically appropriate development environment with refactoring tools so novices may benefit from code refactoring. The result is a development environment for a Scheme-based language that more or less automatically corrects typically awkward novice code sequences and imparts a sense of acceptable code style.
The three project tasks described are selecting the refactorings to provide, implementing the refactoring using development environment facilities, and presenting the refactoring tools in a helpful way. A review of prior efforts fixes an implementation based on abstract syntax trees and def-use chains. An analysis of the features and tools available in DrRacket, the target development environment, adds more implementation details involving macro expansion and code manipulation as well as workarounds for the lack of specific type information. The refactorings implemented are bounded by implementation capabilities and the refactorings most useful to novices, which are mostly code simplifications. Presenting the refactorings to novices is the trickiest task, and represents a fertile ground for further work. Evaluation of student examples shows the refactorings are helpful, particularly with respect to improving poorly structured code.
The paper is well organized, short, and easy to read. The bibliography is to the point. Readers interested in implementation matters are best served by the paper; readers interested in pedagogic matters will find the paper mildly provocative.