28
Putting the D&D in TDD

Putting the D&D in TDD

Embed Size (px)

DESCRIPTION

Are you tired of TDD workshops that make you do boring things like calculate bowling scores and prime factors or demonstrate how to win at the game of life? If so, this is the session for you! In this TDD workshop we will be building the domain model for EverCraft -- a new MMORPG from Blizzards of the Coast. We have lots of story cards prepared covering features from combat to magic, classes to spells, and races to items. Plus, we'll be defining some of these cards during the session in case you want that +9 knife of ogre slaying or enjoy casting magic missile at the darkness. This workshop is language agnotisic and for all levels of developers. The focus is on TDD and emergent design but pair programming will be covered as well. The only requirement is that you bring a laptop and that you be able to test-drive you code with your language of choice. When you are done you will emerge a better programmer for the experience but there is small chance you will have a craving for Cheetos and Mountain Dew.

Citation preview

Page 1: Putting the D&D in TDD

Putting the D&D in TDD

Page 3: Putting the D&D in TDD

Adjusting the Levels

• Interrupt Us• All Levels Session

– covering some basics• Not Selling TDD

– showing how not why– the experience will show the why

• We Expect You to Pair• Language Agnostic

– Ruby, Java, .NET, JavaScript, CoffeeScript, Clojure, Scala, Groovy, Dart… maybe not

• You Know Your Tools– we’re not here to teach you JUnit or RSpec

Page 4: Putting the D&D in TDD

Katas

Page 5: Putting the D&D in TDD

TheEvercraft

Kata

Page 6: Putting the D&D in TDD

Adjusting the Levels

• Introduction• TDD & Ping Pong Pairing• Four Iterations

– retrospective after each iteration– brainstorming before iterations 2-4

• Iteration 1: Core Rules• Iteration 2: Classes• Lunch• Iteration 3: Races• Iteration 4: Items• Bonus Iteration: Battle Grid

Page 7: Putting the D&D in TDD

Our Character Sheets

5th Level Facilitator• + 5 to Teaching: can help

and teach almost any student

• Bonus Feats: TDD and Pair Programming

• Kata Mastery: have mastered the Evercraft Kata and can help if pairs get log-jammed

1st Level Product Owner• Ideation: can form general

ideas for a product at will but won't know exactly what they want

• Clarity: given a question on requirements can unerringly answer it

• Agile Advocate: can promote Pairing, TDD, and other Agile ideas to business 3 times per day

Page 8: Putting the D&D in TDD

Questions?

Page 9: Putting the D&D in TDD

TDD & Ping Pong Pairing

Page 10: Putting the D&D in TDD

A Brief History of Testing

Page 11: Putting the D&D in TDD

TDD Cycle

Write a Failing Test

Code Just Enough to

Make It Pass

Refactor Your Crappy Code

Page 12: Putting the D&D in TDD

Ping Pong Pairing

Write a Failing Test

Code Just Enough to

Make It Pass

Refactor Your Crappy Code

Page 13: Putting the D&D in TDD

Dos & Don’ts

Do…• …start with a failing test.• …write tests that become more and more specific.• …write code that becomes more and more generic.• …take turns writing tests, coding, and refactoring.• …kibitz while pairing.• …consider keeping a list of tests you need to write.

Don’t…• …write more than one test at a time.• …have more than one assert in a test.• …write any more code than is needed to make the current

test pass.• …code alone.

Page 14: Putting the D&D in TDD

Questions?

Page 15: Putting the D&D in TDD

Evercraft

Page 16: Putting the D&D in TDD
Page 17: Putting the D&D in TDD

Pair Up

Page 18: Putting the D&D in TDD

During the Kata

• Ask Questions– as product owners we might not know what we want– as facilitators we might have gaps in our material

• Present Ideas– as product owners we might like them more

• Code the Model Only• No Dice (it's just not worth the hassle)

Page 19: Putting the D&D in TDD

Rolling Up a Character

• Roll Your Own• Clone from GitHub

– https://github.com/walterg2/EverCraft-Kata– Available Projects

• Java & JUnit• C# & NUnit• Ruby & RSpec• CoffeeScript or JavaScript & Jasmine• Python• Clojure• Scala

Page 20: Putting the D&D in TDD

Iteration 1Core Rules

Page 21: Putting the D&D in TDD

Iteration 2Classes

Page 22: Putting the D&D in TDD

Welcome BackReorientation

Page 23: Putting the D&D in TDD

Iteration 3Races

Page 24: Putting the D&D in TDD

Iteration 4Items

Page 25: Putting the D&D in TDD

Retrospective

Page 26: Putting the D&D in TDD

AndThe

WinnerIs…

Page 28: Putting the D&D in TDD

Image Credits

http://www.flickr.com/photos/kimonomania/602858091http://www.flickr.com/photos/warquel/3300858929http://www.flickr.com/photos/pandiyan/82387772

http://www.flickr.com/photos/camerajohn/5151120039http://www.flickr.com/photos/kaptainkobold/174388593

http://www.flickr.com/photos/cuppini/2378443920http://www.flickr.com/photos/melloveschallah/3304593555

http://www.flickr.com/photos/denemiles/3971887734http://www.flickr.com/photos/howardlake/4318605890