roy osherove tdd from scratch

25
TDD from scratch @RoyOsherove

Upload: roy-osherove

Post on 13-Jan-2015

1.212 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Roy Osherove TDD From Scratch

TDD from scratch

@RoyOsherove

Page 2: Roy Osherove TDD From Scratch

What I do (artOfUnitTesting.com)

Courses on TDD, BDD in JS, Ruby, Java and C# TDD (EpiServer TDD, MVC TDD…)Courses for Team Leaders (5whys.com)Consulting & coaching through Bouvet

Contact.osherove.com

Team Agile - All rights reserved

Page 3: Roy Osherove TDD From Scratch

Unit = Unit Of Work

Starts with a public entry point

Returns a ValueChanges System StateCalls a 3rd party system

RTFM

Page 4: Roy Osherove TDD From Scratch

Unit Testing vs. TDD

Writing the testsVs.When to write them

Page 5: Roy Osherove TDD From Scratch

TDD is NOT about testing

It is aboutDriving developmentPlays a role in design and aestheticsFocusProductivityIncremental Delivery & early Feedback

Page 6: Roy Osherove TDD From Scratch

I do not use TDD to test the whole system

Create a skeleton of a working systemSimple use cases, simplest inputsDrive development

Rest is covered byIntegration testsAcceptance Tests

Page 7: Roy Osherove TDD From Scratch

I do not use TDD if

I am working on a proof of concept One-off that is short lived, or easy to maintain and fix without testsStartup with min. viable product

Page 8: Roy Osherove TDD From Scratch

I do use TDD if

I am working on code that someone else might have to maintain at some pointI know this code will leave in this application for more than a week

Page 9: Roy Osherove TDD From Scratch

ArtOfUnitTesting.com

Page 10: Roy Osherove TDD From Scratch

Song?

Page 11: Roy Osherove TDD From Scratch

This is a test line

Page 12: Roy Osherove TDD From Scratch

Looks like you’re doing fine

Page 13: Roy Osherove TDD From Scratch

Time for a song of mine

Page 14: Roy Osherove TDD From Scratch

Bad Test

Page 15: Roy Osherove TDD From Scratch

All around me are familiar classesNo test passesNo test passes

Page 16: Roy Osherove TDD From Scratch

And I swear they passed the day beforeThey passed beforeWhat are you crying for

Page 17: Roy Osherove TDD From Scratch

And I find it kind of funnyI find it kind of sadIf we didn’t catch this earlyThen project would be dead

Page 18: Roy Osherove TDD From Scratch

I think the test had saved usBut my manager disagreesThere are clients running circles It’s a very very

Page 19: Roy Osherove TDD From Scratch

Bad testI’m stressedHe’s not impressed

Page 20: Roy Osherove TDD From Scratch

There’s a testing framework I am usingIt was hard choosing And very confusing

Page 21: Roy Osherove TDD From Scratch

And there are many mocking frameworks to choose fromI tried them allAnd It’s killing my soul

Page 22: Roy Osherove TDD From Scratch

And I find it kind of funnyI find it kind of sadThe tests that I’ve been writingAre the worst I’ve ever had

Page 23: Roy Osherove TDD From Scratch

I find it hard to tell himAfraid that he will seeI am hiding from my dev lead It’s a very very

Page 24: Roy Osherove TDD From Scratch

Bad testI’m stressedHe’s not impressed

BAD TEST

Page 25: Roy Osherove TDD From Scratch

Thank You

[email protected]

Coaching, mentoring and trainingFor team leaders, developers, architects and product owners