CrossCode: Multi-level Visual Representations of Computer Program Execution

Interactive Data VisualizationProgramming Education & Computational ThinkingSoftware Engineers & DevelopersHCI Researchers

Title of the Paper

CrossCode: Multi-level Visualization of Program Execution

Paper Information

  • Subject Area: Program Visualization, Software Engineering, Code Debugging
  • Keywords: Program Visualization, Multi-level Abstraction, Debugging Tools, Control Flow, Data Flow, Code Execution Tracking, JavaScript, Visualization Design Patterns, Cognitive Models, Human-Computer Interaction

Research Background and Problem

  • What problems or challenges did the authors identify?

    1. Existing program visualization tools, such as Python Tutor, provide fixed granularity (e.g., primarily line-by-line display) and lack flexible support for different abstraction levels.
    2. Programmers often need to switch between low-level details (e.g., variable values) and high-level abstractions (e.g., algorithm behavior) when understanding code, but current tools provide limited support for this.
    3. Algorithm animation visualizations are highly specialized and cannot be generally adapted to ordinary program code.
  • Why is this problem important? Understanding the execution process of a program is critical not only for debugging and development but also for reducing the cognitive load on programmers during learning. Effective program visualization methods can help programmers reduce cognitive burden and identify problems more quickly.

  • Research Motivation and Related Work

    1. Cognitive models of program comprehension indicate that programmers need to process multiple levels of abstraction to effectively debug and communicate code behavior.
    2. Previous studies have developed various program visualization tools and algorithm animations, but they are limited in generalizability and interactivity.
    3. The authors aim to design a system that adapts to programmers' needs, enabling dynamic navigation across multiple abstraction levels.

Solution

  • What methods or solutions did the authors propose?

    1. Multi-level visualization of program behavior with support for dynamic navigation.
    2. Proposed three design patterns: Aggregate Operations, Abbreviate Repetitive Operations, and Provide an Overview of Execution Space.
    3. Developed CrossCode, a JavaScript program visualization tool supporting multi-level abstraction representation, guided by syntax tree structures and data flow.
  • What are the innovative aspects of this solution?

    1. Dynamically aggregates different abstraction levels of code execution, allowing seamless switching between algorithm-level and line-by-line details.
    2. Combines control flow and data flow to provide execution context for programmers, enhancing code understanding through visual cues such as animations, color coding, and data tracing.
    3. Automates the simplification of repetitive execution representations (e.g., loops and recursion), improving the scalability of visualizing complex programs.
  • What are the implementation steps and key technologies used?

    1. Control Flow View: Generates abstract execution steps using the code syntax tree and provides special representations (e.g., loops, function calls).
    2. Data View: Externalizes runtime states, displaying data flow changes with color coding, animations, and traces.
    3. Source Code View: Synchronizes with the control flow view to display the current execution step.
    4. Dynamic Analysis and Custom Interpreter: Developed a custom interpreter using a subset of TypeScript and JavaScript to track and generate control flow and data.

Research Outcomes

  • What specific outcomes were achieved?

    1. Developed the CrossCode tool, which supports multi-level program visualization.
    2. Refined three design patterns that systematically enhance program visualization effectiveness.
    3. Exploratory user studies showed that compared to line-by-line tracing tools (e.g., Python Tutor), CrossCode helps users more effectively locate errors, maintain context, and explain algorithms.
  • What advantages does it have over existing solutions?

    1. Flexibility in navigating across multiple abstraction levels.
    2. Context preservation through linked views, reducing cognitive load during debugging.
    3. Automated simplification of repetitive operations (loops, recursion), improving visual clarity.
  • What were the experimental or evaluation results?

    • Results from user studies:
      1. Experts found that CrossCode provided better execution tracking context.
      2. Visualization features such as color coding and data animations helped users more easily understand complex code.
      3. Users felt the tool effectively mapped to their logical reasoning and teaching needs.
    • Qualitative analysis emphasized CrossCode's respect for users' cognitive processes.
  • Limitations and Future Directions

    1. The current supported subset of JavaScript is limited and does not include more advanced object-oriented features (e.g., classes, prototype inheritance).
    2. Users expressed a need for improved synchronization between control flow and data flow views.
    3. Future research directions:
      • Extend to more complex programming paradigms such as multithreading and asynchronous programming.
      • Optimize abstraction methods through data dependency analysis.
      • Enhance user experience with navigation suggestions and interactive previews.

Quick Actions

Share

Share this page

ios_share

https://hci.top/en/papers/chi/95805/2023

AdRecommended

Learn AI Coding at CodeNow

open_in_newOpen DOI Link
DOI: https://doi.org/10.1145/3544548.3581390
At a Glance

Paper Snapshot

fact_check
dataset
Source
CHI
calendar_month
Year
2023
emoji_events
Award
No award tagged
group
Authors
3 authors
sell
Subtopics
Interactive Data Visualization, Programming Education & Computational Thinking
work
Professions
Software Engineers & Developers, HCI Researchers
article
Content Status
Full text indexed
hub
Related Papers
10 related papers