Improving Code Comprehension through Cognitive-Load Aware Automated Refactoring for Novice Programmers
Abstract
Improving Code Comprehension through Cognitive-Load Aware Automated Refactoring for Novice Programmers The package includes datasets, refactoring scripts, experimental results, and survey materials used in the study. release/├── dataset/│ ├── apps-5000.csv│ └── mbpp.csv├── prompts/│ ├── baseline-Prompt.md│ └── CDDRefactorER-Prompt.md├── results/│ ├── apps-baseline-gpt-5-nano.csv│ ├── apps-baseline-kimi-k2.csv│ ├── apps-refactor-cdd-gpt-5-nano.csv│ ├── apps-refactor-cdd-kimi-k2.csv│ ├── mbpp-baseline-gpt-5-nano.csv│ ├── mbpp-baseline-kimi-k2.csv│ ├── mbpp-refactor-cdd-gpt-5-nano.csv│ └── mbpp-refactor-cdd-kimi-k2.csv├── scripts/│ ├── baseline_llm.py│ ├── baseline_llm_ollama.py│ ├── cdd_refactor_llm.py│ ├── cdd_refactor_llm_ollama.py│ ├── metric-codebleu.py│ └── metric-complexity.py└── survey/ ├── task_list.csv ├── pre-test survey questions.md ├── post-test survey questions.md └── Code Comprehension Study – Participant Instructions.pdf The project evaluates baseline and refactoring oriented prompting strategies for code generation and refactoring tasks. It uses programming benchmarks and applies automated metrics alongside a human code comprehension study. Two task settings are covered: Baseline code generation or refactoring. CDD based refactoring with an emphasis on readability and maintainability. Datasets Located in release/dataset/. apps-5000.csvA subset of programming problems derived from the APPS benchmark. mbpp.csvProblems from the MBPP benchmark, commonly used for evaluating code generation and reasoning. Each dataset is provided in CSV format and is consumed directly by the experiment scripts. Prompts Located in release/prompts/. baseline-Prompt.mdPrompt template for the baseline condition. CDDRefactorER-Prompt.mdPrompt template for the CDD refactoring condition, focused on improving code clarity and structure. Scripts Located in release/scripts/. baseline_llm.py and baseline_llm_ollama.pyRun baseline experiments using API based or Ollama based model execution. cdd_refactor_llm.py and cdd_refactor_llm_ollama.pyApply the CDD refactoring prompt to code samples. metric-codebleu.pyComputes CodeBLEU scores for generated or refactored code. metric-complexity.pyComputes code complexity related metrics. Scripts are written in Python and assume datasets and prompts are referenced via relative paths. Results Located in release/results/. Result files are CSVs containing model outputs and evaluation metrics for: Dataset type: APPS or MBPP Method: baseline or CDD refactor Model variant Each file corresponds to a specific experimental configuration.
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 26 January 2026