Using Memory Diagrams When Teaching a Java-Based CS1 Mark A. Holliday David R. Luginbuhl Dept of Mathematics and Computer Science Western Carolina University.

Slides:



Advertisements
Similar presentations
Learning and Teaching Conference 2012 Skill integration for students through in-class feedback and continuous assessment. Konstantinos Dimopoulos City.
Advertisements

Lecture Roger Sutton 21: Revision 1.
Knowledge Retention from Introductory CS Courses Anthony Baxter Paul Piwowarski University of Kentucky.
Systems Analysis and Design 8th Edition
CS 211 Inheritance AAA.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Inheritance. Extending Classes It’s possible to create a class by using another as a starting point  i.e. Start with the original class then add methods,
1-1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Chapter 13: Object-Oriented Programming
An Investigation of Potential Success Factors for an Introductory Model-Driven Programming Course Michael Caspersen, Dept. of Computer Science University.
1 Chapter 8 Objects and Classes. 2 Motivations After learning the preceding chapters, you are capable of solving many programming problems using selections,
Unified Modeling Language
Second Grade Math Numbers and Operation/ Algebraic Concepts
1 CSC 221: Computer Programming I Fall 2004 course overview  what did we set out to learn?  what did you actually learn?  where do you go from here?
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented Design.
Using Jeroo To Teach Object-Oriented Concepts By Christian Digout.
An Object-Oriented Approach to Programming Logic and Design
CSE 1301 Lecture 11 Object Oriented Programming Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Summary and Exam COMP 102.
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
Java Classes Using Java Classes Introduction to UML.
CSE 1302 Lecture 7 Object Oriented Programming Review Richard Gesick.
CS 106 Introduction to Computer Science I 03 / 19 / 2007 Instructor: Michael Eckmann.
Chapter 6: Structured Vs. Object Oriented Analysis and Design.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Computer Science II 810:062 Section 01. How is CS I different from CS II? When you teach Java there are a series of decisions that have to be made…
Classes CS 21a: Introduction to Computing I First Semester,
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
Using Memory Diagrams When Teaching a Java-Based CS1 Mark A. Holliday David R. Luginbuhl Dept of Mathematics and Computer Science Western Carolina University.
Systems Analysis & Design 7 th Edition Chapter 5.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Jeliot – A powerful Java tutor for beginners Boro Jakimovski Institute of Informatics Faculty of Natural Sciences and Mathematics University “Ss Cyril.
CS442: ADVANCED PROGRAMMING USING JAVA Lab 6: Classes and objects Computer Science Department.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
CSC 221: Computer Programming I Fall 2001 course overview  what did we set out to learn?  what did you actually learn?  where do you go from here? 
OO Data Structures SE Dr. Samir Tartir 2010/2011 Second Semester.
King Saud UniversityCSC112 - First Semester CSC 112 Java Programming I Introduction.
CS1 Assessment Using Memory Diagrams Mark A. Holliday David R. Luginbuhl Dept of Mathematics and Computer Science Western Carolina University SIGCSE Technical.
CS 160: Software Engineering October 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 1: Introduction Data.
RUBY by Ryan Chase.
Chapter 5: Making Decisions. Objectives Plan decision-making logic Make decisions with the if and if…else structures Use multiple statements in if and.
Inheritance CSI 1101 Nour El Kadri. OOP  We have seen that object-oriented programming (OOP) helps organizing and maintaining large software systems.
Chapter 8 Class Inheritance and Interfaces F Superclasses and Subclasses  Keywords: super F Overriding methods  The Object Class  Modifiers: protected,
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Chapter 3: Introducing the UML
CMSC 202 Polymorphism. 10/20102 Topics Binding (early and late) Upcasting and downcasting Extensibility The final modifier with  methods  classes.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
Further Investigations into the Development and Evaluation of Reading Techniques for Object-Oriented Code Inspection Alastair Dunsmore, Marc Roper and.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Unit II-Chapter No. : 5- design Patterns
Object-Oriented Analysis and Design
Objects as a programming concept
Chapter 5: Object Oriented Analysis and Design
CSC 221: Computer Programming I Fall 2005
Object-Orientated Programming
Chapter 3 Inheritance © 2006 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
Introduction to Objects
CS 302 Week 11 Jim Williams, PhD.
Introduction to Data Structures
Data Structures and Algorithms for Information Processing
Object Oriented Programming Review
Object Oriented Programming in java
CS114B Introduction to Computer Science II
Introduction to Objects
Presentation transcript:

Using Memory Diagrams When Teaching a Java-Based CS1 Mark A. Holliday David R. Luginbuhl Dept of Mathematics and Computer Science Western Carolina University ACM-SE Conference March 7, 2003 Savannah, GA

