Unit Testing Patterns and Anti-Patterns

Preview:

DESCRIPTION

Unit Testing Patterns and Anti-Patterns. Steve Bohlen E-Mail: sbohlen@gmail.com Blog: http://blog.unhandled-exceptions.com Twitter: @ sbohlen. We want to thank the sponsors of KCDC. Without them, none of this would be possible. Thanks to Our Sponsors. Gold Sponsors. Silver Sponsors. - PowerPoint PPT Presentation

Citation preview

Kansas City Developer Conference 2011

Unit Testing Patterns and Anti-Patterns

Steve BohlenE-Mail: sbohlen@gmail.comBlog: http://blog.unhandled-exceptions.comTwitter: @sbohlen

CYND D D

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

Kansas City Developer Conference 2011

Do I suck?Let me (and the world) know!

http://spkr8.com/t/7866

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: sbohlen@gmail.comtwitter: @sbohlen

CYND D D

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

Kansas City Developer Conference 2011

Kansas City Developer Conference 2011

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-

Kansas City Developer Conference 2011

Kansas City Developer Conference 2011

Kansas City Developer Conference 2011

Challenge: Running Tests

Kansas City Developer Conference 2011

Interacting with your Tests

Run Selected Tests

Debug Selected Tests

Rerun

Rerun

Kansas City Developer Conference 2011

Challenge: Speedy Tests

Kansas City Developer Conference 2011

Challenge: Naming Tests

Kansas City Developer Conference 2011

Challenge: Descriptive Assertions

Kansas City Developer Conference 2011

Challenge: Repetition

Kansas City Developer Conference 2011

Challenge: False Positives

Kansas City Developer Conference 2011

Challenge: Faked Out!

Kansas City Developer Conference 2011

Challenge: Maintenance

Kansas City Developer Conference 2011

Challenge: Testing Exceptions

Kansas City Developer Conference 2011

Challenge: Test Coverage

Kansas City Developer Conference 2011

Challenge: Organizing Tests

Kansas City Developer Conference 2011

Challenge: Data Dependency

Kansas City Developer Conference 2011

Challenge: Multiple Assertions

Kansas City Developer Conference 2011

And now for something completely different…

…code!

Kansas City Developer Conference 2011

finiSteve BohlenE-Mail: sbohlen@gmail.comBlog: http://blog.unhandled-exceptions.comTwitter: @sbohlen

CYND D D