Test-Driven Design for Introductory OO Programming. Viera Krňanová Proulx. Northeastern University. SIGCSE 2009, Chatanooga, TN

Similar documents
THE PEDAGOGY OF PROGRAM DESIGN.

How to Request a Client using the UCC Self Serve Website. The following provides a detailed description of how to request a client...

John Clements Department of Computer Science Cal Poly State University 1 Grand Street San Luis Obispo, CA (805)

Preface A Brief History Pilot Test Results

B. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics

Programming 2. Outline (112) Lecture 0. Important Information. Lecture Protocol. Subject Overview. General Overview.

Panel: Using App Inventor in Introductory CS Courses

Tunxis Community College eportfolio Project Evaluation Report submitted by Professor Laura M. Gambino September 30, 2011

A Simple Course Management Website

Designed in collaboration with Infosys Limited

11 HashMap: Overriding equals ; JUnit; Vistors

San José State University Department of Computer Science CS151, Object Oriented Design, Section 04, Fall, 2016 (42968)

TOOLS AND TECHNIQUES FOR TEST-DRIVEN LEARNING IN CS1

Educator Learning Journeys. Tracy Immel Global Director Teacher Professional Development Programs & Certification

Assessment Tool Benchmark Time Frame Person/Group Analysis Assessment Method Responsible

CMSC131. Inheritance. Object. When we talked about Object, I mentioned that all Java classes are "built" on top of that.

Calculator Problem and the Design Recipe

THROUGH COMMUNITY SERVICE PROJECTS

Computer Science Technology Department

Spring 2018 El Camino College E. Ambrosio. Course Syllabus

San José State University Department of Computer Science CS049J, Programming in Java, Section 2, Fall, 2016

Introductory Computing: The Design Discipline

The CISM Education Plan (updated August 2006)

NSA s Centers of Academic Excellence in Cyber Security

Object-Oriented Programming for Managers

Implementation of an eportfolio Early Adopter Phase: Processes and outcomes

CS 210 Algorithms and Data Structures College of Information Technology and Engineering Weisberg Division of Engineering and Computer Science

C12a: The Object Superclass and Selected Methods

OOP as an Enrichment of FP

Cross Teaching Parallelism and Ray Tracing: A Project based Approach to Teaching Applied Parallel Computing

Course materials Reges, Stuart, and Stepp, Martin. Building Java Programs: A Back to Basics Approach. 2d ed. (Boston: Addison-Wesley, 2011).

Tina Ladabouche. GenCyber Program Manager

COWLEY COLLEGE & Area Vocational Technical School

Programming 1. Outline (111) Lecture 0. Important Information. Lecture Protocol. Subject Overview. General Overview.

10 Generating Javadocs; HashMap: Overriding equals

The class Object. Lecture CS1122 Summer 2008

San José State University Department of Computer Science CS151, Section 04 Object Oriented Design Spring 2018

WHAT HAPPENS AFTER PYTHON IN CS1? *

Homeschool Programming, Inc.

Curriculum Mapping for National Curriculum Statement Grades R-12 and Oracle Academy.

Ensuring Quality in the Cisco Networking Academy Program

Student Affairs Career Services. Onboarding and Job Posting Employer Guide

FULL STACK FLEX PROGRAM

Teaching with Technology. Retooling Lecture Capture

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

Outline EXPERIENCE WITH TWO OOP LANGUAGES IN ONE COURSE. HISTORY Methodology and learning design of the course Experience from classes

Rochester Institute of Technology Golisano College of Computing and Information Sciences Department of Information Sciences and Technologies

Computer Science Technology Department

AP Computer Science Course Syllabus

Entering Course Schedules into Banner Administrative 1

CS1004: Intro to CS in Java, Spring 2005

Comprehensive Program Review Report

Why Structural Recursion Should Be Taught Before Arrays in CS 1

Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently.

Agile Test Automation ICAgile

Course: Honors AP Computer Science Instructor: Mr. Jason A. Townsend

Updated: 2/14/2017 Page 1 of 6

Yammer Product Manager Homework: LinkedІn Endorsements

N/A. Yes. Students are expected to review and understand all areas of the course outline.

Introduction to Qualtrics

ITSY Information Technology Security Course Syllabus Spring 2018

IUPUI eportfolio Grants Request for Proposals for Deadline: March 1, 2018

