40
Introduction to Test Driven Development (TDD) with .NET Tom Steele Three Rivers Technologies La Crosse, WI

Test Driven Development (TDD) - CVCC 2011

Embed Size (px)

Citation preview

Page 1: Test Driven Development (TDD) - CVCC 2011

Introduction to Test Driven Development (TDD) with .NET

Tom SteeleThree Rivers Technologies

La Crosse, WI

Page 2: Test Driven Development (TDD) - CVCC 2011

Popularized by Extreme Programming (XP)“Testing Strategy” (1st Edition)“Test-First” (2nd Edition)Test Driven Development (TDD)

Page 3: Test Driven Development (TDD) - CVCC 2011

Popularized by Extreme Programming (XP)“Testing Strategy” (1st Edition)“Test-First” (2nd Edition)Test Driven Development (TDD)

Page 4: Test Driven Development (TDD) - CVCC 2011

Popularized by Extreme Programming (XP)“Testing Strategy” (1st Edition)“Test-First” (2nd Edition)Test Driven Development (TDD)

Page 5: Test Driven Development (TDD) - CVCC 2011

Popularized by Extreme Programming (XP)“Testing Strategy” (1st Edition)“Test-First” (2nd Edition)Test Driven Development (TDD)

Page 6: Test Driven Development (TDD) - CVCC 2011

TDD is not about testingHow is that possible?

Testing

Page 7: Test Driven Development (TDD) - CVCC 2011

TDD is not just about testingUn-ambiguous requirements

Software designContributes to loose coupling

Productivity improvement

Page 8: Test Driven Development (TDD) - CVCC 2011

TDD is not just about testingUn-ambiguous requirements

Software designContributes to loose coupling

Productivity improvement

Page 9: Test Driven Development (TDD) - CVCC 2011

TDD is not just about testingUn-ambiguous requirements

Software designContributes to loose coupling

Productivity improvement

Page 10: Test Driven Development (TDD) - CVCC 2011

TDD is not just about testingUn-ambiguous requirements

Software designContributes to loose coupling

Productivity improvement

Page 11: Test Driven Development (TDD) - CVCC 2011

TDD is not just about testingUn-ambiguous requirements

Software designContributes to loose coupling

Productivity improvement

Page 12: Test Driven Development (TDD) - CVCC 2011

Refactor

Green

Red

Page 13: Test Driven Development (TDD) - CVCC 2011

Tools

MBUnitOthers…

Page 14: Test Driven Development (TDD) - CVCC 2011

Let’s see TDD in action

Demo

Page 15: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 16: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 17: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 18: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 19: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 20: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 21: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 22: Test Driven Development (TDD) - CVCC 2011

Let’s review what we learned in the demo

Where to put unit tests (my best practice)NUnit Assert.AreEqual basics

Test listRed-Green-Refactor rhythm

Running tests with NUnit GUI & TestDriven.NETTest with Debugger & Coverage

Various SetUp and TearDown methodsUse of Console.WriteLine (my best practice)

Page 23: Test Driven Development (TDD) - CVCC 2011

Some additional thoughts and discussion points

TDD religion vs. pragmatismContinuous integration

Knowing what to test (art not science)Database testing

Unit test vs. “batch” unit tests

Page 24: Test Driven Development (TDD) - CVCC 2011

Some additional thoughts and discussion points

TDD religion vs. pragmatismContinuous integration

Knowing what to test (art not science)Database testing

Unit test vs. “batch” unit tests

Page 25: Test Driven Development (TDD) - CVCC 2011

Some additional thoughts and discussion points

TDD religion vs. pragmatismContinuous integration

Knowing what to test (art not science)Database testing

Unit test vs. “batch” unit tests

Page 26: Test Driven Development (TDD) - CVCC 2011

Some additional thoughts and discussion points

TDD religion vs. pragmatismContinuous integration

Knowing what to test (art not science)Database testing

Unit test vs. “batch” unit tests

Page 27: Test Driven Development (TDD) - CVCC 2011

Some additional thoughts and discussion points

TDD religion vs. pragmatismContinuous integration

Knowing what to test (art not science)Database testing

Unit test vs. “batch” unit tests

Page 28: Test Driven Development (TDD) - CVCC 2011

Question & Answer TimeOr My Recommended

Agile Reading List

Page 29: Test Driven Development (TDD) - CVCC 2011

Background & Contact InformationSoftware Architect

CSM/CSPMCAD

Microsoft EcosystemAll things .NET

SharePoint & SilverlightStrong advocate for Agile/Scrum

[email protected]

Page 30: Test Driven Development (TDD) - CVCC 2011

Thank You

Tom SteeleThree Rivers [email protected]

Page 31: Test Driven Development (TDD) - CVCC 2011

Currently readingMy Most

Recommended

Page 32: Test Driven Development (TDD) - CVCC 2011

My Recommended Agile Reading List

Page 33: Test Driven Development (TDD) - CVCC 2011

Agile Manifestowww.agilemanifesto.org

Page 34: Test Driven Development (TDD) - CVCC 2011

RequirementsUser/Role ModelingScrum Intro

Page 35: Test Driven Development (TDD) - CVCC 2011

Empirical vs. DefinedScrum Mechanics

Page 36: Test Driven Development (TDD) - CVCC 2011

General Project MgmtCase Studies/Stories

Page 37: Test Driven Development (TDD) - CVCC 2011

Bible on Project Planning

Page 38: Test Driven Development (TDD) - CVCC 2011

2nd Edition Less Rigid than 1st

People FocusedTDD & Other Practices like CI

Page 39: Test Driven Development (TDD) - CVCC 2011

2 Lean BooksToyota Production SystemEnterprise Validity

Page 40: Test Driven Development (TDD) - CVCC 2011

Ideas for Enterprise AdoptionScaling Scrum