• No results found

Teaching novice programmers using ProgTest

N/A
N/A
Protected

Academic year: 2021

Share "Teaching novice programmers using ProgTest"

Copied!
19
0
0

Loading.... (view fulltext now)

Full text

(1)

Universidade de São Paulo

2015

Teaching novice programmers using ProgTest

International Journal of Knowledge and Learning, Olney, UK : Inderscience Publishers, v. 10, n. 1, p.

60-77, 2015

http://www.producao.usp.br/handle/BDPI/51271

Downloaded from: Biblioteca Digital da Produção Intelectual - BDPI, Universidade de São Paulo

Biblioteca Digital da Produção Intelectual - BDPI

(2)

Teaching novice programmers using ProgTest

Draylson Micael de Souza*, Seiji Isotani and

Ellen Francine Barbosa

University of São Paulo (ICMC-USP) São Carlos 13566-590, SP, Brazil Fax: +55 (16) 3373-8888 Email: [email protected] Email: [email protected] Email: [email protected] *Corresponding author

Abstract:Programming foundations is not an easy subject to be taught, mainly because of the abstract concepts that need to be mastered. On the other hand, experiences have suggested that the early mastering of testing concepts can contribute to enhance the students’ skills of comprehension and analysis of programs. Aiming at addressing the integrated teaching of programming and testing practices, automatic test-based assessment systems have been developed and adopted in programming courses. In this paper we discuss the use of ProgTest – a test-based assessment tool which provides an immediate feedback to students regarding the quality of the programs developed and the test cases designed. ProgTest was applied to a group of undergraduate students of an introductory programming course. In short, the outcomes suggest that the constant and concrete feedback provided by the tool was useful for helping students to improve their assignments, both in terms of programming and testing.

Keywords: automatic assessment tools; programming assignments; software testing; novice programmers.

Referenceto this paper should be made as follows: de Souza, D.M., Isotani, S. and Barbosa, E.F. (2015) ‘Teaching novice programmers using ProTest’,

Int. J. Knowledge and Learning, Vol. 10, No. 1, pp.60–77.

Biographical notes:Draylson Micael de Souza received his BS in Information Systems in 2010 and his MS in Computer Science in 2012, both from the University of São Paulo (ICMC-USP). Since 2012, he is a PhD student at ICMC-USP. His research interests are related to computer science and software engineering education and training, as well as programming foundations and software testing.

Seiji Isotani received the BSc and MSc in Computer Science from the University of Sao Paulo, Brazil, and the PhD in Information Engineering from Osaka University, Japan. He was a research fellow associated with Carnegie Mellon University, Pittsburgh, Pennsylvania, and currently is an Assistant Professor at the University of Sao Paulo, Brazil. His research interests are in the areas of ontological engineering, computer-supported collaborative learning (CSCL), artificial intelligence in education (AIED), and technology-enhanced learning.

(3)

Ellen Francine Barbosa received her BS in Computer Science in 1995 from the State University of Londrina (UEL/Brazil), her MS in Software Engineering in 1998 from the University of São Paulo (ICMC-USP/Brazil), and her DS in Software Engineering in 2004, also from ICMC-USP. During her DS, she was a visitor scholar at Georgia Institute of Technology (GATECH/USA) and at University of Florida (UFL/USA). Since 2005, she is a Professor at ICMC-USP. Her research interests are related to CS and SE education and training, collaborative and distance learning, knowledge management, software engineering, software testing and validation, and software quality.

1 Introduction

Programming is a difficult topic to teach (Lahtinen et al., 2005), mainly because of the abstract concepts that need to be mastered (Sheard et al., 2008). Many students, particularly the novice programmers, have a wrong view about the programming activity (Edwards, 2004). For instance, they think if the program compiles and works for one or two input values, it is correct; however, this is usually not true. Also, students use a trial-and-error practice to fix their programs instead of understanding what they are really doing (Edwards, 2004). As a consequence, they are not able to properly develop comprehension and analysis skills.

Aiming at addressing these issues, experiences have suggested the introduction of basic concepts of software testing in introductory programming courses (Janzen and Saiedian, 2006; Spacco et al., 2006a; Barbosa et al., 2008; Souza et al., 2011; Holton and Wallace, 2013; Edwards, 2014). On the one hand, software testing can help students to develop programming skills, since they are ‘forced’ to understand the behaviour of their programs. On the other hand, the early mastering of testing practices also contributes to create and disseminate a culture of testing among students, mainly the novices ones.

Despite its relevance, software testing is not a trivial topic to be taught as well (Edwards, 2004). In general, it is difficult to motivate students to properly perform the testing activity. Also, there is a need for automated tools capable of providing an adequate feedback about how well the students are testing their programs.

To investigate the integrated teaching of programming foundations and testing principles, we have developed ProgTest (Barbosa et al., 2008; Souza et al., 2011) – a web environment for the submission and assessment of students’ programming assignments based on testing activities. ProgTest is integrated to testing tools, being able to assess both the quality of the programs written by students and the quality of the test cases designed to test such programs.

