Top Banner
Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK
24

Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Mar 31, 2015

Download

Documents

Annette Ryman
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Identifying Novice Difficulties in Object Oriented Design

Benjy Thomasson

Mark Ratcliffe

Lynda Thomas

Aberystwyth University, Wales, UK

Page 2: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 2

How are our students doing?

• McCracken – complete software development task

• Lister – tracing code

• How about design?– Garner et al. second most frequent problem

was ‘stuck on program design’– Eckerdal et al. only 9% of graduating seniors

produced a ‘reasonable’ design

Page 3: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 3

Previous Work

• Spohrer and Soloway – putting the pieces together is the hardest

• Or-Bach and Lavy – third year students miss necessary classes, place irrelevant attributes within classes

• Holland et al. misconceptions lead to errors, for example:– object/variable conflation– object/class conflation– identity/attribute conflation

Page 4: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 4

This experiment

• Collected beginning students’ designs as simple UML class diagrams

• Initially analysed paper designs

• Later used designs that were input to Vortex Teaching IDE (more later)

• Here we will concentrate on the designs used to perform the categorisation

Page 5: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 5

The Problem

Model classes for a paperround system identifying the classes required, their attributes (and their methods).

An individual paperround consists of a paperboy/papergirl delivering orders to various customers.

round = route

Page 6: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 6

Basic Possible Model Answer

Classes:

• Paper

• Address

• Order

• Round

• Customer

• PaperCarrierPerson

Customer

-String name

-Address address

-Order order

-Round round

Page 7: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 7

What kind of students?

• 180 students (115 novices, 65 some with experience) working alone

• Later studies included some group work and different problems

Page 8: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 8

Results (numeric)

Experience Number of classes identified

1 2 3 4 5 6 7

Complete novicen=115

1 14 45 39 13 2 1

Some Experience n=65

0 10 24 19 10 3 0

Page 9: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 9

Results (faults)

• Non referenced class faults– Classes that were not used anywhere

-houseNumber : Integer-streetName : String-name : String

Client

-name : String

PaperPerson

-paperName : String-deliveriesPerWeek : Integer-customer : Client

Order

Design 6

Page 10: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 10

Results (faults)

• References to non-existent classes– Classes used but not defined– These were ‘sanity checked’ for spellings,

renamings etc.

Page 11: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 11

Results (faults)

• Single Attribute Misrepresentations– Class includes single attribute that would be

better elsewhere, or– Resorting to String for an attribute

Order-paper: String-price: int-date: String-address: String

Page 12: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 12

Results (faults)

• Multiple Attribute Misrepresentations– Two or more attributes should be bundled

- name : String - houseNum : int - street : String - town : String - postCode : String - newspaper : Order

Customer

Customer from Design 16

Page 13: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 13

Results (faults)

• Multiple Object Misrepresentations– Invalid ideas about collections

-residence1 : Address-residence2 : Address-residence3 : Address-residence4 : Address

Route

Route from Design 136

Page 14: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 14

Results (fault statistics)Total classes 647

Total designs 180

Total Non-Referenced Class faults 388

Designs exhibiting this fault 97%

Total References to Non-Existent Classes 65

Designs exhibiting this fault 28%

Total Single Attribute Misrepresentation faults 208

Designs exhibiting this fault 73%

Total Multiple Attribute Misrepresentation faults 18

Designs exhibiting this fault 9%

Total Multiple Object Misrepresentation faults 2

Page 15: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 15

-houseNumber : int-road : String-town : String-postCode : String

CustomerAddress1

CustomerAddress2

CustomerAddrses3

-customerAddress1 : Address-customerAddress2 : Address-customerAddress3 : Address-customerAddress4 : Address

RoutePlan

PaperPersonAddress

-name : String-residence : Address-salary : int

PaperPerson

-publication : String-quantity : int-name : String-cost : float

CustomerOrder1

CustomerOrder2

CustomerOrder3

Design 135

In fact, many faults per design

Page 16: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 16

Page 17: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 17

In Later Versions of the Study

……

Page 18: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 18

Results were Verified Phase: 1 2 3

Total classes 647 295 254

Total designs 180 59 53

Total Non-Referenced Class faults 388 129 112

Designs exhibiting this fault 97% 86% 83%

Total References to Non-Existent Classes 65 34 17

Designs exhibiting this fault 28% 36% 30%

Total Single Attribute Misrepresentation faults

208 35 34

Designs exhibiting this fault 73% 41% 36%

Total Multiple Attribute Misrepres. faults 18 12 12

Designs exhibiting this fault 9% 19% 17%

Total Multiple Object Misrepresentation faults 2 0 0

Page 19: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 19

Groups Worked BetterComparison of classes identified from collaborative groups and

individuals' designs

0%

10%

20%

30%

40%

50%

1 2 3 4 5 6 7 8

Classes identified

Des

ign

s

Individuals Groups

Page 20: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 20

Conclusions

• Biggest problem is non-referenced classes– Students know they need a class but can’t figure out

how to integrate it into design

• Next biggest problem – Misrepresentations– Failure to achieve high cohesion

• Not exhibited:– Problems identified by Holland: object/variable

conflation, object/class conflation, identity/attribute conflation

– Collection problems

Page 21: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 21

Next Piece of Work

• Interactive Case-Based tutoring tool to catch these faults and warn students about them

• Next Page Vortex

Page 22: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 22

Page 23: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 23

Page 24: Identifying Novice Difficulties in Object Oriented Design Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK.

Thomasson, Ratcliffe, Thomas Aberystwyth University 24

Fault identified by VorteX Resolution suggested - VorteX Reference to Non-Existent Class fault caused by “Delivery order” attribute of “PaperPerson” class.

Modify the attribute to reference the intended class or remove the attribute.

Non-Referenced Class fault caused by no references to “PaperPerson” class.

Incorporate the class within the design by making a reference to it from within another class.

Single Attribute Misrepresentation caused by “String address” attribute with “PaperPerson” class.

Separate the attribute into a class of its own, if one does not already exist. Make a reference to the new/existing class by providing an alternative attribute.

Multiple Attribute Misrepresentation caused by “String houseName”, “int houseNumber”, “String street”, “String town” in “DeliveryOrders” class. These attributes have been recognised as representing an “Address”

Separate the attributes into a class of their own, if one does not already exist. Make a reference to the new/existing class by providing an alternative attribute.