Presentation is loading. Please wait.

Presentation is loading. Please wait.

TEST-DRIVEN DEVELOPMENT AND MVP Cory Foy and Michael Russo.

Similar presentations


Presentation on theme: "TEST-DRIVEN DEVELOPMENT AND MVP Cory Foy and Michael Russo."— Presentation transcript:

1 TEST-DRIVEN DEVELOPMENT AND MVP Cory Foy and Michael Russo

2 What’s Ahead  Process  Flavors  Techniques  Demo  Introducing TDD  Challenges  Questions?

3 Process  Test versus Design  Red, Green, Refactor  No Production Code without a Failing Test  State Based versus Interaction Based Tests

4 Flavors  Behavior-Driven Development  Domain-Driven Design  Acceptance-Test Driven Development  Feature-Driven Development  Example-Driven Development  Hope-Driven Development

5 Techniques - Tools  xUnit Tools .NET – NUnit, MbUnit, xUnit.NET, Visual Studio Test Tools, TD.NET, Resharper  Java – JUnit, JBehave  Ruby – test_unit, rSpec, Cucumber  Other Tools  FitNesse/FIT  AgileDocs/TestDocs

6 Techniques – Rules  Two main sources of “rules”  Feather’s Rules – from Michael Feathers’ Working Effectively with Legacy Code  North’s Rules – from Dan North’s BDD sessions

7 Techniques – Feathers’ Rules  Not a unit test if it  Talks to the database  Communicates Across the Network  Touches the File System  Can’t run at the same time as your other unit tests  Have to do special things in your environment to run it (config file changes, code changes, etc)

8 Techniques – North’s Rules  Come from Behavior-Driven Development  Test Method Names should be sentences  Keep Test Methods Focused  It should be clear from the name what the test is doing  “Behavior” is more useful than “test”  Acceptance Criteria should be executable  BDD is an umbiqutious language for analysis

9 Techniques - Spikes  When it absolutely, positively has to be there without tests  Useful for determining if something is even going to work  Timebox the Spike  Throw away the code at the end and redo it test- first

10 Techniques – Helpful Patterns  Dependency Injection  Separation of Concerns  MVP/MVC  Model View Presenter  Model View Controller

11 Demo  TDD / MVC Demo  Starring  Michael Russo as “Newbie”  Cory Foy as “Cory”  The audience as “The Hecklers”

12 Introducing TDD  Legacy Code  Pick up a copy of Working Effectively With Legacy Code  Write unit tests for bugs  Write Characterization tests for features  Greenfield Project  No production code without a failing test  Executable Specifications  Automated Acceptance Test Criteria

13 Challenges  Language Support  Slow Tests  Keeping up with the tests  Developer Mindsets  Management Mindsets  Legacy Code

14 Questions?  Ask now  Or, you know, ask later, afterwards, or via email, or twitter, or we’ll give you our phone numbers. Come over for dinner. We’ll chat more then.

15 Information  Agile Tampa – http://agiletampa.spaces.live.comhttp://agiletampa.spaces.live.com  Cory’s Blog – http://www.cornetdesign.comhttp://www.cornetdesign.com  Agile Florida – http://www.agileflorida.comhttp://www.agileflorida.com  NUnit – http://www.nunit.orghttp://www.nunit.org  FitNesse – http://www.fitnesse.orghttp://www.fitnesse.org


Download ppt "TEST-DRIVEN DEVELOPMENT AND MVP Cory Foy and Michael Russo."

Similar presentations


Ads by Google