23
Coding Dojo/Testing Dojo: Designing Test Cases for the Gilded Rose Kata (with FitNesse) Agile Testing Days 2014 Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.

Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Embed Size (px)

Citation preview

Page 1: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Coding Dojo/Testing Dojo:Designing Test Cases for the Gilded Rose Kata (with FitNesse)

Agile Testing Days 2014

Peter Kofler, ‘Code Cop’@codecopkofler

www.code-cop.org

Copyright Peter Kofler, licensed under CC-BY.

Page 2: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Peter Kofler

• Ph.D. (Appl. Math.)

• Professional SoftwareDeveloper for 15 years

• “fanatic about code quality”

• I help development teams

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 3: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Coding Dojo?Expectations?

Page 4: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Coding Dojo Mindset

● Safe place outsidework

● We are here to learn● Need to slow down● Focus on doing it right● Collaborative Game

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 5: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Coding Dojo Rules

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 6: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Two Basic Things

● Collaborative = Pair Programming● do not talk for too long● do not interrupt the other

● Test Driven Development● think about test cases● write the test first (we only write tests today)

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 7: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Dojo Structure

● Introduction 15'● FitNesse Demo 5'● Coding 35'● Interim (Retrospective) 5'● (Optional) Break 30'● Coding 35'● Retrospective 25'

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 8: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Welcome to the Gilded Rose

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 9: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

The existing inventory system

● We have items to sell. Items degrade in quality the older they get.

● All items have a SellIn value which denotes the number of days we have to sell the item.

● All items have a Quality value which denotes how valuable the item is.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 10: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Requirements

● At the end of each day our system lowers both values for every item.

● Once the sell by date has passed, Quality degrades twice as fast.

● The Quality of an item is never negative.● The Quality is never more than 50.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 11: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Special Item: Brie

● Aged Brie actually increases in Quality the older it gets.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 12: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Backstage Passes

● A backstage pass increases in Quality as it's SellIn value approaches (by a complex formula)

● but Quality drops to 0 after the concert.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 13: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Special Item

● Sulfuras, a legendary item, never has to be sold or decreases in Quality.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 14: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Now let's prepare

● Find a pair● Get the code from

https://bitbucket.org/pkofler/gilded-rose-fitnesse

● Set up the environment(compile.bat/sh then startFitNesse.bat/sh)

● Open http://127.0.0.1:8080/● Go to the GildedRose sub-wiki

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 15: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

→Demo:How to add a test case in FitNesse

Page 16: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

What Will We Do Now?

● Modify existing test cases, play around● Create some “perfect” tests

● derive test cases from requirements● name test cases accordingly● test boundary conditions● readable, concise, free of duplication

● Experiment with styles

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 17: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Create a test suite that is a readable document at the

same time!

Page 18: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Don't Focus on Getting it Done.F0cus on Doing

It Perfectly.

Page 19: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

→Practice

Page 20: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Closing Circle

● What did you learn today?

● What surprised you today?

● What will you do differently in the future?

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 21: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Please evaluate my presentation by using the rating function which you can find at my session details on:

http://www.agiletestingdays.com/session/coding-dojo-for-testers-designing-test-cases-part-i/

Thank You!

Page 22: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

Peter Kofler @codecopkofler

www.code-cop.org

co-facilitated by Martin Klose@martinklose

www.klosebrothers.de

Kata by Emily Bache @emilybache

http://coding-is-like-cooking.info/2013/03/writing-good-tests-for-the-gilded-rose-kata/

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 23: Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)

CC Images● Dojo http://www.flickr.com/photos/49715404@N00/3267627038/● Rules https://www.flickr.com/photos/phunk/4188827473● Todos http://www.flickr.com/photos/kylesteeddesign/3724074594/● Inn http://www.flickr.com/photos/danielleblue/170496395/● Brie http://www.flickr.com/photos/chez_loulou/2767503201● Pass http://www.flickr.com/photos/frf_kmeron/5556518514● Sulfuras https://www.flickr.com/photos/sharelabs/11195626116● Wants you http://www.flickr.com/photos/shutter/105497713/

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY