test driven development in .net applications

20
Test driven development in .NET Applications Anton Vidishchev MCPD Team leader at Sigma Ukraine @antonvidishchev [email protected]

Upload: anton-vidishchev

Post on 05-Dec-2014

770 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

  • 1. Test drivendevelopmentin .NET Applications Anton Vidishchev MCPD Team leader at Sigma Ukraine @antonvidishchev [email protected]
  • 2. 6 .NET TDD .NET User Group
  • 3. TDD Unit tests, integration tests Fakes, Mocks, Stubs, Dummies DAL BLL GUI Tips & Tricks
  • 4. $59.5 2009 $67; $21 100 150 1000 10-100 , production
  • 5. DD
  • 6. TDD production-
  • 7. TDD ,
  • 8. Unit-test Single responsibility
  • 9. unit-, : - ( ) .
  • 10. ? Fakes, Test doubles -, . , in-memory . Mocks , . Dummies -, , Stubs . Helper-, .
  • 11. ASP.NET MVC 3 WCF REST services Entity Framework 4.0 EF POCO Objects T4 Templates for Fake repository SQL Azure NUnit Moq Resharper dotCover
  • 12. DAL POCO : IRepository, IUnitOfWork in-memory fakes Linq to Objects Linq to Entities in-memory - ObjectMother Mock Objects (, SaveChanges() ) . PROFIT!
  • 13. DAL:Integration Tests , unit- in-memory integration- sanity integration tests . Sanity integration test C#
  • 14. BLL ! Dependency Injection/IoC ! , test-doubles
  • 15. UI / UI , , MVC/MVVM Contrib- (MVCContrib). Routes Controller ActionResult ModelState
  • 16. Tips & Tricks Dependency Injection/IoC- . Ndepend - Setup / TearDown
  • 17. More improvements : UI tests Coded-UI tests Load tests Integration tests Continuous Integration unit- check-in
  • 18. Unit testing MSTest, Nunit Mocking Moq, RhinoMocks Isolation and White box Unit Testing for .NET Pex and Moles UI Testing MS Test Manager, Selenium Continuous integration TFS, TeamCity, Hudson/Jenkins, CruiseControl.NET DI/IoC Unity, Spring.NET, Ninject Contribution projects NUGET, MVCContrib Refactoring Resharper Code Coverage Visual Studio, dotCover
  • 19. Kent Beck. Test Driven Development: By Example http://www.amazon.com/Test-Driven-Development- Kent-Beck/dp/0321146530/ Testability and Entity Framework 4.0 http://msdn.microsoft.com/en- us/library/ff714955.aspx Mocks arent Stubs. Martin Fowler http://martinfowler.com/articles/mocksArentStubs.ht ml
  • 20. @antonvidishchev [email protected]