Your SlideShare is downloading. ×
0
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Unit Testing and Tools
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Unit Testing and Tools

537

Published on

This talk was give at the South Shore .NET Users Group. …

This talk was give at the South Shore .NET Users Group.

Unit Testing is now considered a required skill for developers. There are a ton of tools out there. However, there's nothing that shows you how to tie them all together to make your software fast, testable, and flexible. This talk will go over my toolset:

• MSTest
• Moq - Mocking framework
• NCover - for coverage
• MSBuild - for automation
• Dotcover - coverage from VS
• Unity - for dependency injection

This talk has a very long demo

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
537
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Unit Testing and Tools @wbsimms @southshorenet
  • 2. Vocabulary Unit test • Code you write to test your code Coverage • Measure of how much code is tested Mock • Replacement for something else Dependency Injection (DI) • • Builder design pattern Object and dependencies are created for you Continuous Integration (CI) • Responds to checkins, builds code, and generates code metrics (coverage, unit test pass fail, etc.)
  • 3. Why Unit Test? Which would you rather do? Write Tests Fix Production Bugs
  • 4. That’s cute… but really… why? 1) Catches regression bugs at the developers desk 2) Documents how code works 3) Catalog of the business rules
  • 5. What makes a good unit test? • • • • Repeatable Fast Test by layers Good Coverage
  • 6. Layers? Web • Controllers • ViewModels • Helpers DataAccessLayer • Repositories (or what ever) • Models • Helpers Other Libraries • Rules Logic • Etc…
  • 7. Test documentation? 1. public void MethodName_Case_ExpectedResultTest() 2. [Description(“Your text here”)] public void MethodNameCaseTest()
  • 8. When to run your test? All tests all the time!      After pull / sync Before commits During CI builds Before you merge After you merge
  • 9. So… the tools? • MSTest • Unit testing framework • Moq • Creating mock objects from interfaces • Unity • Dependency Injection • MSBuild • Build automation • DotCover/Ncover • For coverage analysis
  • 10. Demo time… Deep breath….

×