Test-Driven Development and MVP - PowerPoint PPT Presentation

About This Presentation
Title:

Test-Driven Development and MVP

Description:

Feather's Rules from Michael Feathers' Working Effectively with Legacy Code ... BDD is an umbiqutious language for analysis. Techniques - Spikes ... – PowerPoint PPT presentation

Number of Views:68
Avg rating:3.0/5.0
Slides: 16
Provided by: foyc8
Category:
Tags: mvp | development | driven | test

less

Transcript and Presenter's Notes

Title: Test-Driven Development and MVP


1
Test-Driven Development and MVP
  • Cory Foy and Michael Russo

2
Whats 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
  • Feathers Rules from Michael Feathers Working
    Effectively with Legacy Code
  • Norths Rules from Dan Norths BDD sessions

7
Techniques Feathers Rules
  • Not a unit test if it
  • Talks to the database
  • Communicates Across the Network
  • Touches the File System
  • Cant 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 Norths 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 well give you our phone
    numbers. Come over for dinner. Well chat more
    then.

15
Information
  • Agile Tampa http//agiletampa.spaces.live.com
  • Corys Blog http//www.cornetdesign.com
  • Agile Florida http//www.agileflorida.com
  • NUnit http//www.nunit.org
  • FitNesse http//www.fitnesse.org
Write a Comment
User Comments (0)
About PowerShow.com