Enhancing Programming Education for Lower-Performing Students through DSL-Based Problem GenerationGlobal
Programming courses report high failure rates, particularly among students who rely on surface-level pattern recognition rather than developing conceptual understanding. While large language models offer problem generation automation, they present limitations including unpredictable quality and limited instructor control. This paper proposes a domain-specific language (DSL) that extracts generation strategies from LLMs and formalizes them into a controllable system for creating diverse programming exercises. Our DSL uses XML-style tags in code comments to specify probabilistic transformations while preserving instructor oversight. We conducted a quasi-experimental study with 86 students comparing DSL-generated exercises against static problems. Results showed significant overall improvement (p = 0.0186), with pronounced benefits for lower-performing students (p = 0.0230) but no difference for higher performers. Post-study interviews revealed that DSL diversity forces students to abandon superficial pattern recognition while automating accurate conceptual understanding. These findings suggest systematic problem diversity effectively supports struggling learners by preventing rote memorization and encouraging genuine code comprehension.