Game Assignments in computer Science

31
K.Becker & J.R.Parker Learning with Games - MRU SoTL Nov. 2010 1 Do Game Assignments Help Do Game Assignments Help Programming Students Learn Programming Students Learn More? More? Katrin Becker J.R.Parker Nov 2010 This session focuses on the measurable effects of using games as assignments in a programming class.

description

Using Standard Software Metrics to Analyze Student Effort on Games

Transcript of Game Assignments in computer Science

Page 1: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 1

Do Game Assignments Help Do Game Assignments Help Programming Students Learn Programming Students Learn

More?More?

Katrin Becker J.R.ParkerNov 2010

This session focuses on the measurable effects of using games as assignments in a

programming class.

Page 2: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 2

What I’m Playing Now

Page 3: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 3

What Are We Trying to Do?

Constructivist and Behaviourist (Instructionist) approaches are both useful in some circumstances. Can

we see an advantage to either one in the first CS

courses?

Page 4: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 4

What Are We Trying to Do?

Can we suggest a method or protocol for experimenting with this kind of question?

Eve online

Page 5: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 5

Can We Determine If One Is Working Better?

Use each method on different but equivalent CS102 classes.

Record: o Amount of work done o Progress in successor courses

Blood Magic

Page 6: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 6

An Opportunistic Experiment

• Different sections of the same course - (Computer Science 233) were allowed to proceed individually, with no formal coordination of assignments or exams.

• This was not the norm, but it did allow us to conduct a simple comparison of the methods used in the two courses.

• Specifically, the assignments given to the students could be assessed and compared. Heavy Rain

Page 7: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 7

Experimental Protocol

Four sections of the class were offered in the Winter session.

One instructor chose to assign a behaviorist assignment set, the other a constructivist set, both using the Java language.

The courses were taught to the same course description and explicit syllabus, and should have included the same basic content. Limbo

Page 8: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 8

Experimental Protocol

Students submit their assignment solutions using an on-line system, allowing us to collect all of the solutions as they were completed.

We used standard software engineering complexity metrics to determine how complex the solutions were.

Student grades in successor course were collected and averaged for comparison.

Limbo

Page 9: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 9Tomb Raider

Assuming that the assignment grades in both classes are equivalent, then the assignments that involved the largest amount of work or effort should be an indicator of how much was learned.

Using Observed Effort

Page 10: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 10

Behaviourist vs Contructivist

•Specified in great detail (methods, parameters, even names)

•Little room for variation

•Designed to mimic a specific tiny application that is fully understood.

•Stated Objective; details left to student

•Considerable room for variation

•Designed to reside at the edge of the student’s ZPD

Page 11: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 11

Constructivist Assignments*

1. Be accessible to everyone at the start.

2. Invite students to make decisions.

3. Encourage "what if" questions.

4. Encourage students to use their own methods.

5. Promote discussion and communication.

6. Be replete with patterns.

7. Lead somewhere.

8. Have an element of surprise.

9. Be enjoyable.

10. Be extendable. (*G. H. Wheatley)School Tychoon

Page 12: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 12

Behaviourist Assignments

1. Student Grades (% to letter)2. A Point class3. Class extension (shape, circle)4. Mortgage Calculator (Swing GUI)5. Greenhouse simulation (Sensors

control devices)

Secret of Monkey Island

Page 13: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 13

Constructivist Assignments

1.Transition - convert small program to Java2. First Class - implement a class that serves as

an enhanced version of a data type that was used in the previous program.

3. Encapsulation; Simple Data Structures - Write an ACSII-graphics version of the Four Seasons Solitaire game.

4. Parsing -Design and write a recursive parser for expressions.

5. Inheritance -ASCII-graphics version of the Centipede arcade game.

Mass Effect

Page 14: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 14

Measuring the Programs

They are some of the oldest measures of program complexity (1977).

We chose the commonly encountered Halstead metrics because… they are commonly encountered.

Grim Fandango

Page 15: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 15

Measuring the Programs

Elder Scrolls IV: Oblivion

These metrics are based on the simple measurements:

