Getting Started With Test Driven Development Slides
Getting Started With Test Driven Development Slides
@thomasclaudiush www.thomasclaudiushuber.com
Module What is Test Driven Development?
Outline The Wired Brain Coffee scenario
How this course is structured
The first requirement
- Test
- Implement
- Refactor
What Is Test Driven Development (TDD)?
Requirements
1st requirement
2nd requirement
3rd requirement
What Is Test Driven Development (TDD)?
Red Green
Write a Write code to
failing test pass the test
Refactor
Tests are driving
your implementation
What Is Test Driven Development (TDD)?
TDD Cycle
Red Green
Refactor
Advantages of Test Driven Development
Red Green
Refacto
r
Think about
Think about
what the code Get fast feedback
the APIs should do
In their shop in
A company that runs
Zurich they have
several coffee shops
desks for customers
DeskBooker solution
DeskBooker.Core
DeskBooker.Web (.NET Core class library) DeskBooker.DataAccess
(ASP.NET Core) (Entity Framework Core)
DeskBookingRequestProcessor
How This Course Is Structured
DeskBooker solution
DeskBooking
RequestProcessor
Understand the First Requirement
FirstName FirstName
LastName LastName
BookDesk
Email Email
Date Date
Understand the First Requirement
FirstName FirstName
LastName LastName
BookDesk
Email Email
Date Date
DeskBooking
RequestProcessor
null BookDesk
Throw ArgumentNullException
Demo
Implement the requirement with TDD
- Test if Exception is thrown
- Throw the Exception
- Refactor the code
Test Driven Development
- Red
Summary - Green
- Refactor
Advantages of TDD
- Get fast feedback
- Write modular and maintainable code