![Page 1: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/1.jpg)
Kansas City Developer Conference 2011
Unit Testing Patterns and Anti-Patterns
Steve BohlenE-Mail: [email protected]: http://blog.unhandled-exceptions.comTwitter: @sbohlen
CYND D D
![Page 2: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/2.jpg)
We want to thank the sponsors of KCDC. Without them, none of this would be possible.
Thanks to Our Sponsors
Product Sponsors
Silver Sponsors
Gold Sponsors
![Page 3: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/3.jpg)
Kansas City Developer Conference 2011
Do I suck?Let me (and the world) know!
http://spkr8.com/t/7866
![Page 4: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/4.jpg)
Kansas City Developer Conference 2011
Steve BohlenNearly 20 years developing softwareLISP, Delphi, C/C++, VB, VB.NET, C#Senior Engineer Springsource/VMwareCo-Founder, NYC Alt.Net User Group
http://nyalt.netCo-Organizer, NYC DDD User Group
http://dddnyc.orgContributor: various OSS projects
Nhibernate http://www.nhforge.orgNDbUnit http://www.googlecode.com/ndbunitSpring.NET http://www.springframework.net
blog: http://blog.unhandled-exceptions.come-mail: [email protected]: @sbohlen
CYND D D
![Page 5: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/5.jpg)
Kansas City Developer Conference 2011
RAD Controls for ASP.NET AJAX
RAD Controls for Silverlight
RAD Controls for Windows Phone
RAD Controls for Winforms
RAD Controls for WPF
Telerik Reporting
Telerik OpenAccess ORM
Telerik JustCode
Telerik JustMock
Telerik Extensions for ASP.NET MVC
Test Studio Express
Telerik TeamPulse
Telerik Test Studio
Sitefinity CMS
Telerik JustDecopile
C#/VB.NET Converter
ASPX to Razor Converter
![Page 6: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/6.jpg)
Kansas City Developer Conference 2011
![Page 7: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/7.jpg)
Kansas City Developer Conference 2011
![Page 8: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/8.jpg)
Kansas City Developer Conference 2011
Definition: Pattern
In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design.that leads to commonly occurring problems in software design.
Anti-
Anti-
![Page 9: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/9.jpg)
Kansas City Developer Conference 2011
![Page 10: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/10.jpg)
Kansas City Developer Conference 2011
![Page 11: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/11.jpg)
Kansas City Developer Conference 2011
Challenge: Running Tests
![Page 12: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/12.jpg)
Kansas City Developer Conference 2011
Interacting with your Tests
Run Selected Tests
Debug Selected Tests
Rerun
Rerun
![Page 13: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/13.jpg)
Kansas City Developer Conference 2011
Challenge: Speedy Tests
![Page 14: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/14.jpg)
Kansas City Developer Conference 2011
Challenge: Naming Tests
![Page 15: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/15.jpg)
Kansas City Developer Conference 2011
Challenge: Descriptive Assertions
![Page 16: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/16.jpg)
Kansas City Developer Conference 2011
Challenge: Repetition
![Page 17: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/17.jpg)
Kansas City Developer Conference 2011
Challenge: False Positives
![Page 18: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/18.jpg)
Kansas City Developer Conference 2011
Challenge: Faked Out!
![Page 19: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/19.jpg)
Kansas City Developer Conference 2011
Challenge: Maintenance
![Page 20: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/20.jpg)
Kansas City Developer Conference 2011
Challenge: Testing Exceptions
![Page 21: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/21.jpg)
Kansas City Developer Conference 2011
Challenge: Test Coverage
![Page 22: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/22.jpg)
Kansas City Developer Conference 2011
Challenge: Organizing Tests
![Page 23: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/23.jpg)
Kansas City Developer Conference 2011
Challenge: Data Dependency
![Page 24: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/24.jpg)
Kansas City Developer Conference 2011
Challenge: Multiple Assertions
![Page 25: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/25.jpg)
Kansas City Developer Conference 2011
And now for something completely different…
…code!
![Page 26: Kansas City Developer Conference 2011 Unit Testing Patterns and Anti-Patterns Steve Bohlen E-Mail: sbohlen@gmail.com Blog:](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d615503460f94a43ba7/html5/thumbnails/26.jpg)
Kansas City Developer Conference 2011
finiSteve BohlenE-Mail: [email protected]: http://blog.unhandled-exceptions.comTwitter: @sbohlen
CYND D D