n1 = the number of distinct operatorsn2 = the number of distinct operandsN1 = the total number of operatorsN2 = the total number of operands

Page 16: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 16

Measuring the Programs

Program Length N

A measure of program length in terms of the number of tokens used by the program.

It is calculated as

N = N1 + N2(total # operators & operands)

Page 17: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 17

Measuring the Programs

Vocabulary nThe number distinct symbols used by the

program. It is calculated as

n = n1 + n2

(# distinct operators & operands)

Page 18: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 18

Measuring the Programs

Lines of Code (LOC)The number distinct symbols used

by the program. It is calculated as LOC = N / 3.14

Page 19: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 19

Measuring the Programs

Effort: the relationship between an estimate of the volume of information required to specify a software program (V) and the program level, a measure of the relation between the volumes of the most compact representation and the actual program. E = V/PL PL = 1 / (( n1 / 2 ) * ( N2 / n2 )) V= N * (LOG2 n)

Page 20: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 20

Measuring the Programs

Time to code: This is an estimate of how long it would generally take to write the program.

T = E/K For the Java language the constant 0.9 was used.

Page 21: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 21

Averaged over all assignments

Constructivist Behaviourist # of tokens N: 481.1 368.6Vocabulary: 533.8 315.4Length: 4846.4 2556.2 (total=29,078.5)

(total=12,780.8)LOC: 153.2 117.4 (total=919.3) (total=586.9)

Page 22: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 22

Games Vs Other Assignments

Median Effort

Assignment Constructivist Behaviourist 1 9178.4 15946

2 18316 101023 29045 7669.94 22018 114275 40438 22972

  Unbiased mean 24,910 13,623  Total Effort 149,461 68,117

Page 23: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 23

Games Vs Other Assignments

Median Time to Code

Assignment Constructivist Behaviourist 1 2.8328 4.92152 5.6531 3.11783 8.9647 2.36724 6.7956 3.5275 12.481 7.0902

  Unbiased mean     7.69 4.20 Total Time 46.1321.02

Page 24: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 24

Measuring the Programs

Cyclomatic Complexity: A measure of how many paths there are through a program.

A graph can be created in which each node corresponds to a block of code, and each arc to a branch. The cyclomatic number is the maximum number of linearly independent circuits.

Page 25: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 25

Measuring the Programs

Cyclomatic Complexity

The results of multiple experiments (G.A. Miller) suggest that modules approach zero defects when McCabe's Cyclomatic Complexity is within 7+/- 2. Cyclomatic Complexity between 10 and 15 minimized the number of module changes.

Page 26: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 26

Cyclomatic Complexity

(Computed by JavaNCSS) Assignment Constructivist

Behaviourist 1 8 282 3.87  1.693 4.18    1.694 3.05    1.135 2.15    1.7

Page 27: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 27

Successor Classes

The students in the constructivist group achieved an average grade 0.7 higher than did the behaviourist group in the successor programming class;

Grades are computed on a 4-point scale, so this would represent an 18% improvement

Ace Combat 5

Page 28: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 28

Successor Classes

This improvement deteriorates with time.

Taking the successor 4 months later reduces the improvement to 0.1 from 0.7, or 2.5%.

Improvement is somewhat higher for the 'A' students.

Neo Steam The Shattered Continent

Page 29: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 29

Conclusions

The constructivist assignment set appears to require much more effort than the behaviourist set.

We have results of other measures, including cyclomatic complexity, methods per class, and object oriented metrics, that confirm this.

Constructivist taught students do slightly better in the next course.

Super Mario Galaxy 2

Page 30: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 30

Next Steps

• Repeated• Find analogous

measures in other work.

• Longer follow-up.***

Super Mario Galaxy 2

Page 31: Game Assignments in computer Science

K.Becker & J.R.Parker

Learning with Games - MRU SoTL Nov. 2010 31

Thanks!!Thanks!!

Title Slide: Sonny Chan

Game Images courtesy of:Official Game Sites (images are identified by

game)

Fan ArtMobygames.comGamespot.comIGN.comGamewallpapers.com