In this paper we discuss the use of ProgTest, focusing on the feedback it provides to students. The main goal is to evaluate how useful is this feedback in helping students (in our case, novice programmers) to understand what they have to do and how to improve their programming assignments even before the instructor’s evaluation. To do so, we conducted an experiment, in which ProgTest was used by a group of undergraduate students of an introductory programming course.

(4)

The remainder of this paper is organised as follows. In Section 2 we discuss some issues regarding the introduction of testing concepts in conjunction with programming foundations. In Section 3 we provide an overview of ProgTest and its main characteristics; we also compare ProgTest with other similar environments. In Section 4, the experiment we have performed is described and, in Section 5, we summarise and discuss the results achieved. Finally, in Section 6 we present our conclusions and perspectives for future work.

2 Integrated teaching of programming foundations and testing practices

The main challenge in introductory programming courses is to make them interesting and relevant for learners (Kinnunen and Malmi, 2005). In general, the traditional approach in such courses is to provide an overview of computer science and then start teaching the programming foundations by using a specific language such as Pascal, C or Java (Hickey, 2004). Most of the time, however, the emphasis is in the syntax of the language instead of solving the problem through the design and development of algorithms. As a consequence, students learn how to program through a trial-and-error practice, without developing the adequate comprehension and analysis skills (Edwards, 2004).

Over the last years, many universities have changed their curricula to introduce the object-oriented paradigm as a way for better motivating students on basic programming concepts. However, such initiative has not been sufficient to solve the students’ problems concerning programming. They still have difficulties understanding how to design a program to solve a certain task, dividing functionality into procedures and finding bugs in their own programs (Lahtinen et al., 2005). Furthermore, the students have wrong views about the programming activity, such as (Edwards, 2004):

once the compiler accepts the code without complaining, all errors have been removed

once the code produces the output expected with one or two test values, it will work well all the time

once the code gives the correct answer for the instructor’s sample data, it is finished. Aiming at solving (or at least minimising) these problems, experiences have suggested the introduction of testing concepts in conjunction with programming foundations in introductory programming courses (Janzen and Saiedian, 2006; Spacco et al., 2006a; Barbosa et al., 2008; Souza et al., 2011; Holton and Wallace, 2013; Edwards, 2014). Since testing requires the student to know the behaviour of his or her programs, such activity can be explored to help him or her in understanding the abstract concepts of programming and develop the expected skills (Edwards, 2004). Furthermore, since testing forces the integration and the application of theories and skills of software analysis, project and implementation, students who start testing earlier can become better testers and developers as well (Jones, 2001).

On the other hand, software testing is not an easy subject to be taught too. Several problems regarding to this subject can be pointed out (Edwards, 2004; Patterson et al., 2003):

(5)

software testing requires the students to have experience at programming instructors have to evaluate the program correctness manually. So, it may not be

feasible to evaluate the test cases too

students need constant and concrete feedback on how to improve their performance on testing at many points throughout the development of a solution rather than just once at the end of an assignment

students see testing as a boring activity, where much time is spent on performing the tests and the writing of test plans creates a large overhead in the workload.

Despite these limitations, Barriocanal et al. (2002) have shown that the teaching of testing practices earlier can improve the quality of the code implemented and can ease the learning process, both of testing and of programming.

Aiming at addressing the issues concerning the integrated teaching of programming and testing, supporting tools for the automatic assessment of programming assignments have been developed. The idea is to provide the student an immediate feedback of his or her implementation, indicating whether the program is correct or not.

Several examples of tools in this perspective can be found in the literature (Caiza and Alamo, 2013; Fernández-Alemán, 2011; Ihantola et al., 2010); however, only some of them provide an appropriate support to also evaluate the testing activities performed by the students. For instance, Autograde (Goldwasser, 2002) executes the student’s test suite against the other students’ programs. The more defects it finds, the better will be the student’s performance in the assessment. Oto (Tremblay and Lessard, 2011) allows the extension and customisation of new features. Among them, it is possible to design different verificators to assess students’ test suites. Lastly, SAC (Auffarth et al., 2008) assessment process includes the execution of the student’s test suite against his or her program.

Another example is Marmoset (Spacco et al., 2006b). The tool assesses students’ programs by using four types of test suites:

student tests, which are supplied by students

public tests, which are delivered to students before they start to implementing their programs

release tests, which are written by the instructor and made available to students under specific conditions or after the deadline is reached

secret tests, which are written by the instructor and delivered to students only after the deadline is reached.

Finally, Web-CAT (Edwards, 2014) assesses students’ programs and test suites according to three parameters:

design/readability, manually analysed by the instructor style/coding, using static analysis tools

correctness/test, using testing tools.

Both the testing and the static analysis tools used in the evaluations performed by Web-CAT are provided by grading plugins. Many grading plugins can be applied in the same

(6)

assignment. Each plugin has a grading scheme and related reports for a given programming language.

3 The ProgTest environment: an overview

