MemStep: An Interactive Tool for Constructing and Visualizing the Run-Time Memory Layout of Java Programs

Michelle Le Pham, A.-T. Nguyen, Rebecca Schreib · 2024

Novice programmers often struggle to build accurate mental models of computation, which hinders their ability to understand, debug, and optimize programs. This paper presents MemStep, an interactive visualization tool designed to help students develop robust and accurate mental models of computation. MemStep enables students to "step'' through the execution of Java programs and visualize the run-time layout of memory. It actively involves students in the process of constructing these visualizations by requiring that they identify each memory operation --- such as allocating an object on the heap, allocating a new stack frame, or adding a variable to the stack --- that occurs during the execution of each line of code. When a student correctly completes an operation, the stack or heap is visually updated to reflect the operation that was performed. If a student makes a mistake, they receive targeted feedback and can retry until they reach the correct answer. MemStep was piloted in a sophomore-level course on program design and evaluated using a controlled experiment, where it was found to be at least as effective and more engaging as compared to traditional learning activities.

Read the paper · More papers on PaperTik