A Tutor for Learning Encapsulation in C++ Classes - CiteSeerX

3 downloads 22450 Views 202KB Size Report
introductory computer science course. The tutor helps students better understand encapsulation by administering problems for them to solve and providing ...
A Tutor for Learning Encapsulation in C++ Classes Rumen Kostadinov Amruth N. Kumar Ramapo College of New Jersey [email protected]

Abstract: We have developed a tutor to learn encapsulation in C++ classes, as discussed in a typical introductory comput er science course. The tutor helps students better understand encapsulation by administering problems for them to solve and providing instant feedback. In this paper, we will describe the design, features, use and the results of preliminary evaluation of the tutor.

1. INTRODUCTION Specific experience is required in order to recognize general principles [16]. Problems are useful to provide specific experience, and problem-solving is known to improve learning [7]. Therefore, we set out to develop a tutor that would help students learn about encapsulation in C++ classes by solving problems. Tutors such as ours have been developed for quantitative disciplines such as Physics (e.g., CAPA [8]), and electronics and control systems (e.g., CHARLIE [4]). Examples of such tutors developed for Computer Science include PILOT [5], SAIL [6] and Gateway labs [3]. PILOT is a problem generation tool for graph algorithms, SAIL is a LaTeX-based scripting tool for problem generation, and Gateway Labs generate problems on mathematical foundations of Computer Science. Our work is unique with respect to earlier work in the following ways: 1. We have attempted to build tutors for problems based on programs, problems for which the answers may not always be quantitative [11,12,13,14,15,19]. WebToTeach [2] is similar to our work, but it administers problems created by the instructor, and does not itself generate the problems. 2. Our tutor can generate an unlimited supply of problems, thereby providing as much practice with problem-solving as the learner wants. The use of problem generation systems has been shown to increase student performance by 10% in Physics [9], largely due to increased time spent on the task. Our past evaluations of other tutors [11,12,18] seem to support this result, indicating that tutors do have a role to play in Computer Science higher education.

2. THE DESIGN OF THE TUTOR Our tutor is designed to help students learn about encapsulation in C++ classes by repeatedly solving problems and obtaining feedback. The tutor is designed to be used as a supplement to classroom instruction, either in a closed laboratory or for after-class assignments. We will discuss the domain of the tutor in section 2.1, dynamic generation of problems in section 2.2, grading and feedback in section 2.3, statistics in section 2.4, user interface in section 2.5 and usage of the tutor in section 2.6.

2.1 Problem Domain Members of a C++ class may be public i.e., directly accessible by the client, or protected/private, i.e., not accessible by the client. The members include data members and member functions. The member functions include constructors, destructors and mutators.

For each problem, our tutor generates a C++ program that may include one or more classes in addition to main() function. The user has the following answering options for each problem: • Syntax Error: o accessing a private/protected variable of a class from the client o accessing a private/protected function of a class from the client • Semantic Error: e.g., accessing the value of an un-initialized data member • Code OK: the code works correctly

2.2 Dynamic Generation of Problems Limited problem set has been recently recognized as a potential drawback of encoding a finite number of problems into a tutor [17]. One scheme used in literature to dynamically generate problems is by using BNF-like grammar, e.g., [10]. In this scheme, problems are generated by randomly instantiating templates written in the grammar. Each template can be carefully designed with specific pedagogical objectives in mind. We have used such a generative scheme with our tutor to be able to generate an unlimited number of problems. The tutor randomly selects one of several templates and generates a program based on the template. It randomly selects names for classes, objects, member variables and member functions. It also randomly generates data types and values of member variables. Therefore, the tutor is capable of generating a combinatorially explosive number of unidentical problems based on the predefined templates, and a user may never see the same problem twice. Currently, we have 56 templates in our tutor on encapsulation.