Among the tools that support integrated teaching of programming and software testing, we highlight ProgTest (Barbosa et al., 2008; Souza et al., 2011) – a web environment for the submission and assessment of students’ programming assignments based on testing activities. ProgTest is able to assess both the quality of the programs written by students and the quality of the test cases designed to test such programs. To do so, testing tools are integrated to ProgTest to assess the correctness and the adequacy of the test cases concerning a set of testing criteria. On the basis of the coverages provided by the testing tools, the environment is able to assess the quality of both students’ programs and students’ test cases. The core features of ProgTest can be accessed through the instructor and student views (Figure 1). Concerning the instructor view, ProgTest allows instructors to create new courses, to proceed student’s enrollment and to define new programming assignments.

Figure 1 The ProgTest environment: (a) instructor view and (b) student view

(a) (b)

To assess students’ programs, instructor has to provide an oracle assignment, which is composed of:

an oracle program, which implements a correct solution for the problem defined by the assignment

a set of test cases for the oracle program, which is 100%-adequate to the testing criteria being considered.

There are two ways to provide an oracle assignment: by submitting instructor’s own program and test cases

by selecting an assignment from the oracle assignment base of ProgTest .

Such base is composed of a set of programs and their adequate test cases, selected from books used in introductory courses of programming. The idea is to ease instructor’s job, who can use the oracle assignment base available in ProgTest instead of defining, implementing and testing his or her own program.

(7)

Additionally, the instructor can define which testing tools should be consider in the assessment process. Currently, three different types of testing tools are considered in ProgTest:

Unit testing frameworks: Automatically execute test cases, reporting whether each test case succeeded or not.

Coverage testing tools: Check whether the set of test cases executes all elements of the program (statements, conditions, variable definitions, etc.) at least once.

Mutation testing tools: Generate different versions of the program under testing, each one containing a different defect, and check whether the set of test suites is able to reveal these defects or not.

On the basis of this classification, a set of six testing tools is available in ProgTest (Table 1): some tools support the test of Java programs and others support the test of C programs.

Table 1 ProgTest: integrated testing tools

Java C

Unit testing frameworks JUnita CUnitb

Coverage testing tools JaBUTiService GCovc

(Eler et al., 2009)

Mutation testing tools Jumble Proteum

(Irvine et al., 2007) (Delamaro and Maldonado, 2001)

a http://junit.sourceforge.net/doc/cookbook/cookbook.htm b http://cunit.sourceforge.net/doc/index.html c http://gcc.gnu.org/onlinedocs/gcc/Gcov.html

The instructor can also define the weights to be associated for each testing criterion. For instance, if the instructor wants the assessment be focused on control flow structures (i.e.,ifstatements, whilestatements) without discarding the assessment of the other program characteristics, he or she can define a higher weight for the control flow testing criteria supported by the coverage testing tools.

Concerning the student view, students are allowed to access all assignments defined in the courses in which they are enrolled. To submit his or her solution for the assignment, the student has to provide both the program and the test cases which he or she have written. On the basis of the testing criteria and weights defined by the instructor, ProgTest then calculates the coverage for each one of the following executions:

student’s test cases against student’s program (Pst−Tst)

instructor’s test cases against student’s program (Pst−Tinst)

students’s test cases against instructor’s program (Pinst−Tst).

ProgTest also suggests a grade for the student’s solution, which is calculated by the following formula:

Grade =p1×PStTSt+p2×PInstTSt+p3×PStTInst

(8)

wherep1,p2,p3are the weights defined by the instructor.

Comparing ProgTest with similar tools (Section 2), all them consider the students’ test cases in the assessment process. However, only Marmoset, Web-CAT and ProgTest check the adequacy of the students’ test suite according to testing criteria. Besides that, the coverage analysis performed by Web-CAT and Marmoset considers only the control-flow testing criteria. ProgTest, on the other hand, considers both control-control-flow and data-control-flow criteria. Also, different testing techniques, such as error-based, can be investigated as well. In this sense, ProgTest establishes a more systematic testing activity, what increases the probability of finding errors in the students’ programs.

Furthermore, ProgTest differs from the others since it uses a reference program provided by the instructor in addition to his or her test cases. This allows cross-checks with programs and test suites submitted by students. This characteristic is relevant to automatically check whether the solution submitted by the student corresponds to the problem proposed by the instructor. For instance, it is possible to identify incorrect test cases provided by a student through the behaviour of the reference program when the student test suite is executed against it. Web-CAT and Marmoset, in turn, optionally allow the instructor provide test cases to be confronted with students’ program, but do not allow the instructor to provide a reference program to be executed with students’ test cases.

3.1 ProgTest: feedback to students

Although ProgTest provides to students the testing coverages of their programs, it is not easy to understand what each coverage is and what a lower/higher value for each of them represents. Thus, the problem of understanding how good/bad the assignments are turns into the problem of understanding what the coverage means. This is a hindrance for students, especially for the novice ones.

