Code Structuring Framework for Procedural Programs

In this paper, we formalize the structuring of procedural programs as a combination of features along three dimentions that drive the complexity (and difficulty) of the refactoring. This website offers an interactive tool to explore the proposed framework with examples for different feature combinations. On the bottom of this page, there is a brief summary of the three dimentions of the framework and their corresponding features. For more details refer to the paper.

Move the sliders to select different features:

Repetition describes how similar logic appears in code:
  • None: No repeated patterns
  • Identical: Exact same logic repeated
  • Variable Included: Similar logic with minor variations
  • Variable Scaled: Same pattern at different scales/magnitudes
None Identical Variable Included Variable Scaled
Code Pattern describes how code blocks are organized:
  • None: Single unified code block
  • Concatenation: Separate sequential operations
  • Inclusion: One operation contains or wraps another
  • Interleaved: Operations alternate or merge together
None Concatenation Inclusion Interleaved
Data Dependency describes how operations relate to each other through data:
  • None: Operations are independent
  • Sequential: Second operation depends on first's output
  • Non-sequential: Operations process same data independently
  • Shared: Multiple operations need the same computed values
None Sequential Non-sequential Shared
Prompt: Loading...
Explanation: Loading...

Raw

Loading...

Decomposed

Loading...

Code Structuring Dimensions

Repetition

Describes how similar logic appears in code:

  • None: Each operation is unique with no duplication
  • Identical: Identical code repeated multiple times
  • Variable Included: Similar code with parameter variations
  • Variable Scaled: Similar code that scales with parameter variations

Code Pattern

Describes the structural organization of code:

  • None: Single code pattern (block of code with specific functionality)
  • Concatenation: Multiple code patterns in a sequential order
  • Inclusion: One code pattern wraps or contains another
  • Interleaved: Code patterns merge or alternate within same code structure

Data Dependency

Describes how operations relate through data flow:

  • None: No variables shared between different code structures
  • Sequential: Variables from a code structure feed into the next
  • Non-sequential: Variables from multiple code structures sink into one code structure
  • Shared: Variables from one code pattern feed into multiple code patterns

This website was developed with the help of Colgate University student Raghav Raj Sah, graduating class of 2026.