A Method to Detect Structure Errors using a Model Program
Abstract
It is difficult for novice programmers to solve compilation errors and perform debugging using only the error messages output by the compiler and execution results. Failure to solve errors may cause students to lose interest in programming. In this study, we propose a method to support the learning of C language by detecting the cause of errors that the compiler cannot indicate. This detection is performed by comparing the differences between the model program and that of the novice, assuming a situation where model programs are prepared in advance, that is, 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 document type definition (DTD) generated from the model program. First, the syntactic elements in the source code of the program written by the novice are translated into XML format. Next, a DTD is generated from the model program. This DTD defines the structure that the model program should satisfy. The DTD detects the structural difference between the model and program written by the novice, which are likely to be the cause of errors. The feedback provided is expected to enhance the effectiveness of C language learning for novice programmers.
References
K. Uchida and K. Gondow, “C-Helper: C latent-error static/heuristic checker for novice programmers,” in Proceedings of the 8th International Conference on Computer Supported Education (CSEDU 2016), pp. 321–329, 2016.
J. S. Song, S. H. Hahn, K. Y. Tak, and J. H. Kim, “An intelligent tutoring system for introductory clanguage course,” Computers & Education, vol. 28, no. 2, pp. 93–102, 1997.
N. Saini, S. Singh, and Suman, “Code clones: Detection and management,” Procedia Computer Science, vol. 132, pp. 718–727, 2018.
T. Kamiya, S. Kusumoto, and K. Inoue, “A code clone detection technique for object-oriented programming languages and its emprical evaluation,” in Proc. of the 62nd National Convention of IPSJ, pp. 23–28, 2001.
S. Ducasse, M. Rieger, and S. Demeyer, “A language independent approach for detecting duplicated code,” in Proc. IEEE Int’l Conf. on Software Maintenance (ICSM ’99), pp. 109–118, 1999.
M. Balazinska, E. Merlo, M. Dagenais, B. Lague, and K. A. Kontogiannis, “easuring clone based reengineering opportunities,” in Proc. of the 6th IEEE Int’l Symposium on Software Metrics (METRICS’99), pp. 292–303, 1999.
W. Kozaczynski, J. Ning, and A. Engberts, “Program concept recognition and transformation,” IEEE Transactions on Software Engineering, vol. 18, no. 12, pp. 1065–1075, 1992.
A. Quilici, “A memory-based approach to recognizing programming plans,” Commun. ACM, vol. 37, no. 5, pp. 84–93, 1994.
N. Truong, P. Roe, and P. Bancroft, “Static analysis of students ’Java programs,” in Proceedings of the Sixth Australasian Conferenceon Computing Education (ACE ’04), pp. 317–325, 2004.
K. Koike, T. Tomoto, T. Horiguchi, and T. Hirashima, “Proposal of the expand-able modular statements method for structural understanding of programming, and development and evaluation of a learning support system,” Transactions of Japanese Society for Information and Systems in Education, vol. 36, no. 3, pp. 190–202, 2019. (in Japanese).
T. Osuka, T. Kobayashi, N. Atsumi, J. Mase, S. Yamamoto, N. Suzumura, and K. Agusa, “CX-Checker: A flexibly customizable coding checker for C,” IPSJ Journal, vol. 53, no. 2, pp. 590–600, 2012. (in Japanese).
H. Bao, M. Nakata, and Q.-W. Ge, “A proposal of syntax tree expression of C language programs,” CIEC Computer & Education, vol. 36, pp. 56–61, 2014.(in Japanese).