In ProgTest, we have mapped the testing coverages into six assessment metrics to provide the students a more meaningful feedback:

Debugging completeness: Assesses whether there are defects in the student’s program which are revealed by the student’s test cases, but they were not debugged and fixed. It is equivalent to the coverage of non failured test cases for thePSt−TStexecution.

Testing completeness: Assesses whether there are elements of the student’s program (i.e., statements, conditions, etc.) which were not tested. It is equivalent to the average of the covered statements and conditions for thePSt−TStexecution.

Program correctness: Assesses whether there are defects in the student’s program which are revealed by the instructor’s test cases. It is equivalent to the coverage of non failured test cases for thePSt−TInstexecution.

Program adequacy: Assesses whether there are unnecessary elements (i.e.,

statements, conditions, etc.) in the student’s program. An example of this situation is discussed in Section 5.2. It is equivalent to the average of the covered statements and conditions for thePSt−TInstexecution.

Tests correctness: Assesses whether there are problems in the student’s test cases by using the oracle program. It is equivalent to the coverage of non failured test cases for thePInst−TStexecution.

(9)

Tests adequacy: Assesses whether the student’s test suite is weak. That is, the test suite is not able to execute all elements (i.e., statements, conditions, etc.) of the oracle program.

Through these metrics, students can understand how good/bad each characteristic of his or her assignment is. However, it is necessary to provide the students information regarding what they have to do to improve his or her assignments. We have designed some reports to give the students some hints about this (Figure 2).

Figure 2 ProgTest feedback: (a) failed tests; (b) uncovered statements and conditions; (c) textual hints and (d) unnecessary statements and conditions

(a) (b)

(c) (d)

Firstly, ProgTest shows to students the tests that failed (Figure 2(a)) and the elements of the program which were not executed by the test cases (Figure 2(b)). Adding new test cases to execute all elements of the program, defects in the student’s program will probably be highlighted. To successfully pass through the test cases that failed, the student will need to fix the highlighted defects.

Then, if the defects remain, textual hints about them can be shown to students (Figure 2(c)). These hints should be defined by the instructor along with his or her test cases. Similarly, if problems remain in student’s test suite, the wrong test cases can be highlighted by ProgTest.

Finally, after all problems be solved (i.e., the assignment has no defects), students are able to improve the adequacy of their assignments. On the one hand, ProgTest shows to student the elements of the instructor’s program which his or her test suite has not been

(10)

executed. Adding tests to cover these elements, student can improve his or her test suite. On the other hand, if student’s program has unnecessary elements, they will be highlighted by ProgTest (Figure 2(d)). Eliminating such elements, the student is able to improve his or her program as well.

4 Experiment planning and execution

In this section we describe an experiment conducted to evaluate the use of ProgTest in the teaching of programming foundations.

4.1 Hypotheses

Particularly, we are interested in investigating whether ProgTest is useful in helping novice programmers to increase the quality of their programs and test suites. Thus, the following hypotheses were considered:

H0=ProgTest does not help novice programmers to increase the quality of their

programs and test suites

H1=ProgTest helps novice programmers to increase the quality of their programs

and test suites.

4.2 Participants

ProgTest was applied in an introductory programming course in the first semester of 2012. A total of 34 undergraduate students, enrolled in the first semester of the Introduction of Computer Science course, attended the experiment.

4.3 Pre-requisites

Since all the students were novice programmers, no more specific knowledge was required. Even so, a couple of pre-requisites are important to allow students to use the environment in a more efficient fashion:

Basic knowledge in software testing: ProgTest has been developed in the context of the integrated teaching of programming and testing activities. For this reason, beyond the knowledge in programming, it is interesting the students have some basic knowledge in software testing as well.

Basic knowledge in unit testing frameworks: In ProgTest, the test cases should be provided as CUnit1test cases (for C programs) or JUnit2test cases (for Java

programs). So, students should know how to write test cases as proposed by these unit testing frameworks.

Familiarity with theProgTestenvironment: As it happens with most tools and environments, the complete set of ProgTest features can not be explored by students at a first meeting. The usage of ProgTest for students before the activities proposed is essential for students to familiarise with ProgTest and its features.

(11)

4.4 Procedure

The experiment was divided in two phases: training and execution. The training phase consisted of providing the students the necessary information and concepts to perform the activities which would be proposed in the execution phase. The execution phase, in turn, aimed at exploring the usage of ProgTest through the activities proposed for the students.

The training phase was carried out as three lessons of 100-minute long. In the first lesson, students were introduced to CUnit and ProgTest. Since students were used to develop their programming assignments in CodeBlocks IDE,3 we taught them how to set CodeBlocks

to add the CUnit libraries in the programs building process. Also, a practical activity was proposed to train students in how to write test cases using CUnit and how to submit their projects in ProgTest.

In the second lesson, basic concepts of software testing were introduced. Students had also to write a program and test it. The test cases were written using CUnit . Students could submit their assignments to ProgTest how many times they wanted to receive a feedback about how good (or not) their programs and test suites were.