2.3 Grading and Feedback We have implemented a C++ interpreter to generate the feedback. The interpreter is capable of solving the generated problems by parsing the template. Since the interpreter can execute any code, it can generate the correct answer for a problem on its own, and determine whether the user’s answer is correct/incorrect. In addition to whether the user’s answer is correct/incorrect, the tutor can explain the correct answer by describing the behavior of the program as it is executed. According to traditional Intelligent Tutoring Systems literature, this is demand feedback [1], i.e., it is provided only when the user asks for it. Note that the feedback steps through the execution of the code. The code is printed with line numbers (See Figure 1), which helps the user follow the explanation in the feedback. This is detailed feedback. Alternatively, the tutor can be configured to not generate any feedback. This is used in test mode, as discussed later.

2.4 Statistics The tutor keeps track of the user’s progress: how many problems the user has attempted, the number of problems solved correctly and the number of problems solved incorrectly by the user. It can break down these figures by the type of problems .

2.5 User Interface Figure 1 shows the user interface of the tutor. The user is led through a clockwise flow of action: from the program in the top left panel (1), to the problem statement and controls to input user’s answers in the right panel (2), the “Check My Answer” button in the middle of the right panel (not shown in Figure 2) (3), the feedback in the bottom right panel (4), the “Ne xt Problem” button at the bottom of the right panel (5), and the statistics in the bottom left panel (6). The tutor makes the “Check My Answer” and “Ne xt Problem” buttons available only in their correct contexts to avoid confusion.

2.6 Using the Tutor The tutor is capable of administering problems to a student as long as the student needs, or until the student has mastered the topic. These options allow the tutor to be used in a course in several ways: •

• •

For practice: The tutor provides detailed feedback that is a walkthrough of the program execution. Problems are generated in a sequence designed to test student competence. The tutor stops generating problems after the student has mastered the current topic. This promotes active learning and students can practice anytime, anywhere. For assignments: The tutor will not provide feedback. A predetermined sequence of problems is given to students. The tutor will maintain statistics indicating the progress of the student. Using our tutor for assignments deters plagiarism since no two problems are ever the same. For testing: This use is similar to assignments. Since students are already familiar with the interface of the tutor from practice sessions, they will feel comfortable taking a test in this environment, with all the concomitant advantages of online testing. Since the tutor randomly generates problems, tests are individualized, deterring plagiarism.

In addition, the tutor can be used in distance education courses where it promotes active learning

Figure 1: A snapshot of the tutor with arrows superimposed to show the flow of action

We evaluated the tutor in our Computer Science II course in Spring 2003. After eliminating students who already knew the topic (i.e., scored 100% on the pre-test), we found a 37.49% improvement from pre-test to post-test in the percentage of problems correctly answered by students (N=11) who used the tutor for practice between the tests . The comparable improvement for those who used a printed workbook was 19.07% (N=11).

