Introduction to Test Driven
Development (TDD) with .NET
Tom Steele
Three Rivers Technologies
La Crosse, WI
Popularized by Extreme
Programming (XP)
“Testing Strategy” (1st Edition)
“Test-First” (2nd Edition)
Test Driven Development (TDD)
Popularized by Extreme
Programming (XP)
“Testing Strategy” (1st Edition)
“Test-First” (2nd Edition)
Test Driven Development (TDD)
Popularized by Extreme
Programming (XP)
“Testing Strategy” (1st Edition)
“Test-First” (2nd Edition)
Test Driven Development (TDD)
Popularized by Extreme
Programming (XP)
“Testing Strategy” (1st Edition)
“Test-First” (2nd Edition)
Test Driven Development (TDD)
TDD is not about testing
How is that possible?
Testing
TDD is not just about testing
Un-ambiguous requirements
Software design
Contributes to loose coupling
Productivity improvement
TDD is not just about testing
Un-ambiguous requirements
Software design
Contributes to loose coupling
Productivity improvement
TDD is not just about testing
Un-ambiguous requirements
Software design
Contributes to loose coupling
Productivity improvement
TDD is not just about testing
Un-ambiguous requirements
Software design
Contributes to loose coupling
Productivity improvement
TDD is not just about testing
Un-ambiguous requirements
Software design
Contributes to loose coupling
Productivity improvement
Refactor
Green
Red
Tools
MBUnit
Others…
Let’s see TDD in action
Demo
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Let’s review what we learned in
the demo
Where to put unit tests (my best practice)
NUnit Assert.AreEqual basics
Test list
Red-Green-Refactor rhythm
Running tests with NUnit GUI & TestDriven.NET
Test with Debugger & Coverage
Various SetUp and TearDown methods
Use of Console.WriteLine (my best practice)
Some additional thoughts and
discussion points
TDD religion vs. pragmatism
Continuous integration
Knowing what to test (art not science)
Database testing
Unit test vs. “batch” unit tests
Some additional thoughts and
discussion points
TDD religion vs. pragmatism
Continuous integration
Knowing what to test (art not science)
Database testing
Unit test vs. “batch” unit tests
Some additional thoughts and
discussion points
TDD religion vs. pragmatism
Continuous integration
Knowing what to test (art not science)
Database testing
Unit test vs. “batch” unit tests
Some additional thoughts and
discussion points
TDD religion vs. pragmatism
Continuous integration
Knowing what to test (art not science)
Database testing
Unit test vs. “batch” unit tests
Some additional thoughts and
discussion points
TDD religion vs. pragmatism
Continuous integration
Knowing what to test (art not science)
Database testing
Unit test vs. “batch” unit tests
Question & Answer Time
Or My Recommended
Agile Reading List
Background & Contact Information
Software Architect
CSM/CSP
MCAD
Microsoft Ecosystem
All things .NET
SharePoint & Silverlight
Strong advocate for Agile/Scrum
tsteele@3riverstech.com
Thank You
Tom Steele
Three Rivers Technologies
tsteele@3riverstech.com
Currently reading
My Most
Recommended
My Recommended
Agile Reading List
Agile Manifesto
www.agilemanifesto.org
Requirements
User/Role Modeling
Scrum Intro
Empirical vs. Defined
Scrum Mechanics
General Project Mgmt
Case Studies/Stories
Bible on Project Planning
2nd Edition Less Rigid than 1st
People Focused
TDD & Other Practices like CI
2 Lean Books
Toyota Production System
Enterprise Validity
Ideas for Enterprise Adoption
Scaling Scrum

Test Driven Development (TDD) - CVCC 2011

  • 1.
    Introduction to TestDriven Development (TDD) with .NET Tom Steele Three Rivers Technologies La Crosse, WI
  • 2.
    Popularized by Extreme Programming(XP) “Testing Strategy” (1st Edition) “Test-First” (2nd Edition) Test Driven Development (TDD)
  • 3.
    Popularized by Extreme Programming(XP) “Testing Strategy” (1st Edition) “Test-First” (2nd Edition) Test Driven Development (TDD)
  • 4.
    Popularized by Extreme Programming(XP) “Testing Strategy” (1st Edition) “Test-First” (2nd Edition) Test Driven Development (TDD)
  • 5.
    Popularized by Extreme Programming(XP) “Testing Strategy” (1st Edition) “Test-First” (2nd Edition) Test Driven Development (TDD)
  • 6.
    TDD is notabout testing How is that possible? Testing
  • 7.
    TDD is notjust about testing Un-ambiguous requirements Software design Contributes to loose coupling Productivity improvement
  • 8.
    TDD is notjust about testing Un-ambiguous requirements Software design Contributes to loose coupling Productivity improvement
  • 9.
    TDD is notjust about testing Un-ambiguous requirements Software design Contributes to loose coupling Productivity improvement
  • 10.
    TDD is notjust about testing Un-ambiguous requirements Software design Contributes to loose coupling Productivity improvement
  • 11.
    TDD is notjust about testing Un-ambiguous requirements Software design Contributes to loose coupling Productivity improvement
  • 12.
  • 13.
  • 14.
    Let’s see TDDin action Demo
  • 15.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 16.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 17.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 18.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 19.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 20.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 21.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 22.
    Let’s review whatwe learned in the demo Where to put unit tests (my best practice) NUnit Assert.AreEqual basics Test list Red-Green-Refactor rhythm Running tests with NUnit GUI & TestDriven.NET Test with Debugger & Coverage Various SetUp and TearDown methods Use of Console.WriteLine (my best practice)
  • 23.
    Some additional thoughtsand discussion points TDD religion vs. pragmatism Continuous integration Knowing what to test (art not science) Database testing Unit test vs. “batch” unit tests
  • 24.
    Some additional thoughtsand discussion points TDD religion vs. pragmatism Continuous integration Knowing what to test (art not science) Database testing Unit test vs. “batch” unit tests
  • 25.
    Some additional thoughtsand discussion points TDD religion vs. pragmatism Continuous integration Knowing what to test (art not science) Database testing Unit test vs. “batch” unit tests
  • 26.
    Some additional thoughtsand discussion points TDD religion vs. pragmatism Continuous integration Knowing what to test (art not science) Database testing Unit test vs. “batch” unit tests
  • 27.
    Some additional thoughtsand discussion points TDD religion vs. pragmatism Continuous integration Knowing what to test (art not science) Database testing Unit test vs. “batch” unit tests
  • 28.
    Question & AnswerTime Or My Recommended Agile Reading List
  • 29.
    Background & ContactInformation Software Architect CSM/CSP MCAD Microsoft Ecosystem All things .NET SharePoint & Silverlight Strong advocate for Agile/Scrum tsteele@3riverstech.com
  • 30.
    Thank You Tom Steele ThreeRivers Technologies tsteele@3riverstech.com
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
    2nd Edition LessRigid than 1st People Focused TDD & Other Practices like CI
  • 39.
    2 Lean Books ToyotaProduction System Enterprise Validity
  • 40.
    Ideas for EnterpriseAdoption Scaling Scrum