Finally, in the third lesson, students were supposed to write and test other two different programs. The idea was to encourage them to solve any remaining doubts about software testing, writing CUnit test cases and ProgTest features.

The execution phase was carried out as one 100-min lesson. Students had to write and test four programs, similar to the programs proposed in the training phase. The programs were submitted to ProgTest and students could perform how many submissions they wanted.

4.5 Materials

Table 2 presents a brief description of the programs used by students in the training phase. All of them address different topics concerning programming foundations. Data and Identifierwere proposed in the first and second lessons, respectively. Primeand Rotationwere used in the third lesson.

Table 2 Programs used in the training phase

Title Topic Description

Data Basic control flow Checks whether a date is valid Identifier String handling Identifies whether a identifier is valid

Prime Recursion Identifies whether a number is prime

Rotation Arrays Rotates the values of an array

Similarly, Table 3 shows the programs used in the execution phase. Notice that all programs used in this phase present the same level of difficulty of the programs used during the training.

The experiment was conducted in a computing lab. Students used CodeBlocks and CUnit to write and test their programs. Also, they used ProgTest through the web to receive an immediate feedback about their assignments.

(12)

Table 3 Programs used in the execution phase

Title Topic Description

Equation Basic control flow Calculates how many real roots an equation has Palindrome String handling Identifies whether a string is palindrome Factorial Recursion Calculates the factorial of a number Reverse Arrays Reverses the values of an array

4.6 Instruments

To assess how ProgTest was able to help students, we record the status of all students’ submissions.

The grades suggested by ProgTest were used to evaluate the results achieved from the experiment. The number of submissions performed by students was also considered to determine in which activities students spent more effort.

Finally, we applied a questionnaire to get the students’ attitudes towards the use of ProgTest.

5 Results and discussion

The main results achieved from the experiment are presented and discussed next.

5.1 General results

Figure 3(a) and (b) show the average of submissions and grades by assignment.Equation was the assignment in which students had more difficulties. The number of submissions for this assignment was the highest, but the grades obtained were intermediate. Besides that, the standard deviation for theEquationassignment was the highest, suggesting that it was very difficult for some students and very easy for others.

On the other hand, the Factorialassignment was the one in which students had less difficulties. Unlikely the Equation assignment, the number of submissions for Factorialwas the lowest whereas the average grade was the highest.

The average grades for thePalindromeandReverseassignments were the lowest ones. As illustrated by Figure 3(c), probably this happened because we established a time limit (100 min) for the students to complete the assignments. Thus, students who spent much effort in the first assignments did not have time enough to write and test the next ones. In short, the behaviour of students was as follows. During the first 60 min, most of them started by the first and second assignments (EquationandFactorial). However, while a group went ahead to the next ones, another group remained working in the first and second assignments. During the last 60 min, students who went ahead concluded the last assignment (Reverse) and went back to the previous ones (in an attempt to improve their grades). Some other students started to work in thePalindromeassignment, but many of them remained working only in theEquationassignment.

To support our observations, Figure 3(d) shows how many students performed at least one submission for each assignment. For instance, 97% of students delivered their solutions for the first assignment (Equation). But these percentages decrease until the last assignment (Reverse), in which only 56% of students delivered the solutions.

(13)

Figure 3 General results: (a) average of submissions; (b) average of grades; (c) submissions by the time and (d) deliveries by assignment

(a) (b)

(c) (d)

5.2 Submission histories

We have also taken in consideration the students’ submission histories. A submission history shows the student’s progress in carrying out the proposed activities. Thus, they help the instructor to understand the student’s actions and difficulties. For instance, let’s consider the submission history obtained forstudent 16(Figure 4). The lines represent how the ‘coverage’ metrics increased/decreased through the student’s submissions. The bars show the suggested grade provided by ProgTest in each submission.

Consider theEquationassignment.Student 16achieved 92% for theprogram adequacymetric in the three submissions he or she performed. Figure 5(a) helps us to understand the reasons for this. It shows a fragment of the student’s program. The problem is in the lastifstatement. It checks whether thedeltavalue is less than zero. However, this has been just checked by the other twoifstatements above. If thedeltavalue is not higher than or equals zero, it is pretty sure the delta value is less than zero. Therefore, the condition in the lastifstatement will never befalseand student will be not able to write a test case which executes this condition asfalse. Figure 5(b) shows the correct solution for this part of the program.

Concerning student’s tests, student 16did not submit any test cases in the first submission. Because of this, he or she achieved 0% for thetesting completeness and tests adequacy metrics. These coverages increased in the second and third submissions as the student added new test cases to his or her solution. Since the student’s test cases completely covered the oracle program in the last submission, he or she achieved 100% for thetests adequacymetric. However, the student achieved only 92% for thetesting completenessmetric because his or her test cases did not completely covered that lastifcondition, as we have discussed.

(14)

Figure 4 Student 16 – submission histories: (a) equation assignment; (b) factorial assignment; (c) palindrome assignment and (d) reverse assignment

(a) (b)

