1 / 15

Test-Driven Development and MVP

Test-Driven Development and MVP. Cory Foy and Michael Russo. What’s Ahead. Process Flavors Techniques Demo Introducing TDD Challenges Questions?. Process. Test versus Design Red, Green, Refactor No Production Code without a Failing Test State Based versus Interaction Based Tests.

alyssa
Download Presentation

Test-Driven Development and MVP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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.com • Cory’s Blog – http://www.cornetdesign.com • Agile Florida – http://www.agileflorida.com • NUnit – http://www.nunit.org • FitNesse – http://www.fitnesse.org

More Related