Our tutor is implemented as a Java applet so that it can be accessed over the Web without constraints of time and space. The tutor uses Swing classes, consists of 32 classes, and is about 689K in size. It is currently available over the Web at http://phobos.ramapo.edu/~amruth/problets/ ACKNOWLEDGEMENTS This work was supported in part by a grant from the Ramapo College Foundation, and a grant from the Ramapo College Student Affairs Division. Partial support for this work was provided by the National Science Foundation's Course, Curriculum and Laboratory Improvement Program under grant DUE-0088864. REFERENCES [1] Anderson J.R., Corbett A.T., Koedinger K.R. and Pelletier R. Cognitive Tutors: Lessons Learned. In The Journal of the Learning Sciences, Vol 4(2), 1995, Lawrence Erlbaum Associates, Inc., 167-207. [2] Arnow, D. and Barshay, O. WebToTeach: An Interactive Focused Programming Exercise System. in Proceedings of FIE ’99 (San Juan, Puerto Rico, November 1999), IEEE Press, Session 12a9. [3] Baldwin, D. Three years experience with Gateway Labs. in Proceedings of ITiCSE ’96 (Barcelona, Spain, June 1996), ACM Press, 6-7. [4] Barker, D.S. CHARLIE: A Computer-Managed Homework, Assignment and Response, Learning and Instruction Environment, in Proceedings of FIE ’97 (Pittsburgh, PA, November 1997), IEEE Press. [5] Bridgeman, S., Goodrich, M.T., Kobourov, S.G., and Tamassia, R. PILOT: An Interactive Tool for Learning and Grading. in Proceedings of SIGCSE ’00 (Austin, TX, March 2000), ACM Press, 139-143. [6] Bridgeman, S., Goodrich, M.T., Kobourov, S.G., and Tamassia, R. SAIL: A System for Generating, Archiving, and Retrieving Specialized Assignments Using LaTeX. in Proceedings of SIGCSE ‘00 (Austin, TX, March 2000), ACM Press, 300-304. [7] Farnsworth, C. C. Using computer simulations in problem based learning. In Proceedings of Thirty Fifth ADCIS conference (Nashville, TN, 1994), Omni Press, 137-140. [8] Kashy, E., Sherrill, B.M., Tsai, Y., Thaler, D., Weinshank, D., Engelmann, M., and Morrissey, D.J. CAPA, An Integrated Computer Assisted Personalized Assignment System. American Journal of Physics, 61(12), (1993), 11241130. [9] Kashy E., Thoennessen, M., Tsai, Y., Davis, N.E., and Wolfe, S.L. Using Networked Tools to Enhance Student Success Rates in Large Classes. in Proceedings of FIE ‘97 (Pittsburgh, PA, November 1997), IEEE Press. [10] Koffman, E.B. and Perry, J.M.: A Model for Generative CAI and Concept Selection. International Journal of Man Machine Studies. 8 (1976) 397-410. [11] Krishna A. and Kumar A. A Problem Generator to Learn Expression Evaluation in CS I and its Effectiveness. The Journal of Computing in Small Colleges, Vol 16(4), 34-43. [12] Kumar A. Learning the Interaction between Pointers and Scope in C++, Proceedings of The Sixth Annual Conference on Innovation and Technology in Computer Science Education (ITiCSE 2001), Canterbury, UK, (June 2001), 45- 48. [13] Kumar, A. N.: “A Tutor for Using Dynamic Memory in C++”, Proceedings of 2002 Frontiers in Education Conference (FIE 2002), Boston, MA, 11/6-9/2002. [14] Kumar, A. N., Schottenfeld, O., Obringer, S.R.: “Problem Based Learning of Static Referencing Environment in Pascal”, Proceedings of the Sixteenth Annual Eastern Small College Computing Conference (ESCCC 2000), University of Scranton, PA, 10/27-28/2000, pp 97-102. [15] Kumar, A. N.: “Dynamically Generating Problems on Static Scope'”, The Fifth Annual Conference on Innovation and Technology in Computer Science Education (ITiCSE 2000), Helsinki, Finland, 7/11-13/2000, 9-12. [16] Locke J. An Essay Concerning Human Understanding. Book 2, Chapter 1, Section 2, Britannica Great Books, 1952. [17] Martin, B. and Mitrovic, A.: Tailoring Feedback by Correcting Student Answers. Proceedings of Intelligent Tutoring Systems (ITS) 2000. G. Gauthier, C. Frasson and K. VanLehn (eds.). Springer (2000) 383-392. [18] Shah, H. and Kumar, A., “A Tutoring System for Parameter Passing in Programming Languages”, Proceedings of The Seventh Annual Conference on Innovation and Technology in Computer Science Education (ITiCSE 2002), Aarhus, Denmark, (June 2002). [19] Singhal N., and Kumar A. Facilitating Problem-Solving on Nested Selection Statements in C/C++. In Proceedings of FIE ’00 (Kansas City, MO, October 2000), IEEE Press.

Suggest Documents