(c) (d)

Figure 5 Equation assignment – comparing student 16’s program with oracle program: (a) student code fragment and (b) oracle code fragment (see online version for colours)

(a) (b)

Let’s now take the Factorial assignment. Similarly to the Equation assignment, student 16improved thetesting completenessand thetests adequacy of his or her solutions by writing new test cases to test his or her program. However, the program correctnessand theprogram adequacymetrics remained 0% until the fifth submission. The reason for this is that the student’s program had an infinite loop. Since the timeout expired while ProgTest was executing the student’s program, these metrics were assigned with 0%.

When the student wrote the last test case which was missing to achieve 100% for testing completeness, the infinite loop was reached. Then, the student realised the problem in his or her program and fixed it. So, in the last submission,student 16 achieved 100% for all metrics.

(15)

Concerning thePalindromeassignment,student 16presented a well-designed program in the first submission. Because of this, the student achieved 100% for the program correctnessandprogram adequacymetrics. However, while writing the test cases, he or she forgot that in C language a string has the extra character ‘\0’ to delimit its end. When the student tried to represent a five letters word, he or she used a five positions array (Figure 6(a)) instead of a six positions array (Figure 6(b)). For this reason, the palindrome words defined by student were always turned into non palindrome words. Consequently, these test cases always failed when executed and the student received 50% for bothtest correctnessanddebugging completenessmetrics.

Figure 6 Palindrome assignment – comparing student 16’s tests with oracle test: (a) student tests and (b) oracle tests (see online version for colours)

(a) (b)

In the second and third submissions, the student made changes in the expected output of the fail test cases, and he or she realised his or her program was ‘saying’ that words were non palindrome. However, the student thought the problem was in the program and start changing it.

From the 4th to the 7th submission, the student made changes in his or her program by using a trial-and-error practice. The values varied according to the changes made by student. However, since ProgTest aims at avoiding this kind of practice, the student was not succeed at achieving good percentages for all metrics.

Finally, concerning the Reverse assignment, student 16 performed just one submission. He or she presented a well-designed program, but no test cases were added. For this reason, the student achieved 100% for the metrics associated to the programming activity and 0% for the metrics related to the testing activity. Since the student had 100 min to write and test the four programs, we believe that he or she did not have time enough to test theReverseprogram and to fix thePalindromeassignment.

5.3 Subjective evaluation

Additionally to the data we had collected from the students’ assignments, we have also applied a questionnaire to understand their attitudes towards using ProgTest.

Figure 7(a) shows how easy/hard was for students to submit their assignments to ProgTest. Around 20% of the students found it a difficult task to perform whereas 40% of them found it very easy.

When the students were asked about the submission process in ProgTest, they answered it was a bit complicated at the first attempt, because they did not know what they had to do. However, they also pointed out the task became simpler when they understood what to do. Figure 7(b) shows how easy/hard was for students to analyse the reports provided by ProgTest. The answers were divided among ‘a bit hard’ (37%) and ‘a bit easy’ (33%).

(16)

In fact, although it was not very hard to analyse the ProgTest reports, there still are some problems to understand the information provided by them.

When asked about the reports, students said they highlight very well ‘where’ the problems in their assignments were, but it was difficult to understand ‘what’ the problems were. Although students had difficulties to understand the reports, most of them agreed that ProgTest provided an appropriated feedback on both the programming and the testing activities they performed (Figure 7(c) and (d)). Among the students who pointed out the ProgTest feedback was inappropriate, they complained mostly about the programming feedback. Actually, ProgTest is not supposed to indicate the students what they have to fix in their programs; instead, the idea is to encourage the to exercise their testing, programming and analysis skills to find the problems by themselves. As some students reported in the questionnaire, ProgTest helps to fix some few problems, but it is still necessary to understand the source code and to know what is being done.

Figure 7 Subjective evaluation: (a) submission to ProgTest; (b) analysis of the ProgTest reports; (c) feedback on programming and (d) feedback on testing

(a) (b)

(c) (d)

5.4 Hypothesis analysis

On the basis of the results discussed before, we conclude ProgTest encouraged students in writing down test cases for their assignments, improving the quality of their test suites. In most of the cases, when students executed their test cases, they were able to identify and fix bugs in the programs under development. As consequence, the quality of their programs was improved as well. For this reason, we have acceptedH1:

H1=ProgTest helps novice programmers to increase the quality of their

(17)

However, we observed that the feedback provided by ProgTest was not sufficient to help students in fixing some specific programming bugs, such as a wrong string initialisation. Improvements should be done in ProgTest to address this limitation.

6 Conclusions and future work

In this paper we described ProgTest, an automatic test-based assessment tool, which addresses the teaching of programming foundations together with testing practices. One of the aims of ProgTest is to provide an immediate feedback to students regarding the quality of the programs developed and the test cases designed.

