Test-Driven Development with Visual Studio 2010
-
Upload
lynn-langit -
Category
Technology
-
view
2.126 -
download
0
description
Transcript of Test-Driven Development with Visual Studio 2010
![Page 1: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/1.jpg)
17-20 OCTOBER 2011
DURBAN ICC
![Page 2: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/2.jpg)
Test Driven DevelopmentIt’s All about Fluency @LlewellynFalco & @LynnLangit
![Page 3: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/3.jpg)
Is Testing Faster? (Test After)
Work (code)
Non-Work(tests)
60 Minutes
X minutes
Code60 Minutes< Code + Test
60 + X minutes
![Page 4: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/4.jpg)
Is Testing Faster? (Test 1st)
Work (code)
Non-Work(tests)
30 Minutes
X minutes
Code60 Minutes < Test + Code
X + 30 minutes?
![Page 5: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/5.jpg)
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
![Page 6: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/6.jpg)
![Page 7: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/7.jpg)
Parts of a Test
1) Do2) Verify
![Page 8: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/8.jpg)
Demo
![Page 9: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/9.jpg)
Benefits of Unit Tests
1) Specification2) Feedback3) Regression4) Granularity
![Page 10: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/10.jpg)
Intentional Code
// Create a Side from (0,0) to (5,0)
var side = new Side(0,0,5,0);
![Page 11: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/11.jpg)
Consume 1st
Write the objects & methods you wish existed
![Page 12: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/12.jpg)
Test Until Bored
Test the cases that bring you value
![Page 13: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/13.jpg)
VerificationIs it the right answer?1. Change the Question2. Ask an expert
![Page 14: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/14.jpg)
Completing the CircleYour output should tell the story.Objects should have ToStrings
Benefits1. Specification2. Feedback3. Regression4. Granularity
![Page 15: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/15.jpg)
Fake it Till You Make ItBuys some timeAllows for Triangulation
![Page 16: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/16.jpg)
Verifying MultiplesVerify Single:Approvals.Approve(result);
Verify Many:Approvals.Approve(results, "label");
![Page 17: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/17.jpg)
Multiple Cases
Approvals.Approve(cases, c => TestWith(c));
![Page 18: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/18.jpg)
Maintaining TestsSame Quality as Production Code
![Page 19: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/19.jpg)
ResourcesTest Driven Development: By Example
Kent Beck
![Page 20: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/20.jpg)
Resourceswww.ApprovalTests.com
![Page 21: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/21.jpg)
Resources
Intro To TDD Class (4 Day)Legacy CodeSQL Server (Dev, BI)SQL Azure
www.Develop.com
![Page 22: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/22.jpg)
TeachingKidsProgramming.orgDo a Recipe Teach a Kid (Ages 10 ++)Microsoft SmallBasic Free Courseware (recipes)
![Page 23: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/23.jpg)
Contact Information@LlewellynFalcohttp://LlewellynFalco.Blogspot.comhttp://www.approvaltests.com
@LynnLangithttp://www.LynnLangit.com
![Page 24: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/24.jpg)
Submit your session evaluation for a chance to win!
Sponsored by MVA
http://microsoftvirtualacademy.com
![Page 25: Test-Driven Development with Visual Studio 2010](https://reader035.fdocuments.in/reader035/viewer/2022062319/554f9010b4c905435d8b4fff/html5/thumbnails/25.jpg)
Creating
the futuretogether