Application of Program Slicing Technique to improve Novice Programming Competency in Spoken Tutorial Workshops Kiran L. N. Eranki
Kannan M. Moudgalya
IDP Educational Technology Indian Institute of Technology Bombay, Powai, Mumbai 400076, India. Email:
[email protected]
IDP Educational Technology Indian Institute of Technology Bombay, Powai, Mumbai 400076, India. Email:
[email protected]
Abstract—This work investigates the effectiveness of using program slicing technique along with spoken tutorials to improve comprehension and debugging skills of novice programmers. We also evaluate the programming pattern of the learners while using the program slicing technique. Qualitative and Quantitative studies were conducted using spoken tutorial workshops on Java course. Results of the study have shown improvement in programming competencies and conceptual understanding when subjected to program slicing techniques along with spoken tutorials. Keywords—spoken-tutorial, programming, slicing, comprehension, debugging
I. I NTRODUCTION Program slicing is a technique for simplifying programs by focusing on specific semantics and eliminate those parts of program, which have no effect upon selected semantics to identify the erroneous code of the program[1]. Slicing technique has been widely used in software testing, debugging and software assessment. For example, while debugging, there could be syntactic and semantic errors within the source code which could throw multiple errors, without showing the code which caused the bug. Slicing helps to overcome this by modularizing the entire code into slices to easily debug the erroneous code and reduces the compilation time by improving program code. Software failures are diagnosed by developers using three steps mainly fault localization, fault understanding and fault correction. localization is to identify the code which caused the failures. fault understanding involves analysis of root cause to program failure. fault correction involves eliminating the root cause to failure. All these three steps together constitute debugging. Only a handful of empirical studies were conducted in academic setting to understand the effectiveness of slicing technique in improving program competency[2]. Through this study, we evaluate the effectiveness of program slicing technique used along with spoken tutorials, to improve the novice programming skills. The paper is structured as follows: Section 2 presents the relevance of spoken tutorial workshops in programming education. Section 3 describes the research methodology used to conduct the study, followed by the results and conclusions of the study are presented.
II. S POKEN T UTORIAL W ORKSHOPS A spoken tutorial is a narrated screencast recording of an expert demonstrating how to write a program or execution method. Each tutorial is of 10-15 min duration with assignments to practice for every topic. A typical workshop can includes 10-15 tutorials teaching various concepts of the course. Free and open source software(FOSS)courses are conducted through Spoken tutorial based Education and Learning on FOSS (SELF) workshops[3]. As every spoken tutorial comes with an assignment, a student is forced to try out their understanding immediately, a facility that may not be available in conventional methods[2]. III. N OVICE P ROGRAMMING D IFFICULTIES SELF programming workshops assess students at recall, understand and apply levels of blooms taxonomy. Students were provided with a collection of short Java programs, such as generate a 3x3 matrix of numbers. These programs involved four distinct levels of complexity: 1) Basic whileloop construct. 2) Iterative looping. 3) Recursive procedures. 4) Embedded recursion procedures were used. Most of the students solved first two levels of non-recursive complexity. but had difficulty solving the last two levels due to recursive procedures. Students also have a difficulty in understanding complex programming concepts such as recursion, inheritance and polymorphism[4]. Most participants attempt to debug the code line by line without understanding the errors generated by the program code. And some participants use their prior knowledge or experience to debug the code in adhoc manner. In the remaining sections of the paper we discuss how we addressed the programming difficulties of the students and improved their programming competency through these workshops. IV. R ESEARCH Q UESTIONS This study investigates the effectiveness of program slicing technique used along with spoken tutorials to improve programming competency. Students have programming difficulties while studying complex programming concepts through
self-learning workshops. So, program slicing technique was applied to address these difficulties. The research questions examined in this study are: 1) Does program slicing technique help in improving comprehension and debugging skills of the learner? 2) Does program slicing technique change with the complexity of the program code?
program. Slicing the program into small code fragments also helps in easy debugging and comprehension. This technique helps novices learner to easily analyze the entire code by spliting the code into slices. And understand the logical flow of data slice by slice. We implemented slicing technique by giving two different set of tasks, as discussed further. Task1
Sample and Process We selected a random sample of 160 non-CS engineering students from of a local engineering college. All students had basic computer literacy. The students were distributed among experimental(A) and control(B) groups of 80 students each. These workshops are of three hour duration with posttest and individual assignments for each tutorial. Workshop covered eight Java concepts based on variable assignments, recursions, polymorphism, and inheritance topics. Both the groups watched Java spoken tutorials. But only experimental group solved programming assignments using slicing technique. While control group solved assignments using spoken tutorials alone. After the workshop, both the groups attended post-test and submitted workshop feedback questionnaires.
Students were provided with random paper slips of Java program codes related to variable assignment program. Students applied program slicing technique and manually rearranged all the slips to complete the program. Majority of students were able to complete the task by correctly arranging the code slips. Most of them categorized non-logical parts of code as slices. This confusion was caused due to misconceptions in identifying logical and non-logical aspects of the code. After the exercise, all the participants were showed the logical and non-logical parts of the code provided to them and our solution slices. After the discussion, students were asked to continue with rest of the tutorials. We followed the same procedure for all eight tutorial assignments. and validated the student solutions.
V. P ROGRAM S LICING T ECHNIQUE Approach The current study investigates the effectiveness of program slicing technique in improving programming skills. In general, program slices are constructed for a set of variables V . Thus, given a variable v at some line of program code p, a slice will be constructed for v at p. A collection of all these slices together constitutes a complete program[1]. A sample Java code to explain the concept is show below. 01 public class Factorial 02 { 03 public static void main(String[] args) 04 { final int N = 100; 05 for(int i = 0; i < N; i++) 06 System. out. println( i + "! is " + factorial(i));\\Slice 1\\ 07 } 08 09 public static int factorial(int n) 10 { int result = 1; 11 for(int i = 2; i