<p>Structured programming embraces fundamental concepts represented in most general-purpose languages: sequence, selection, repetition, assignment, procedures, and recursion. We present Strudel, an executable modeling language for structured programming designed with the needs of educational tools in mind. Instead of relying on generated source-level metadata (language-specific, as in debuggers) or program instrumentation (that transforms executables or ASTs), models of programs are retained at runtime. A model drives a simulation of program execution with direct access to its elements without abstracting details—which are useful for fine-grained error reporting and inspection. We materialized the approach in a meta-programming library where a stack-based execution of programs is simulated in an embeddable virtual machine. By programming against the virtual machine API and the meta-model, third parties can observe a wide range of execution events in detail, such as errors, reachability, state changes, loop iterations, call stack, or memory allocation, to synthesize information about program properties. We developed an educational platform for Java that translates code into Strudel models and uses Strudel’s virtual machine as the runtime environment. The platform is in production as courseware, standing as a proof of viability, and features inspection of program traces to assist experimentation and debugging (probes), white-box tests for verifying algorithmic properties, and generation of questions about code to assess comprehension.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Modeling structured programming with Strudel: a simulation runtime for programming education tools

  • André L. Santos,
  • Afonso B. Caniço

摘要

Structured programming embraces fundamental concepts represented in most general-purpose languages: sequence, selection, repetition, assignment, procedures, and recursion. We present Strudel, an executable modeling language for structured programming designed with the needs of educational tools in mind. Instead of relying on generated source-level metadata (language-specific, as in debuggers) or program instrumentation (that transforms executables or ASTs), models of programs are retained at runtime. A model drives a simulation of program execution with direct access to its elements without abstracting details—which are useful for fine-grained error reporting and inspection. We materialized the approach in a meta-programming library where a stack-based execution of programs is simulated in an embeddable virtual machine. By programming against the virtual machine API and the meta-model, third parties can observe a wide range of execution events in detail, such as errors, reachability, state changes, loop iterations, call stack, or memory allocation, to synthesize information about program properties. We developed an educational platform for Java that translates code into Strudel models and uses Strudel’s virtual machine as the runtime environment. The platform is in production as courseware, standing as a proof of viability, and features inspection of program traces to assist experimentation and debugging (probes), white-box tests for verifying algorithmic properties, and generation of questions about code to assess comprehension.