2016 Eled
2016 Eled
assignments
Soundous Zougari, Mariam Tanana, Abdelouahid Lyhyaoui
Laboratory of Innovative Technologies, ENSA of Tangier,
University Abdelmalek Essaadi,
Tetouan, Morocco
Abstract— In this work, we address the issue of automatic have motivated many researchers to be interested in automating
assessment for programming assignments. The objective is to the process of assessing learners’ productions. The first
provide immediate feedback to the learners and save teachers reference comes from Hollingsworth who published on the
from manually managing all the students’ solutions. We will subject in 1960 [4]. The idea caught on quickly and several
present a method merging results from dynamic and static assessment systems have been developed [5]. Unfortunately,
analysis to ensure a reliable and objective evaluation job. While these systems are neither generic nor configurable and most of
dynamic analysis is based on unit testing framework, the static them are not available to the general public, that is why we
analysis will focus on finding the adequate structural similarity seek to develop our own assessment system.
measure after transforming the programs into control flow
graphs. In this sense, this work presents a reliable and objective
method of assessing learners’ productions that not only will
Keywords—programming assessment; dynamic analysis; reduce the workload for teachers but also provide useful
static analysis; graph representation; graph similarity feedbacks to students throughout their learning process.
Concerning the practical domain, we opted for introductory
I. INTRODUCTION programming courses for several reasons. Besides the fact that
Nowadays, computers have truly entered the mainstream these courses are the core of any engineer's training, this is a
and programming is no longer the closed industry it used to be. domain where assessment is of a great complexity, mainly
Apple’s co-founder, Steve Jobs, once said, “I think because it is characterized by the multitude of solutions to a
everybody… should learn how to program a computer because given problem.
it teaches you how to think”. According to recent studies, The remainder of the paper is organized as follows :
learning to program brings enormous benefits for life [1]. Section 2 discusses the methods mainly adopted by program
Besides improving one’s problem-solving abilities, it help analysis systems, namely dynamic and static. Afterwards, we
acquiring useful traits like perseverance, precision, focus, … describe the proposed hybrid approach and address the
and last but not least, it transform us from technology passive programs similarity issue in Section 3. Finally, Section 4
consumers into active producers which is incredibly contains conclusions of this paper and discusses about the
empowering. future research.
To learn and master a new programming language, students II. PROGRAM ANALYSIS METHODS
need to solve a large number of exercises in order to practice The validation of computer programs is a crucial part in
the new syntax and semantics of the language. The comments the cycle of their development. Two verification and
and feedback from teachers about the mistakes they made are validation techniques have stood out in recent years: dynamic
crucial to improve their knowledge. However, it is difficult for analysis and static analysis. The main difference between
teachers to manually manage all students’ solutions. Indeed, these two approaches is that the dynamic analysis requires the
correcting manually programming exercises can involve a lot execution of the program to check its accuracy, unlike the
of work and consume much time. It is often a complex and static analysis that examines a program without executing it.
daunting task since each program must be tested and its source This section aims to present them briefly:
code analyzed. In addition, the correction process is prone to
errors or omissions due to the fatigue and the repetitive nature A. Dynamic Analysis
of the task [2]. Dynamic analysis involves running the code to verify its
accuracy. This is achieved by using different and varied test
Furthermore, the advantages of the automatic assessment cases allowing maximum path coverage of the programs. It is
are especially appreciated in the context of e-learning [3]. intended to detect errors by comparing the gotten results with
Several universities worldwide offer numerous online courses. those expected by the specification. This method is adopted by
The number of students enrolled in these courses is on the most of the automatic programming assessment systems such
order of thousands. In online courses, the teaching process is as Ceilidh [6], TRY [7], BAGS [8], Kassandra [9].
carried out via the computer, with minimal or no contact with
the teacher. Therefore, fast and reliable automated assessments 1) Advantages of the dynamic analysis:
are particularly desirable. All these reasons and so many more
• The dynamic analysis is easy to implement, and B. Static Analysis
tester can be non-technical. The static program analysis is a family of techniques
• It makes possible evaluating any program allowing to collect information on the program without having
performance in terms of the generated results to run it and therefore eliminate the risks associated with its
compared with the expected outputs in the test case. execution. Among the tools that rely on static analysis lint [11]
and AutoLEP [12].
• It allows analysis of applications in which we do not
have access to the actual code. We can distinguish various methods within the approach of
2) Disadvantages of the dynamic analysis: static analysis ; Style analysis, Metric analysis, Keyword
• Risks related to the execution of the source code, analysis, Structural analysis,...
e.g. a buffer overflow that can cause a sudden 1) Advantages of the static analysis:
breakdown of a server and put the data at risk. • It can find weaknesses in the code at the exact
• The major drawback of this method is that if the location.
program does not compile, then it cannot be • It takes into account all possible execution paths.
assessed.
• The ability to analyze the program even if the code
• The generated feedback is limited to the expected contains errors as opposed to dynamic analysis.
outputs of the test case.
2) Disadvantages of the static analysis:
• We cannot check the conformity of the program as • The limitations of structural analysis since there are
for the requirements defined by the instructor. a variety of solutions for the same problem.
3) Dynamic analysis tool: To perform dynamic analysis,
• Intricate and difficult to apply in the context of
we suggest the use of a dedicated framework to automate and
complex programs.
conduct tests in a given language. This not only allows
separating the test code from the code, making possible testing • Automated tools can produce false positives and
it and thus facilitates its reuse, but also to do it without a false negatives.
manual intervention and a human interpretation. Finally, the
analysis of the gotten results could be automated since each Static analysis requires two steps: transformation of both,
test result has a status, generally ok or error [10]. student program and model program into an intermediate
representation and analysis after transformation. First, an
As a matter of fact, there exist a number of dynamic intermediate representation form should be selected and
analysis tools in the industry, we will be content with generated from the source code. A category generally used as
describing the xUnit framework since it is the one we are intermediate representation for programs is graph. There are a
using. lot of available graphs such as Control Flow Graph (CFG),
The xUnit framework is a family of several similar Program Dependence Graph (PDG) and System Dependence
frameworks gathered in a family named xUnit. The JUnit Graph (SDG). The second step consists in analyzing the
framework was the first to be widely known but different programs after transformation. Since we are representing the
development platforms and programming languages followed programs with graphs, the analysis turns into computing the
similarity of graphs.
including nUnit (.Net), Dunit (Delphi), CppUnit (C ++), ... We
will explain in what follows some of the JUnit basic features C. Graph similarity:
and architecture components shared with other frameworks of The problem of computing the similarity of graphs is also
the xUnit family. known as graph matching.
JUnit offers:
1) Graph matching: Graph matching is the process of
• Assertions for testing expected results finding a correspondence between the nodes and the edges of
• Test features for sharing common test data two graphs that satisfies some constraints ensuring that similar
• Test suites for easily organizing and running tests substructures in one graph are mapped to similar substructures
• Graphical and textual test runners in the other [13].
The tests to automate are expressed in classes in the form The matching process varies from exact to relative or
of test cases with their outcomes. JUnit runs these tests and inexact matching. The first category requires a strict
compares their outcomes with the expected results. That’s how correspondence among the two objects being matched or at
the class code is separated from the code that allows testing it. least among their subparts. Whereas in the inexact methods,
Often to test a class, it is easy to create a main() method the matching can occur even if the two graphs being compared
containing the treatment of the tests. The downside is that this are structurally different to some extent. Fig.1. displays a
superfluous code will be included in the class. Moreover, it generic classification of all graph matching types [14].
must be executed manually.
A large number of graph matching applications in diverse
fields, have been described in the literature (such as social
networks, image processing, biological networks, chemical The set of elementary graph edit operators typically
compounds, and computer vision) [15], and therefore there includes:
have been suggested many algorithms and similarity • vertex insertion to introduce a single new labeled
measures. vertex to a graph.
• vertex deletion to remove a single (often
disconnected) vertex from a graph.
• vertex substitution to change the label (or color) of a
given vertex.
• edge insertion to introduce a new colored edge
between a pair of vertices.
• edge deletion to remove a single edge between a pair
of vertices.
• edge substitution to change the label (or color) of a
given edge.