Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

2015 International Conference on Data and Software Engineering

A Domain-Speecific Language for Auto


omatic
Genneration of Checkers

Ryan Iggnatius Hadiwijaya, M.M. Inggriani Liem


Schoool Of Electrical Engineering and Informatics
Bandung Institute of Technology
Jl. Ganesha 10 Bandung 40132, Indonesia
ryann.ign54@gmail.com, inge@informatika.org

Abstract— One of the important moduless of a black-box


automatic program grader is a “checker”. In programming
competition environment, a checker is a prograam written for the
purpose to check the output of the contestantt’s program for a
task that has many solutions. Usually, a ch hecker is written
manually as needed. In this paper, the idea of th
he output checker
in the programming competition environmen nt is extended to
input checker and source code checker as a partt of the automatic
grader in our programming learning environmeent. Input checker
validates the input coverage. The source code cchecker is used to
validate a set of properties from a source code against the given Figure 1. Workflow of Current Auttomatic Grading Process
coding specification. A Domain-Specific L Language (DSL)
grammar is designed and developed as a speecification for the However, the black-box meth hod is not sufficient for
automatic generation of the output, input, and source code
automatic grading of the tasks in the programming learning
checkers. The DSL grammar and the checker ggenerator tool set
environment. The evaluation of the source code is an important
are used to evaluate source codes in our programming class. By
writing the checkers specification in DSL, th he specification is aspect of grading. The students should implement a program
automatically documented and can be reu used for similar respecting the coding conventtion and detail coding
properties. specification. The black-box method d is not able to check these
kinds of constraints in the source code.
Keywords—automatic program grading; Domain-Specific A single programming exercise can have many versions of
Language; property checker
correct solutions. As a classic exam mple, students are asked to
I. INTRODUCTION write a program in a given program mming language to read an
integer N, and then calculate the facctorial of N (N!), where N is
Our programming classes at Schooll of Electrical an integer greater than zero. The sollution of this exercise could
Engineering and Informatics, Bandung Institutte of Technology be either a main program with a loop, a function, or a
(SEEI ITB) have been using an automatic gradding system since procedure to calculate N!. As an n exercise in recursion, a
four years ago [2]. The automatic grading syystem is adapted lecturer may define the implementtation specifications, where
from the programming competition system [22]. The automatic students are asked to implement it by writing a recursive
grading process is faster and more reliable com mpared to manual factorial function. By using the black-box grading system, the
grading system. The students can do many moore exercises and student’s program is graded as a corrrect answer if the execution
have feedback immediately. The system gradees the source code of the source code can deliver N! for a given test case of N.
submitted by students with a black-box meethod, where the However, a black-box grading system judges a source code that
source code is executed with test cases. The system compares computes N! by a loop and a recurssive function as the same, if
the output of the student’s program with the expected output. the execution result is the same. Fo or identifying the recursive
The workflow of the current automatic graading process is function, we have to check the sourrce code and if the students
shown in Figure 1. The problem setter iss a person who do not implement a recursive fun nction, then the solution is
prepared the task (programming problem) desscription, the task graded as a wrong answer, or at leasst the grade is penalized.
solution, and a test suite for the task. A test suite consists of
input files, output files, score files, and an outpput checker. Usually, these kinds of simple exercises
e are given in basic
programming classes where we hav ve hundreds of students (we
The black-box method is sufficient for autoomatic grading in have 400 students in Introductory Programming
P class and 150
the programming competition environment w where the quality students in Object Oriented Prograamming class) with two to
of the source code is not examined. Hoow a contestant four exercises per weeks [2]. It iss impossible to check each
implements the code is not a part of the gradingg process. source code one by one manually. Therefore, we aim to

978-1-4673-8430-8/15/$31.00 ©2015 IEEE 7


2015 International Conference on Data and Software Engineering

