100 likes | 197 Views
Integrating Testing into the CS1 Syllabus at NDSU. WISTPC ’ 10 Florida International University, Miami FL. Richard Rummelt June 24, 2010. Outline. Overview of Approach Addition to Course Objectives Modification s to Projects. Overview of Approach. Minimally Intrusive Approach
E N D
Integrating Testing into the CS1 Syllabus at NDSU WISTPC ’10 Florida International University, Miami FL Richard Rummelt June 24, 2010
Outline • Overview of Approach • Addition to Course Objectives • Modifications to Projects
Overview of Approach • Minimally Intrusive Approach • Looked at the breakdown of class work to inject testing into existing assignments, and projects • Focus on tentative lab schedule for this discussion • Said “NO” to full-fledged JUnit at the beginning of the CS1 course • NDSU CS1 Syllabus Lab Assignments and Labs • Seven or Eight Assignments (Homeworks) • Seven or Eight In-Lab Projects
Course Objectives (Java Projects) • Computing and problem solving concepts • Object Oriented Programming techniques and terminology • Implementation of classes and methods • Variables and data types • Simple booleanlogic • Control structures • Exception handling • Collection structures & iteration techniques • Sorting and searching basics • Inheritance and polymorphism • Standard style conventions • Program design concepts • Sufficient documentation • Testing and debugging concepts
Project Modifications • Simplicity of projects 1 and 2 did not lend themselves to much discussion of testing • Project 1 was basic “hello world” and project 2 expands on that to include variables and the scope of instance variables • Instead we focused on integrating testing during the third week of the semester in both the lectures and the lab work.
Project Modifications (cont’d) • Project 3 • Basic elevator problem where they have to implement methods of an elevator and existing requirement was to run a pre-defined scenario and submit the output file • Extension of Project 3 with Test • Get students to think about their own scenarios of system usage and the expected outputs and write this up manually. • Introduces concepts of test inputs, and expected outputs (oracles)
Project Modifications (cont’d) • Project 4 • String manipulation problem where they have to implement methods • Extension of Project 4 with Test • Get students to use BlueJ’s ‘object bench’ to test individual methods by predicting the return values and/or variable values given various input parameters and keep a simple log of this. • Continues and reinforces concepts of test inputs, and expected outputs (oracles)
Project Modifications (cont’d) • Project 5 • Poker game with many new elements: multiple classes, conditional statements, passing objects, Object class methods (clone, equals, instanceOf) randomization, etc. • Extension of Project 5 with Test • This is where debugging is introduced. JUnit could also be introduced at this point by requiring a few clearly defined (almost, but not quite, given) • Provides the first exposure to a testing tool.
Project Modifications (cont’d) • Project 6 • The game of NIM. New concepts are looping, validity checking, exception handling, pausing threads, more advanced math calculations, etc. • Extension of Project 6 with Test • The complexity of this project makes this a good point to require JUnit test cases. The numeric nature of this project makes it a good place to teach ‘boundary value analysis’. • This would be the point at which students would begin thinking of and writing their own test cases.
Points to Note • Initially we use some features of the existing IDE to introduce the students to practical testing without the complexities of a new testing tool • We use the Object Bench of BlueJ as a test driver • By the 6th project (of 8) students are familiar with JUnit, and using it independently • For the remaining projects they continue using JUnit and refine their testing skills.