test-driven development with visual studio 2010

Post on 11-May-2015

2.130 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

deck from TechEd Africa on TDD

TRANSCRIPT

17-20 OCTOBER 2011

DURBAN ICC

Test Driven DevelopmentIt’s All about Fluency @LlewellynFalco & @LynnLangit

Is Testing Faster? (Test After)

Work (code)

Non-Work(tests)

60 Minutes

X minutes

Code60 Minutes< Code + Test

60 + X minutes

Is Testing Faster? (Test 1st)

Work (code)

Non-Work(tests)

30 Minutes

X minutes

Code60 Minutes < Test + Code

X + 30 minutes?

Today’s Kata: Triangle1) A side has a distance2) Side knows endpoints3) 3 points4) 3 sides5) Perimeter6) Get sides touching a point7) Get side opposite a point8) The angle of 2 sides touching a point9) 3 angles10) Right Triangle

Parts of a Test

1) Do2) Verify

Demo

Benefits of Unit Tests

1) Specification2) Feedback3) Regression4) Granularity

Intentional Code

// Create a Side from (0,0) to (5,0)

var side = new Side(0,0,5,0);

Consume 1st

Write the objects & methods you wish existed

Test Until Bored

Test the cases that bring you value

VerificationIs it the right answer?1. Change the Question2. Ask an expert

Completing the CircleYour output should tell the story.Objects should have ToStrings

Benefits1. Specification2. Feedback3. Regression4. Granularity

Fake it Till You Make ItBuys some timeAllows for Triangulation

Verifying MultiplesVerify Single:Approvals.Approve(result);

Verify Many:Approvals.Approve(results, "label");

Multiple Cases

Approvals.Approve(cases, c => TestWith(c));

Maintaining TestsSame Quality as Production Code

ResourcesTest Driven Development: By Example

Kent Beck

Resourceswww.ApprovalTests.com

Resources

Intro To TDD Class (4 Day)Legacy CodeSQL Server (Dev, BI)SQL Azure

www.Develop.com

TeachingKidsProgramming.orgDo a Recipe Teach a Kid (Ages 10 ++)Microsoft SmallBasic Free Courseware (recipes)

Contact Information@LlewellynFalcohttp://LlewellynFalco.Blogspot.comhttp://www.approvaltests.com

@LynnLangithttp://www.LynnLangit.com

Submit your session evaluation for a chance to win!

Sponsored by MVA

http://microsoftvirtualacademy.com

Creating

the futuretogether

top related