Picking up on the notion of seams (from Michael Feathers Working Effectively with Legacy Code, but I came upon this in Roy Osherove's The Arto of Unit Testing), I look at how MVC introduced seams between controller code and implementation, and look the Glass Mapper can be used to introduce seams into Sitecore code. I then look at 8.2, and show how its introduction of virtual methods and abstract classes allows for testability with Sitecore code much as MVC did for ASP.NET. The presentation also introduces a number of tools that can remove the friction from test driven development, such as ReSharper, NCrunch, AutoFixture, and Fluent Assertions.
I will post a link to a recording of this talk when it becomes available.
Code Samples
https://github.com/dsolovay/mvc-testability/
https://github.com/dsolovay/item-creation-demos
https://github.com/dsolovay/habitat-testability
Also on NuGet.
Also check out my talk from SUGCON NA 2015. Video and related links here.
https://github.com/dsolovay/mvc-testability/
https://github.com/dsolovay/item-creation-demos
https://github.com/dsolovay/habitat-testability
My AutoSitecore project (8.2 Testing accelerator)
https://github.com/dsolovay/AutoSitecoreAlso on NuGet.
Also check out my talk from SUGCON NA 2015. Video and related links here.
I wanted to tell you right there, however failed to catch you up in person: your presentation there was the only one I've enjoyed so much!
ReplyDeleteThank you!