implement an automatic source code checker as a complement the properties and give a score. The specifications of the
to a black-box grading. checkers (output checkers, input checkers,
c and source code
checkers) are expressed in a prop
perty based DSL, and then
In a programming competition, contestannts are asked to generated automatically.
solve complex tasks by writing a program m. The output is
examined by an output checker for a taskk that has many
possible correct answers. Currently, the ouutput checker is
written manually as needed. The output checcker source code
cannot be reused for another task. The test casses are also made
manually or generated by a specific test case generator. Most of
the tasks are specific; some of them are classiffied into problem
classes or categories, such as knapsack probblem and greedy
problem. The checker can be reused and re-ggenerated for the
tasks of the same class of problems. In [1], test cases are
designed and specified by using a DSL. The black-box
Figure 2. Workflow of Cheecker Generation
evaluation is improved by the Metamorphiic Testing (MT)
method [7]. MT is a technique to generate follow-up test cases The input and the output depend on the given format. The
based on the existing test cases by makiing reference to problem is that source code is dependent
d on the language
Metamorphic Relations (MR). Then, MT checcks the properties which is written. The research qu uestion is how to write a
expression in MR. This MT system is adaptted to a learning checker independently from the prog
gramming language.
environment. By using the system, the inpput checker can
increase the quality of the test cases and the ouutput checker can III. RELATED WORKS
enhance the black-box evaluation by Metaamorphic Testing
method [1]. Some automatic source cod de evaluators have been
implemented for examining staticaally (without executing) a
The problem statement and our propossed solution are source code, such as a plagiarism detector
d [3], static analyzer
presented in Section 2. Section 3 of this paper gives some [4], and code smell detection [5]. The
T source code plagiarism
relevant works in the domain. In section 4, thee development of detector calculates the similarity bettween student’s source code
DSL is presented as well as the work oof the proposed and a program solution. The system m defines a similarity rating
generator. Section 5 illustrates some exam mples where the and considers some variations su uch as the replacement of
proposed system is used in our context. We coonclude this paper variable names, changing the loop ty ype, or alternating the cases
by discussion and conclusion. in an if/switch statement [3]. Thee automatic static analyzer
grades student’s program without executing
e it, to detect some
II. PROBLEM STATEMENT AND PROPOSED
D SOLUTION flaws and give a penalty for each h flaw [4]. The code smell
In current programming practices, only ooutput checker is detector is used to detect bad smelll, that is used to transform
used to check the output. However, output checker is made by into a penalty factor to the source co
ode [5]. These three types of
ad-hoc. In the programming learning environnment, the input source code evaluator cannott detect implementation
checker is also needed to validate the input teest cases and the specification.
source code checker is needed to check thee implementation
In this paper, we propose anoth her way to check a source
specification.
code with the property checking metthod. The correctness of the
In this research, we defined a single checkker generator that execution has been judged by a blacck-box method. This way is
can be used by a problem setter to specify the input, output and more effective for grading many sim
mple and short source codes
source code checkers, based on a single Domain-Specific as we need in our environment. By property checking method,
Language (DSL). DSL is a language that is ussed for a specific we don’t need to check the wholle source code as in other
domain. DSL contains syntax and semantic ffor modeling the white-box methods that have been mentioned
m above.
abstraction of the domain [6]. In our research,, the domains are
One example of property based testing used is QuickCheck
the checkers. Checkers specification is writtenn as a script using
[8]. A property based testing is a testing method where
the DSL grammar. boolean functions are used to test t the correctness of a
Then, the checker(s) source code is generatted automatically program. The program is correct if all of the boolean functions
by our system (see the workflow in Figure 22) from the DSL return true for all possibilities off arguments. If a boolean
specification script. The checkers are used as a part of the test function return false, then QuickCheck delivers a
suite and improve the current checker in the tesst suite. counterexample. In our research h, we used a predefined
properties for checking the source code, not to determine the
In a learning programming class, the inputt, the output, and correctness of the program. The prroperty checking method is
the source code are needed to be checked against a set of the same; by using boolean functionns.
specification. To have a self-documented checker, the
specification is written in a DSL. There are also many source co
ode analysis tools, such as
StyleCop and FxCop. StyleCop is an open source static code
Given a programming exercise (input, outpput, and solution), analysis tool from Microsoft that cheecks C# code. The StyleCop
and a set of properties defined by a problem setter, the tool analyzes the style and consisttency rule violations in the
generated checkers validate the programmingg exercise against source code [11]. FxCop is a free staatic code analysis tool from