3/7/2003ACM-SE Overview  Motivation and Introduction  Diagramming as a teaching tool – Objects, variables, and references – Primitive types, fields, visibility, and parameter passing – Static fields and methods – Arrays  Diagramming as an assessment tool  Conclusion

3/7/2003ACM-SE Motivation  Problem: – How to help CS1 students visualize state of computer as Java program executes – How to introduce and reinforce object-oriented concepts in an introductory CS course  Solution: – Diagrams Abstraction; visualization – “UML”-like UML not primarily focused on state of memory – Diagrams used in many textbooks, but without much emphasis

3/7/2003ACM-SE Criteria  Take into account features of language (for us, Java)  Visualize state of computer  Distinguish between – Objects: classes: reference variables – Reference types: primitive types – Private: public  Consistency for similar concepts  Method invocation and object construction  Labels, as appropriate  Arrays vs. other objects

3/7/2003ACM-SE Memory Diagrams  Similar to other diagrams – See, particularly, [WU2001] – But with extensions and particular emphases  Important aspects – Shape matters – Importance of reference and invocation – Indication of values with variables – Visibility rules

3/7/2003ACM-SE Objects, Variables, and References String acolor=“blue”; String favColor=aColor; String otherColor; String “blue” aColor favColor otherColor Features:  Labels on objs and vars  Different shapes  Reference lines begin inside variable

3/7/2003ACM-SE Method Invocation aColor = aColor.concat(otherColor); String “blue” aColor otherColor String “red” concat ( ) String “bluered” X Features:  Method indicated by line on object – Indicates each object has method  Method is public  Squiggly line indicates invocation  New object created  New value for aColor; old value removed

3/7/2003ACM-SE Primitive Types, Fields, Multiple Instances  Primitive type variables have numeric value – As opposed to ref types  Private fields represented inside object – Using rectangles indicates fields are just variables associated with objects  Different Student objects have same fields with (possibly) different values Student first second Student 87 score 85 score name String “Sue” String “Bob”

3/7/2003ACM-SE Static fields and methods  Static fields and methods are displayed in a diamond instead of a circle – Punch clock provides a nice example for static fields and methods  See paper for more examples, including passing parameters and diagramming arrays Employee 8 16 clock Employee john 8 start 16 end advance (8)

3/7/2003ACM-SE Student Exposure to Diagrams  We introduce these diagrams to students on the first day of CS1 class  We ask students to produce diagrams of their own – In groupwork – In directed lab work – On quizzes and tests  Bottom line: reinforcement of concepts in a number of contexts – But not just for learning…

3/7/2003ACM-SE Student Assessment  By having students use diagrams themselves, we have them demonstrate their comprehension of object- oriented concepts  We believe these diagrams have potential for measuring programming comprehension – Anecdotal evidence from several semesters of application

3/7/2003ACM-SE Example Test Problem From Last Fall  Diagram the program fragment below Dog spot;// fig a) spot = new Dog("spot"); // right hand side is fig b) // left hand side and equal sign is fig c) System.out.println(spot.toString());// fig d)  Note last line particularly – Static public variable (System.out) – Method composition – PrintStream object – Dog object – Creation of a String object

3/7/2003ACM-SE Results (13 students)  Figure a – 11 correct – 2 labeled rectangle with name of class  Figure b – 4 correct – 2 put “spot” inside var rectangle – 4 didn’t show name field – 2 had more serious errors  Figure c – all but 1 student correct Dog spot;// fig a) spot = new Dog("spot"); // right hand side is fig b) // left hand side and equal sign is fig c) System.out.println(spot.toString()); // fig d)

3/7/2003ACM-SE Results (13 students)  Figure d – All but 3 students showed call to toString() correctly – Of those 10 2 students failed only to show System.out correctly 1 showed nothing else correctly 5 missed the creation of a String object from toString() – They got the println() call right 2 showed the String object – But they missed the println() call  Summary for this exam – “Decent” correlation between overall grades and grades on diagramming problem Dog spot;// fig a) spot = new Dog("spot"); // right hand side is fig b) // left hand side and equal sign is fig c) System.out.println(spot.toString()); // fig d)

3/7/2003ACM-SE Summary for Assessment  We have more work to do  We are considering a more rigorous examination of diagramming as a student assessment tool – Not just to measure progress – We hope we can pinpoint problems and provide proper reinforcement of specific concepts

3/7/2003ACM-SE Conclusion – Memory Diagrams  A relatively low-tech approach for teaching OO concepts – Well-suited for classroom, labs, exams – Importance of shape and placement for reinforcing concepts – Having students make their own diagrams adds to this reinforcement  Promise of diagrams for measuring comprehension – If students can diagram what is happening in memory, they are probably understanding the deeper meaning of the program – More work to do