模範解答を用いた構造エラー箇所の指摘手法
書誌事項
- タイトル別名
-
- A Method to Detect Structure Errors Using a Model Program
この論文をさがす
説明
プログラミング初学者にとって,コンパイルエラーやデバッグを,コンパイラが出力するエラーメッセージや実行結果のみから解決することは難しく,エラーが解決できないと,学習者がプログラミングに対する興味を喪失する可能性がある.本発表では,C言語を対象に,演習形式の授業など,模範解答が準備されている場面を想定し,コンパイラが正しく指摘できないエラーを,模範解答と初学者のプログラムの差異から検出することで,初学者の学習をサポートする手法を提案する.提案手法では,構文解析器が処理するソースコード中の構文要素をXML形式で表現する.そしてそれを,別途用意する模範解答から生成されたDTDと比較することでエラー箇所を指摘する.具体的には,まず,初学者のプログラムから構文解析器が処理するソースコード中の構文要素をXML形式で表現する.次に,模範解答のプログラムからDTDを生成する.生成されたDTDは,模範解答のプログラムが満たすべき構造を定義している.これにより,初学者のプログラムが模範解答と異なる構造を持っている場合,DTDを用いた妥当性検証を行うことにより,それを差異として検出できる.これにより,初学者のプログラムが模範解答との整合性に欠ける部分が特定される.この不整合はエラーの原因である可能性が高く,それをフィードバックとして提供することにより,初学者のC言語学習の促進が期待される.
For novice programmers, it is difficult to solve compile errors and perform debugging only using the error messages output by the compiler and execution results. Unsolved errors may cause students to lose interest in programming. In this presentation, we propose a method to support the learning of C language by detecting errors that the compiler cannot correctly indicate. This detection is performed by comparing the differences between the model program and the novice one, assuming a situation where model programs are prepared in advance, e.g., an exercise-style class. In the proposed method, syntactic elements in the source code processed by the parser are expressed in the XML format. The proposed method compares this XML representation with the DTD generated from the model program, and indicates the cause of error. Specifically, first, the syntactic elements in the source code of the novice program are translated into the XML format. Next, a DTD is generated from the model program. This DTD defines the structure that the model program should satisfy. If the novice program has a different structure from the model, the validity check using the DTD can detect that. This difference identifies lines where the novice program is inconsistent with the model. This inconsistency is likely to be the cause of errors, and by providing it as feedback, it is expected to enhance the effectiveness of C language learning of novice programmers.
収録刊行物
-
- 情報処理学会論文誌プログラミング(PRO)
-
情報処理学会論文誌プログラミング(PRO) 17 (3), 5-5, 2024-06-18
情報処理学会
- Tweet
詳細情報 詳細情報について
-
- CRID
- 1050019125729815808
-
- NII書誌ID
- AA11464814
-
- ISSN
- 18827802
-
- 本文言語コード
- ja
-
- 資料種別
- journal article
-
- データソース種別
-
- IRDB