8
2015 International Conference on Data and Software Engineering

Microsoft that analyzes managed code asssemblies. FxCop token is a keyword in the languaage. Then, the tokens are
concerns with the violations of the programm ming and design arranged in a parse tree. To support the programming language
rules set in the design guidelines. FxCop proviides a tool to help independency, we do not processs a source code by this
developers to follow their company's codingg standards [12]. approach. Instead of having an AST T, we transform the source
But, both of the StyleCop and FxCop check coding style and code into a list of strings, where eaach string is a semantic unit
coding standard of a program. They do not ccheck a program such as statement, function, or a chhunk of source code such as
based on the implementation specification. comments. By this approach, we trreat all source codes in any
languages as strings. We check thee source code by providing
Domain-Specific Language has been uused to generate
specific properties which contain n programming language
program for a specific domain because of its ssimplicity and its keywords that will be checked.
well known vocabulary by domain experts. In [9], the DSL has
been used to define use cases. Test casees are generated
automatically based on the use cases that havve been specified
in the DSL.
A test case generator proposed by [1], alsoo uses a DSL for
writing the test case and checker specifi fications for the
programming competition task. The checcker checks the
property based on the Metamorphic Relation. The purpose of
the system is to make a test case and checkker creation more
systematic. In this paper, we adopt the DSL foor a more generic
checker for programming learning class. Thee purpose of the
system is to enhance the quality of black-boxx grading and to
check the implementation specification by deffining a property. Figure 3. Generalization of the Object
O to be Checked
A Metamorphic Relation is used as a propeerty that will be
checked. The DSL should accommodaate a definition of string
delimiter and program comments. String delimiter is used to
IV. A DSL FOR PROPERTIES CHECKER transform a source code into a list of strings for each type of
chunk such as statement, function, or procedure existing in a
In our previous paper [1], we havee designed and source code. A source code can contain comments. Some
implemented a DSL as a language to expreess test case and comments can be checked (for example, to check if the
input-output checker. The specification is ussed to generate a students make a good statement of initial state, final state, and
test case generator and also input-output checkker. Input checker process description). But, some pro ogramming exercises ignore
is used to check the input of the generated teest cases. Output the comments. In this case, the comments
c are ignored and
checker is used to check the output propertiess and the relation eliminated from the list of the strinngs. Properties are checked
(metamorphic relation) between outputs. Testt case (input and by a string matching algorithm, to o the list of strings of the
output) has a specified format. The input form
mat is used to read source code. The string matching can vary from very rigid
and write input, and output format is used too read and write (exact match) to the existing of a pattern.
p Regex matching is
output. The checker needs to read input annd output before used to search a pattern in the source code. The underlying idea
checking their properties. The test case geenerator uses the of the proposed source code checker is independency from any
formats for reproducing test cases. programming language based on string matching, without
In this research, the previous DSL is analyzzed and extended considering the grammar of the prrogramming language. The
so that it can support a generic checker, comprises input, regex pattern is automatically generated from property
output, and source code checker. Source coode is a program expression in the DSL.
written in a programming language. It is not a data and has a The DSL is used to define the property
p to be checked and
specific structure depends on the program mming language. also the score of the existence or non-existence
n of a property.
However, the source code can be considdered as a text For example, a user can define two t properties P1 and P2,
independently to a programming language. Thhe data (input and followed by their associate scores to check outputs. Property
output) can also be considered as a text. Thherefore, text is a P1 has a score equal to 30 and property P2 has a score equal to
generic representation of the object to be checked. The 70. The generated output checker checks P1 and P2 in the
generalization of the object to be checked is shhown in Figure 3. outputs. If P1 is not satisfied, then th
he score is reduced by 30. If
The checkers generated by our new system m check a text. If P2 is not satisfied, then the score is reduced
r by 70. Therefore, if
the text is data, then the text is read by usiing the specified both P1 and P2 are not satisfied, theen the judge gives a zero (0)
format. Otherwise, if the text is a source codee, then the text is score.
read as a list of strings. The existing DSL in [11] already had the To design the DSL grammar for f this research, we have
capability to read and write data (input and ooutput) according analyzed the checker domain. The checker domain consists of
to data format. It is now reused and extendeed to support any the checker code and the object to o be checked. The checker
text, including source code. Therefore, we genneralize the DSL code is a source code that is geneerated automatically by the
to support source code checking. DSL. The object to be checked is generalized
g as a text that is
When a source code is processed by prograamming language shown in Figure 3. The checker do omain analysis of the object
syntax, a lexer transforms a source code innto tokens. Each to be checked is represented in Figu
ure 4. The class diagram in

