Comparing Semantic Graph Representations of Source Code: The Case of Automatic Feedback on Programming Assignments

José Carlos Paiva1, 2, José Paulo Leal1, 2 and Álvaro Figueira1, 2

  1. CRACS - INESC TEC
    Porto, Portugal
  2. DCC - FCUP
    Porto, Portugal
    jose.c.paiva@inesctec.pt, zp@dcc.fc.up.pt, arfiguei@fc.up.pt

Abstract

Static source code analysis techniques are gaining relevance in automated assessment of programming assignments as they can provide less rigorous evaluation and more comprehensive and formative feedback. These techniques focus on source code aspects rather than requiring effective code execution. To this end, syntactic and semantic information encoded in textual data is typically represented internally as graphs, after parsing and other preprocessing stages. Static automated assessment techniques, therefore, draw inferences from intermediate representations to determine the correctness of a solution and derive feedback. Consequently, achieving the most effective semantic graph representation of source code for the specific task is critical, impacting both techniques’ accuracy, outcome, and execution time. This paper aims to provide a thorough comparison of the most widespread semantic graph representations for the automated assessment of programming assignments, including usage examples, facets, and costs for each of these representations. A benchmark has been conducted to assess their cost using the Abstract Syntax Tree (AST) as a baseline. The results demonstrate that the Code Property Graph (CPG) is the most feature-rich representation, but also the largest and most space-consuming (about 33% more than AST).

Key words

semantic representation, source code, graph, source code analysis, automated assessment, programming

Digital Object Identifier (DOI)

https://doi.org/10.2298/CSIS230615004P

Publication information

Volume 21, Issue 1 (January 2024)
Year of Publication: 2024
ISSN: 2406-1018 (Online)
Publisher: ComSIS Consortium

Full text

DownloadAvailable in PDF
Portable Document Format

How to cite

Paiva, J. C., Leal, J. P., Figueira, Á.: Comparing Semantic Graph Representations of Source Code: The Case of Automatic Feedback on Programming Assignments. Computer Science and Information Systems, Vol. 21, No. 1, 117–142. (2024), https://doi.org/10.2298/CSIS230615004P