Roy Osherove - testcon-vilnius

Advanced TDD & Unit Testing Concepts

The Problem
Unit testing, done badly, can hurt your project more than it helps. In some cases, it may lead to project schedule delays, and unhappy developers due to huge maintenance problems. But when unit testing is done right, it can help the project and developers’ confidence immensely.

The challenge is – how do you do it in a way that is helping, rather than hurting your project?

Objective
In this workshop we will lstart diving into advanced scenarios in unit testing and test driven development, developing skills and techniques for writing unit tests in a readable, maintainable and trustworthy fashion, while contemplating design issues, mocking and stubbing dilemmas, refactoring and more.
1. Learn about mocks, stubs fakes, and the difference between them
2. Learn about Isolation(mocking) frameworks, how they work, and why some frameworks are
more capable than others
3. Learn how to refactor and test legacy code.

Materials
All students get a PDF of all the slides in the course, in downloadable form.

Agenda – Day 1 (09:00-16:00)
4. NUnit APIs, test runners, tips and tricks
5. Value based, State Based and Interaction Based Tests
6. Understanding Fakes, Mocks and Stubs
7. Hand Written Fakes, Stubs and Mocks
8. Interaction Test Exercises with Hand Written Fakes
9. Isolation Frameworks: Constrained and Unconstrained
10. Isolation Framework Comparisons (Rhino Mocks, Typemock, Moq, FakeItEasy, NSubstitute, NUnitMocks, MsFakes)
11. Legacy Code Refactoring Techniques & Exercises

Student Requirements
a laptop equipped with:
Visual studio 2015 (standard or higher) or later, with nuget package manager installed and running.
– trial version of resharper (https://www.jetbrains.com/resharper/download/)
– trial version of NCrunch (http://www.ncrunch.net/ )
– internet connection