9
2015 International Conference on Data and Software Engineering

Figure 4 reflects the top level DSL grammar. The complete declaration, format declaration, property declaration, and
grammar is available in our online repository1. checker declaration. We have provided the generator’s code
that is used to generate code from the DSL Script. The
generation process is supported in the XText framework [13] by
defining a IJvmModelInferrer. The XText framework is also
used in our previous research [1]. The IJvmModelInferrer is
used to generate the checkers from the DSL Script. The
IJvmModelInferrer contains a specific code to generate each
element in the DSL. Each element of the DSL is generated as
an attribute or a method in the generated checker. The
generated checker has a class that is specified in the DSL
Script.
The Variable Declaration contains a list of variables
and its type. For each variable in the DSL Script, our system
generates a private variable, its public getter and setter, and a
function to read and write the variable depends on the variable
type.
The Format Declaration can be used to describe data
(input and output) format or the source code format. Our
system generates a public function for reading or writing the
Figure 4. The Checker Domain Analysis for the Object to be Checked data or the source code based on the DSL script.

The input and the output have variables. DataFormat is The Property Declaration contains a list of predicates
used to extract the variable values from the input and the output and its identification number. For each property, our system
files. DataFormat has one or more FormatExpressions which generates a public function to return a boolean value. The
expresses each line of the input/output. The input and the function checks the property represented by one or more
output can have many Properties. The Property has one or relations as specified in the DSL. If at least one of the relations
more BooleanExpressions which define a relation between in the property is satisfied, then the function returns true,
variable values in the input/output. The Property is satisfied if otherwise false.
at least one of the BooleanExpession returns true. The input The Checker Declaration contains pairs of
and the output also have a Checker. A Checker consists of <properties, files> that are the type of the files (input, output,
one or more PropertyUsages. A PropertyUsage is a source code) where the properties are checked. For each
declaration to use one or more Properties to check files checker, our system generates a public function to return an
specified in the Filenames. The Score is given to the integer. The function checks the properties in the list of files
input/output if all of the Properties specified in the given in the DSL. Property returns true if the source code meet
PropertyUsage are satisfied. the specification, otherwise false. If a property returns false,
On the other hand, a source code consists of a list of strings. then the function returns zero (0). If all properties return true,
SourceFormat is used to split the source code into the list of then the function returns an integer representing the score,
strings. The source code can have many Properties. A obtained from the DSL script. There are two types of the
Property for the source code has one or more checking type, by using “all” keyword and “each” keyword.
RegexExpressions that is used to check the existence or non- “All” keyword is used to check a set of files. The score is given
existence of the regex pattern in the list of strings. The to that set of files. “Each” keyword is used to give a score to
Property is satisfied if at least one of the RegexExpession each file individually.
returns true. The source code also has a Checker. The
Checker in the source code is the same as the Checker in the V. CASE STUDIES
input/output. The DSL in this research has been implemented and tested,
which is then to be used in case studies. Each case study
The methodology for DSL and generator development is consists of some examples of utilization. Examples presented
similar to the methodology used in [1]. Instead of generating briefly on this paper are taken from a programming assignment
test cases, the new generator in this research generates checkers class. The complete implementation of the DSL, the generator
(input checkers, output checkers, and source code checkers). code, and the examples are accessible from our online
The checkers can be run by a driver in a standalone or in the repository1.
existing automatic grading system in our programming learning
environment. The checkers are generated in Java language, to We give an example to write a checker specification in the
gain the advantage of the Java platform that is “code (generate) DSL by writing a very simple checker to check a programming
once, run everywhere” [10] and we can also gain the advantage task of codeforces2. In this task, an output checker is needed to
of the built-in string / regex matching function in Java. check if two integers x and y satisfy a property x + y = n (n is
given as input), 1 < x,y < n, and both of x and y must be a
The DSL script contains four declarations, that are variable composite number (greater than 1 and not a prime number).
1
https://github.com/ryanignatius/GenericCheckerDSL
2
http://codeforces.com/problemset/problem/472/A