PROGRAM OUTLINE. Information Technology with Co-op, System Programming. PROGRAM DESCRIPTION Concentration 1: DELIVERY METHODS PROGRAM DURATION

A SCHEME UNIT-TESTING FRAMEWORK

UX / UI THE BOOT CAMP AT UT AUSTIN CURRICULUM OVERVIEW. McCombs School of Business School of Information

3D Graphics Programming Mira Costa High School - Class Syllabus,

San José State University College of Science/Department of Computer Science CS 152, Programming Language Paradigms, Section 03/04, Fall, 2018

A. Department Information: Business and Economics Management Information Systems Course ID: MIS 090

USING EPORTFOLIOS TO PROMOTE STUDENT SUCCESS THROUGH HIGH- IMPACT PRACTICES

Helpdesk. Shopping for Technology. Talkin Tech Highlights... Computing on the Go!

FULL STACK FLEX PROGRAM

Compulsory course in Computer Science

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

MGA Developing Interactive Systems (5 ECTS), spring 2017 (16 weeks)

SYLLABUS. Departmental Syllabus

The University of Jordan. Accreditation & Quality Assurance Center. COURSE Syllabus

mcommerce & Monetization Mobile Media Innovation Module 5

CALIFORNIA STATE POLYTECHNIC UNIVERSITY, POMONA ACADEMIC SENATE ACADEMIC PROGRAMS COMMITTEE REPORT TO THE ACADEMIC SENATE AP

Information Technology Health Informatics OIT Assessment Report Information Technology Health Informatics Mission Statement:

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

Faculty/Staff Websites

2005 University of California Undergraduate Experience Survey

B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET

Equality for Abstract Data Types

August 28, To: Dean Grasso From: Gene Bressler, Professor and Department Head RE: Changes to the Masters of Landscape Architecture Curriculum

N/A. Yes. Students are expected to review and understand all areas of the course outline.

Matthew Patrick Sopha Clinical Assistant Professor Department of Information Systems, W. P. Carey School of Business, Arizona State University

The First Year. Matthias Felleisen PLT Northeastern University, Boston

ITT Technical Institute. SD2720 Advanced Software Development Using Java Onsite and Online Course SYLLABUS

Course Syllabus. Course Information

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

Inheritance. Transitivity

School of Computing and Information Sciences. Course Title: Mobile Application Development Date: 8/23/10

ab Houston Community College

COMP229. Joanne Filotti

CNG 140 C Programming. Syllabus. Course Info Fall Semester. Catalog Description

Honors & Scholars eportfolio Overview and Assessment Dr. Lindsey Chamberlain Dr. Leo Hoar

CREATIVITY MAKES THE DIFFERENCE

(Movement - Synthesis) Improve existing programming skills by developing much larger and more complex programs than in previous classes.

Student Usability Project Recommendations Define Information Architecture for Library Technology

Transcription:

Test-Driven Design for Introductory OO Programming Viera Krňanová Proulx Northeastern University vkp@ccs.neu.edu SIGCSE 2009, Chatanooga, TN 1

Disclaimer This is not TDD TeachScheme/ReachJava curriculum Curriculum that focuses on data driven design Design Recipe enforces examples/tests first Design of tests reinforces student learning Design of tests improves program structure Impossible without software support for testing The tester library team: Viera K. Proulx, Weston Jossey 2

Outline: Design Recipe: Tests/Examples first Anatomy of a Unit test JUnit is not the answer The Prima tester library Extensibility Future Plans -- Avanti Our experiences 3

Why think about testing? Testing is hard Java does not support comparing data by value Defining such equality is hard for a novice It increases the program complexity Detracts from the focus on the program design Learning to design tests, equality comparison, test reporting is a topic on its own we need pedagogy for that too But: testing should be integrated into progam design early 4

Testing Support Tester library Tests are written as a part of the program design Test library suitable for the beginner Tests compare data by their values handle collections of data handle circularity handle random choice handle tests of Exceptions... and more Test evaluation is automatic - compares data by their values 5

Designing a Method: The DESIGN RECIPE Follow these steps for every method: 1: Problem analysis and data definition 2: Purpose statement and the header 3: Examples with expected outcomes 4: Inventory/Template of available data fields and methods 5: Method body 6: Tests Pedagogical advantages: Each step is well defined -- with a tangible result -- with a guidance on what questions to ask 6