We have applied ProgTest in an introductory programming course, discussing its use in the teaching of novice programmers. From the student’s point of view, the constant and concrete feedback provided by the tool was useful for developing better comprehension and analysis skills, both in terms of programming and testing. The obtained results suggested that the tool was quite effective in helping the novices to improve the assignments on their own, even before the instructor’s evaluation. Although students did not have time enough to complete all the proposed activities, they were able to write down adequate test cases for the assignments in which they spent more effort. When executing such test cases, students were able to identify and fix bugs, improving the overall quality of the programs under development. Besides that, the testing activity and the immediate feedback provided by ProgTest encouraged the novices to analyse and understand the behaviour of their programs, avoiding the use of a trial-and-error approach. On the other hand, the feedback provided was not sufficient to help them to realise some specific programming mistakes they have committed, such as wrong string initialisation.

From the instructor’s point of view, it is also important to point out that, additionally to the inherent benefits provided by an automated evaluation process, the results provided by ProgTest can be helpful for identifying the main difficulties faced by the students when performing the assignment, in terms of programming and testing as well. Such information can be used, for instance, to determine which concepts were better assimilated by the students and which concepts still need to be reviewed.

Despite the promising results achieved so far, we highlight the need for a more formal validation of ProgTest. Indeed, systematic and controlled experiments have been planned and should be performed in short term. Finally, future work should be conducted to keep improving the functionalities of ProgTest.

Acknowledgement

The authors would like to thank the financial support of the Brazilian funding agencies: FAPESP (Proc. 2012/04352-6), CAPES and CNPq.

References

Auffarth, B., López-Sánchez, M., Campos i Miralles, J. and Puig, A. (2008) ‘System for automated assistance in correction of programming exercises (sac)’,Anales del Congrés Internacional de Docéncia Universitária i Innovació, CIDUI ’08, Lleida, Spain, pp.104–113.

(18)

Barbosa, E., Silva, M., Corte, C. and Maldonado, J. (2008) ‘Integrated teaching of programming foundations and software testing’, Proceedings of the 38th Annual Frontiers in Education Conference, FIE ’08, Saratoga Springs, New York, USA, pp.S1H–5–S1H–10.

Barriocanal, E.G., Urbán, M-A.S., Cuevas, I.A. and Pérez, P.D. (2002) ‘An experience in integrating automated unit testing practices in an introductory programming course’,SIGCSE Bull., Vol. 34, No. 4, pp.125–128.

Caiza, J.C. and Alamo, J.M.D. (2013) ‘Programming assignments automatic grading: review of tools and implementations’,Proceedings of the 7th International Technology, Education and Development Conference, INTED ’13, Valencia, Spain, pp.1–10.

Delamaro, M.E. and Maldonado, J.C. (2001) ‘Proteum/IM 2.0: an integrated mutation testing environment’, in Wong, W.E. (Ed.):Mutation Testing for the New Century, Kluwer Academic Publishers, Norwell, MA, USA, pp.91–101.

Edwards, S.H. (2004) ‘Using software testing to move students from trial-and-error to reflection-in-action’,SIGCSE Bulletin, Vol. 36, No. 1, pp.26–30.

Edwards, S.H. (2014) ‘Work-in-progress: program grading and feedback generation with web-cat’,

Proceedings of the First ACM Conference on Learning @ Scale Conference, L@S ’14, Atlanta, Georgia, pp.215, 216.

Eler, M.M., Endo, A.T., Masiero, P.C., Delamaro, M.E., Maldonado, J.C., Vincenzi, A.M.R., Chaim, M.L. and Beder, D.M. (2009) ‘JaBUTiService: a web service for structural testing of Java programs’,Proceedings of the 2009 33rd Annual IEEE Software Engineering Workshop, SEW ’09, Skövde, Sweden, pp.69–76.

Fernández-Alemán, J.L. (2011) ‘Automated assessment in a programming tools course’, IEEE Transactions on Education, Vol. 54, No. 5, pp.576–581.

Goldwasser, M.H. (2002) ‘A gimmick to integrate software testing throughout the curriculum’,

SIGCSE Bull., Vol. 34, No. 1, pp.271–275.

Hickey, T.J. (2004) ‘Scheme-based web programming as a basis for a cs0 curriculum’,35th SIGCSE Technical Symposium on Computer Science Education, SIGCSE ’04, Norfolk, VA, USA, pp.353–357.

Holton, C. and Wallace, S.A. (2013) ‘Investigating the use of an online assignment submission and assessment system in the cs classroom’,J. Comput. Sci. Coll., Vol. 29, No. 1, pp.123–129. Ihantola, P., Ahoniemi, T., Karavirta, V. and Seppälä, O. (2010) ‘Review of recent systems for

automatic assessment of programming assignments’,Proceedings of the 10th Koli Calling International Conference on Computing Education Research, Koli Calling ’10, Koli National Park, Finland, pp.86–93.

Irvine, S.A., Pavlinic, T., Trigg, L., Cleary, J.G., Inglis, S. and Utting, M. (2007) ‘Jumble Java Byte Code to measure the effectiveness of unit tests’,Proceedings of the Testing: Academic and Industrial Conference Practice and Research Techniques – MUTATION, TAICPART-MUTATION ’07, Windsor, UK, pp.169–175.