10
2015 International Conference on Data and Software Engineering

The value of n needs to be checked if it satisfies the property Table 1. Properties Description
stated in the task: 12 < n < 106. The DSL Script to define No Properties Description Result Score
checkers for this task is shown in Code 1. 1 Checks recursive function with prototype Correct 100
int fac(int n).
class Example { 2 Checks recursive function with prototype Incorrect 0
int n,x,y int factorial(int n).
format : input { 1(n) }
format : output { 1(x,y) } 3 Checks iterative loop in the main function. Incorrect 0
P 1 { def int z = x+y; z == n }
P 2 { 1 < x }
P 3 { x <= n } To check a source code in another language (for example,
P 4 { not prime(x) } in Pascal or in Java), the problem setter can simply change the
P 5 { 1 < y }
P 6 { y <= n } checker property. The checker property for checking the
P 7 { not prime(y) } existence of a recursive function in Pascal is shown in the
P 8 { 12 <= n }
P 9 { n <= 1000000 }
Code 4, and the checker property for checking the existence of
check : output { P [1,2,3,4,5,6,7] check each [".out"] a recursive function in Java is shown in the Code 5.
score 100}
check : input { P [8,9] check each [".in"] score 100} P 1 { exist regex
Code 1. Example of DSL Script for a Task in Codeforces "(?s)function fac(n:integer):integer..fac(..n..)"}
Code 4. Property for Checking the Existence of Recursive Function in Pascal
From the DSL script written in Code 1, one input checker
and one output checker are generated. The output checker is P 1 { exist regex "(?s)int fac(int n)..fac(..n..)"}
Code 5. Property for Checking the Existence of Recursive Function in Java
used to check P1 until P7 for each output file (*.out). The input
checker is used to check P8 and P9 for each input file (*.in). Another example of the DSL script for source code checker
is to check the usage of temporary variable in a function
The next example is presented to demonstrate that the
system can also generate a source code checker. Code 2 shows written in C++ language. The prototype of the function is int
a DSL script for checking an implementation specification of incr (int x), which returns the value of x+1. The
factorial. The keyword regex is used for generating the property expression that is used for checking a temporary
associated regex expression. If the prototype of the recursive variable is shown in Code 6.
function is known, then it can be checked by a regex matching P 1 {forbid regex "(?s)int incr(int x)..="}
function. The function is written in C++ and the prototype of Code 6. Property for Checking Temporary Variable in C++
the factorial recursive function is: int fac (int n).
class FactorialCheck { The checker property can also be used to check a static
format : source { array declaration in C++, as shown in the Code 7. The type of
function block : “{“ “}”
single comment : “//” the array needs to be specified. In this example, the checker
multi comment : "/*" "*/" } property checks a static array declaration with int type.
P 1 { exist regex "(?s)int fac(int n)..fac(..n..)" }
check : source {P [1] check all [".cpp"] score 100} } P 1 { forbid regex "int..[..]" }
Code 2. DSL Script for Checking the Existence of Recursive Function in C++ Code 7. Property for Checking a Static Array Declaration in C++

The DSL script in Code 2 is written by the problem setter. Another example is to check an implementation of a zero
It is used to generate a source code checker that checks P1 for based recursive function in the LISP language. The header of
all source code files (*.cpp) submitted by the students. The the function is NbElmt(L). The function uses the function
example of the source code that computes factorial using the IsEmpty(L) for checking whether the list is empty or not as
correct prototype is shown in Code 3. the base case. The checker property for this checker is shown
#include <iostream> in Code 8. In this simple function, the checker property can
int fac (int n){ also be used to check the implementation of the function by
if (n == 0) return 1;
return n*fac(n-1); } providing checker properties for all possible correct answers.
int main(){ For this example, there are four correct reccurrence
int n;
std::cin >> n; expressions, that are 1+NbElmt(Tail(L)), NbElmt(Tail(L))+1,
std::cout << fac(n) << std::endl; } 1+NbElmt(Head(L)), and NbElmt(Head(L))+1. We also
Code 3. Example of a Correct Source Code that Computes Factorial provide a regex generator from the function prototype. The
function prototype will be transformed into a regex pattern that
Furthermore, we also give three examples of properties that is used to check the properties.
can be checked from the source code in Code 3. The
description of the properties can be seen in the Table 1. The P 1 { exist
exist
regex
regex
"(?s)NbElmt(L)..1+NbElmt(Tail(L))";
"(?s)NbElmt(L)..NbElmt(Tail(L))+1";
first property checks whether the source code contains exist regex "(?s)NbElmt(L)..1+NbElmt(Head(L))";
recursive function with prototype int fac(int n), so the exist
P 2 { exist
regex
regex
"(?s)NbElmt(L)..NbElmt(Head(L))+1"}
"(?s)NbElmt(L)..if..IsEmpty(L)..0"}
source code get full score (100). The second property checks Code 8. Properties for Checking a LISP Source Code
whether the source code contains recursive function with
prototype int factorial(int n), so the source code In our introductory programming class, we have about one
does not get score because the name of the function is different. hundred of small exercises as in Code 8. The checker is very
The third property checks whether the source code contains useful and efficient for the automatic grading of small
iterative loop in the main function, so the source code does not exercises.
get score because the source code does not contain any loop.

11
2015 International Conference on Data and Software Engineering

VI. DISCUSSION problem setter needs to be familiar with regex. An error in


In the previous sessions, we presented a DSL that covered writing the regex produces a false checker. The generated code
the specification of input, output, as well as a source code needs to be validated before its usage. A regex generator is
checker. We also developed a tool set that used the given DSL built for the problem setter so that it is easier to write
script to generate the checker(s) automatically. The results have specification implementation.
been used to grade programming assignment automatically, VII. CONCLUSION
and it can be run in a stand alone environment or integrated
with an existing automatic grading system [2]. In this research, we have made a single DSL for generating
checkers (output checker, input checker, and source code
A checker is defined by a script written in our DSL checker) with our provided tool set. By using our tool set, the
grammar, and then generated automatically. By this way, the checker creation process is faster and easier.
checkers are based on specification and are self-documented.
Three types of checkers are generalized by property. We Our checkers use a property based checking method to
adopted the idea of a property expressed for MT as a way to check the properties in the text, whether the text is input data,
express any kind of property in input, output, and source code. output data, or source code. The expression of the properties is
Input and output are data with their properties are formatted inspired by the property defined in the Metamorphic Relation,
and the relation between the data. The source code checker has which is a relation between the data for the input and the
different characteristics since a source code depends on the output. For the source code, the property is a string pattern that
language and has a structure. The properties of the source code can be checked by using regex matching function.
are expressed as a regular expression. Source code checker does a partial check on the source
The generated checkers are used systematically for an code to search the properties. This partial check cannot
automatic grading process for the student’s submission in guarantee the correctness of the source code (program). So, this
programming class. Input checker is important for verifying the partial check has to be performed after the source code is
completeness and coverage of the test case. An output checker graded by the Autograder to determine its correctness. For a
is needed when a programming task has many possible correct simple program, source code checker can also be used to check
answers for an input and also when the oracle problem will be the implementation detail by providing a regex pattern for all
tested by MT method [1]. A source code checker is used for possible correct answers. The regex pattern can be generated
checking the implementation specification of the student’s from the function prototype.
source code.
REFERENCES
By using the DSL, problem setter can focus on [1] R.I. Hadiwijaya and M.M.I. Liem, “Metamorphic Testing and DSL for
programming task definition. The drawback is that he/she Test Cases & Checker Generators”. Olympiads in Informatics, Vol. 9,
needs to understand the DSL first. Once a problem setter can Vilnius University, 2015.
define a checker, he/she can reuse it in another task. We have [2] K. Danutama and I. Liem, “Scalable Autograder and LMS Integration”.
defined many checkers and we can produce programming task ICEEI 2013, 387-395.
more rapidly. The reliability of test cases is also improved by [3] C. Kustanto and I. Liem, “Automatics Source Code Plagiarism
Detector”. ACIS/SNPD 2009, Daigu, Korea, 481-486.
defining the input checkers. In the DSL we also provide a set of
predefined functions that are frequently used in programming [4] S.V. Yulianto, “Automatic grader for programming assignment using
source code analyzer”. Data and Software Engineering (ICODSE), 2014
exercise such as prime(x) to check whether x is a prime number International Conference, 2014.
or not. [5] H.P. Putro, “Deteksi Code Smell pada Kode Program Dalam
The proposed source code checker is independent of the Representasi AST dengan Pendekatan By Rules”. Seminar Nasional
Aplikasi dan Teknologi Informasi, UII Yogyakarta, 2010.
programming language where the source code of the students is
[6] D. Ghosh, “DSLs in Action”. Manning Publication, 2011.
written. By this independence, we do not need to write a parser
[7] Chen, T.Y., Cheung, S.C., and Yiu, S.M. Metamorphic testing: a new
for each language. But, this gives a drawback because the approach for generating next test cases, Technical Report HKUST-
students need to implement a function or procedure according CS98-01, Department of Computer Science, Hong Kong University of
to a rigid specification, or uses a given variable name. Science and Technology, Hong Kong, 1998.
[8] K. Claessen, J. Hughes, “QuickCheck: A Lightweight Tool for Random
The programming learning environment is different from Testing of Haskell Programs”. In Proc. of International Conference on
the programming competition environment. In the Functional Programming (ICFP), ACM SIGPLAN, 2000.
programming competition environment, contestants are asked [9] K. Im., T. Im, J. D. McGregor. Automating test case definition using a
to solve complex task and has the freedom to implement the domain specific language. In: ACM-SE 46 Proceedings of the 46th
solution. However, in the programming learning environment, Annual Southeast Regional Conference on XX. 180–185, 2008.
the students need to respect some coding rules and [10] Oracle, ‘The Java™ Tutorials’, 2015. [Online]. Available:
implementation specification. In this case, our source code https://docs.oracle.com/javase/tutorial [Accessed: 27- Jul- 2015].
checker is an important tool for automatic grading of the [11] CodePlex, 'StyleCop', 2015. [Online]. Available:
programming assignment in the programming learning https://stylecop.codeplex.com/. [Accessed: 27- Jul- 2015].
environment. [12] CodePlex, 'FxCop Installer', 2015. [Online]. Available:
https://fxcopinstaller.codeplex.com/. [Accessed: 27- Jul- 2015].
The regex matching is a part of Java library and its [13] S. Efftinge and M. Spoenemann, 'Xtext', Eclipse.org, 2015. [Online].
capability to check a pattern has been proven. However, the Available: https://eclipse.org/Xtext. [Accessed: 27- Jul- 2015].

12

You might also like