Test-First Advantages Design tests first understand what data is needed for the method understand what are the expected outcomes gain insight into how the method behaves Evaluating the tests define additional tests based on method design know that the expected behavior works for failed tests see what went wrong Benefits simple methods -- simple tests 7

Anatomy of a Unit Test How to set up, what to compare define examples of data and expected results invoke the method compare actual and expected How to evaluate the test cases define methods to compare actual and expected How are the results reported display which tests failed provide a link to failed tests show why the tests failed 8

Why not JUnit? Defining the tests extends TestCase before you see inheritance no access to private methods, fields new syntax, language Evaluation of the test cases define your own equals method Reporting of the results JUnit bar: red or green links to the line where the test failed expected:<btnode@c66e698d> but was:<btnode@52d68153> 9

Why not JUnit? The key problems for a novice: extra language, syntax the need to define equals method Test result reporting uninformative of course, we can teach students to do this... they should learn how to do this...... but not in their first week of Java 10

Let's compare: Binary Search Tree: ABST, Node, Leaf Test the add method - build a tree we want to make sure the tree is built correctly the test should compare two trees Defining equals method Three classes: needs to use getclass Should override hashcode... and test that both work correctly... Define tostring method to make sure the results are meaningful 11

Define equals only: 12

Test case definition: 13

Test results: 14

Test results: 15

Test results: 16

Prima tester library Functionality Uses reflection to compare arbitrary objects Easy setup for a novice: Examples class No equals - all equality evaluation is done by the library No tostring method needed - done automatically A variety of reporting options failed tests only all tests pretty-print all data always shows user-defined tostring with pretty-print 17

Prima tester library A wide range of test scenarios compare any two objects, including circularly defined compare two Iterable objects compare two Map objects checkoneof a random set of values checkrange value within the given range: Comparator checknumrange mixed numeric ranges test if a method throws exception with the given message checkfail for test we want to fail 18

Prima tester library User options user can define several classes with test methods user can implement own equality: interface ISame<T>{ boolean same(t t); } checkequivalence user implements Equivalence interface interface Equivalence<T>{ boolean equivalent(t t1, T t2); } user can annotate any method to be a test method user can include test methods within class definition this provides access to private fields and methods Printer.print(Object obj) pretty-prints any object 19

Avanti tester library Goal: support seasoned programmer... learning ground for defining own tests, evaluation... includes a coverage tool special support for testing effects special support for comparing data structures 20

Our Experiences Tester library Classroom trials: Spring 2008 -- the first prototype Fall 2008 -- beta version used at five institutions Northeastern University Worcester Polytechnic Institute, Worcester, MA Seton Hall University, South Orange, NJ dupont Manual High School, Louisville KY Millard Public Schools, Omaha, NE Spring 2009 -- fully deployed, new users added Vassar College, Poughkeepsie, NY -- in a regular Java course 21

Our Experiences Tester library Used with hundreds of students throughout the semester Students get real feedback on validity of their programs Students believe testing matters Students understand why smaller methods are better Students explore the design of the tester New appreciation of the meaning of equality Some get excited about testing! Colleague reports uniformly positive 22

Our Experiences -- curriculum overall Yearly surveys done for over 10 years: Coop employers report higher expectations of students Students exceeed even the higher expectations Instructors in follow-up courses: students are better prepared on pretest 30 percent failure reduced to 1 percent Very low attrition rate (<5%) Students are much more confident in their understanding of program design Dissemination: Workshop in summer 2007, 2008, 2009 at four US locations A growing number of followers 23

Summer Workshops Redesigning Introductory Computing: The Design Discipline NSF supported: DUE-0618543 One week, hands on workshops for faculty Free travel, room and moard, materials In Boston, four levels: TS/RJ, TS2, RJ, Bootstrap Join us... Garden City (Long Island), NY San Luis Obispo, CA Boston, MA Salt Lake City UT Adelphi University Cal Poly Northeastern/WPI/Brown University of Utah June 22-26 June 28-July 2 July 20-24 August 3-7 For info: http://www.teach-scheme.org 24

THANK YOU Resources Tester library: Tester library, World libraries: http://www.ccs.neu.edu/javalib Tester library: http://code.google.com/p/nutester/ Resources: TeachScheme/ReachJava curriculum: Main site for the TeachScheme/ReachJava! project: http://www.teach-scheme.org Lab materials, lecture notes, assignments: http://www.ccs.neu.edu/home/vkp/htdc.html (World libraries support the design of interactive games with graphics, timer, and key events) 25