Janzen, D.S. and Saiedian, H. (2006) ‘Test-driven learning: intrinsic integration of testing into the CS/SE curriculum’,SIGCSE Bulletin, Vol. 38, No. 1, pp.254–258.

Jones, E.L. (2001) ‘An experimental approach to incorporating software testing into the computer science curriculum’, 31st ASEE/IEEE Frontiers in Education Conference, FIE ’01, Reno, Nevada, pp.7–11.

Kinnunen, P. and Malmi, L. (2005) ‘Problems in problem-based learning – experiences, analysis and lessons learned on an introductory programming course’,Informatics in Education, Vol. 4, No. 2, pp.193–214.

Lahtinen, E., Ala-Mutka, K. and Järvinen, H-M. (2005) ‘A study of the difficulties of novice programmers’,SIGCSE Bulletin, Vol. 37, No. 3, pp.14–18.

Patterson, A., Kölling, M. and Rosenberg, J. (2003) ‘Introducing unit testing with BlueJ’,SIGCSE Bull., Vol. 35, No. 3, pp.11–15.

(19)

Sheard, J., Carbone, A., Lister, R., Simon, B., Thompson, E. and Whalley, J.L. (2008) ‘Going SOLO to assess novice programmers’,Proceedings of the 13th Annual Conference on Innovation and Technology in Computer Science Education, ITiCSE ’08, Madrid, Spain, pp.209–213.

Souza, D.M., Maldonado, J.C. and Barbosa, E.F. (2011) ‘ProgTest: an environment for the submission and evaluation of programming assignments based on testing activities’,Proceedings of the 2011 24th IEEE-CS Conference on Software Engineering Education and Training, CSEET’11, Honolulo, HI, USA, pp.1–10.

Spacco, J., Hovemeyer, D., Pugh, W., Emad, F., Hollingsworth, J.K. and Padua-Perez, N. (2006a) ‘Experiences with marmoset: designing and using an advanced submission and testing system for programming courses’,Proceedings of the 11th Annual SIGCSE Conference on Innovation and Technology in Computer Science Education, ITiCSE ’06, Bologna, Italy, pp.13–17. Spacco, J., Pugh, W., Ayewah, N. and Hovemeyer, D. (2006b) ‘The Marmoset project: an automated

snapshot, submission, and testing system’,Companion to the 21st ACM SIGPLAN Symposium on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA ’06, Portland, Oregon, USA, pp.669, 670.

Tremblay, G. and Lessard, P. (2011) ‘A marking language for the oto assignment marking tool’,

Proceedings of the 16th Annual joint Conference on Innovation and Technology in Computer Science Education, ITiCSE ’11, Darmstadt, Germany, pp.148–152.

Notes

1http://cunit.sourceforge.net/doc/index.html 2 http://junit.sourceforge.net/doc/cookbook/cookbook.htm 3 http://www.codeblocks.org/docs/main_codeblocks_en.html

Figure

Figure 1 The ProgTest environment: (a) instructor view and (b) student view
Table 1 ProgTest: integrated testing tools
Figure 2 ProgTest feedback: (a) failed tests; (b) uncovered statements and conditions; (c) textual hints and (d) unnecessary statements and conditions
Table 2 presents a brief description of the programs used by students in the training phase.
+6

References

Related documents

European Journal of Taxonomy 167 1–40 http //dx doi org/10 5852/ejt 2015 167 ISSN 2118 9773 www europeanjournaloftaxonomy eu 2015 Hughes M et al This work is licensed under a

European Journal of Taxonomy 325 1–22 https //doi org/10 5852/ejt 2017 325 ISSN 2118 9773 www europeanjournaloftaxonomy eu 2017 Lehr E et al This work is licensed under a Creative

European Journal of Taxonomy 316 1–27 https //doi org/10 5852/ejt 2017 316 ISSN 2118 9773 www europeanjournaloftaxonomy eu 2017 Olesen J et al This work is licensed under a Creative

Fore wing 7.6 mm long, 2.8 mm wide, apparently hyaline except for black pterostigma, 1.7 mm long, 0.23 mm wide, narrow and elongate, situated well distal of cell [1M]; pterostigma

The size of the first elongated segment CH9 seems constant, about 2.5–3 longer than any short anterior segment CH1–CH8; the relative size of following elongated segments is

Taxonomic history of Cocconeis molesta Kütz., Cocconeis diaphana W.Sm., Cocconeis dirupta W.Greg.. and allied taxa Cocconeis

European Journal of Taxonomy 200 1–45 http //dx doi org/10 5852/ejt 2016 200 ISSN 2118 9773 www europeanjournaloftaxonomy eu 2016 Huber B A et al This work is licensed under a

Collum with three transverse rows of setae: 6+6 anterior, 4+4 intermediate and 6+6 posterior; a small lateral incision at about midway; caudal corner very broadly rounded,