identifying novice difficulties in object oriented design
DESCRIPTION
Identifying Novice Difficulties in Object Oriented Design. Benjy Thomasson Mark Ratcliffe Lynda Thomas Aberystwyth University, Wales, UK. How are our students doing?. McCracken – complete software development task Lister – tracing code How about design? - PowerPoint PPT PresentationTRANSCRIPT
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
Thomasson, Ratcliffe, Thomas Aberystwyth University 16
Thomasson, Ratcliffe, Thomas Aberystwyth University 17
In Later Versions of the Study
……
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
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
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
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
Thomasson, Ratcliffe, Thomas Aberystwyth University 22
Thomasson, Ratcliffe, Thomas Aberystwyth University 23
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.