Below And Beneath Tdd  Test Last Development And Other Real World Test Patterns Presentation
Upcoming SlideShare
Loading in...5
×
 

Below And Beneath Tdd Test Last Development And Other Real World Test Patterns Presentation

on

  • 3,354 views

 

Statistics

Views

Total Views
3,354
Views on SlideShare
3,351
Embed Views
3

Actions

Likes
3
Downloads
43
Comments
0

2 Embeds 3

https://twitter.com 2
http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Below And Beneath Tdd  Test Last Development And Other Real World Test Patterns Presentation Below And Beneath Tdd Test Last Development And Other Real World Test Patterns Presentation Presentation Transcript

  • Below And Beneath TDD Test-Last Development and other real world test patterns Noel Rappin @noelrap Pathfinder Development pathf.com railsprescriptions.com
  • http://www.railsrx.com
  • TEST REFACTOR FAIL PASS CODE Rx
  • TEST REFACTOR Why does testing work? FAIL PASS Why does testing fail? CODE Rx
  • TEST REFACTOR What does it mean for testing to “work”? FAIL PASS CODE Rx
  • TEST REFACTOR Improve effectiveness of team and quality of code NOT FAIL PASS A perfect guarantee of code correctness CODE Rx
  • TEST REFACTOR for me, tdd is about confidence & accountability & responsibility & design & reusability & portability & flexibility & testing & FAIL PASS trustworthiness & teamwork & initiative & flow & that's all i can think of at the moment. CODE -- Kent Beck Rx
  • TEST REFACTOR Accurate view of code Small, incremental steps FAIL PASS Scaffold for change Focus for development CODE Rx
  • TEST REFACTOR What does it mean for testing to “fail”? FAIL PASS CODE Rx
  • TEST REFACTOR Decrease efficiency and code quality FAIL PASS CODE Rx
  • TEST REFACTOR “It feels like there's a hidden door that everyone who tests has found and walked through... There are a bunch of us... FAIL PASS that would love to join the party, but don't know where to find the door.” CODE Rx
  • TEST REFACTOR If you are stuck in a window or banging your head against the wall, FAIL PASS this will help you get to the door CODE Rx
  • TEST REFACTOR FAIL PASS CODE Rx
  • TEST REFACTOR Test-Driven Development FAIL PASS CODE Rx
  • TEST REFACTOR AKA: Behavior-Driven Development or FAIL PASS Test-First Programming CODE Rx
  • TEST REFACTOR TDD Code has: small pieces FAIL PASS high cohesion loose coupling minimal side-effects CODE Rx
  • TEST REFACTOR ☺Accurate view of code ☺Small, incremental steps FAIL PASS ☺Scaffold for change ☺Focus for development CODE Rx
  • TEST REFACTOR FAIL PASS CODE Rx
  • TEST Lose the refactoring FAIL PASS CODE Rx
  • TEST Development, that FAIL PASS happens to have tests CODE Rx
  • TEST Symptoms: FAIL PASS Increased duplicaton in code. Long methods CODE Rx
  • TEST Benefits: FAIL PASS May seem faster at first CODE Rx
  • TEST Over time... FAIL PASS CODE Rx
  • TEST ☺Accurate view of code Small, incremental steps FAIL PASS Scaffold for change ☺Focus for development CODE Rx
  • TEST Fix by: FAIL PASS Cleaning up your mess CODE Rx
  • TEST REFACTOR FAIL PASS CODE Rx
  • TEST REFACTOR FAIL PASS TEST FAIL CODE Rx
  • TEST REFACTOR assert_equal(nil, actual) assert_equal(4.314, actual) FAIL PASS TEST actual = 4.314 FAIL CODE Rx
  • TEST REFACTOR Data-Driven Testing or FAIL PASS Using your program as a calculator TEST FAIL CODE Rx
  • TEST REFACTOR Benefits: Failed Test Guaranteed FAIL PASS Value may be hard to calculate TEST FAIL CODE Rx
  • TEST REFACTOR Pitfalls: Can mask ignorance of domain FAIL PASS Can lead to worse TEST problems FAIL CODE Rx
  • TEST REFACTOR Accurate view of code ☺Small, incremental steps FAIL PASS ☺Scaffold for change ☺Focus for development TEST FAIL CODE Rx
  • TEST REFACTOR assert_equal(nil, actual) assert_equal(4.314, actual) FAIL PASS TEST actual = 4.314 FAIL CODE Rx
  • REFACTOR CODE actual = 4.314 assert_equal(4.314, actual) PASS TEST Rx
  • CODE REFACTOR Test-Next Development aka PASS Code-Driven Development TEST Rx
  • CODE REFACTOR Symptoms: No more failing tests Tweaking tests to PASS match code Coverage drop TEST Rx
  • CODE REFACTOR Benefits: Useful when exploring PASS Useful when testing views TEST Rx
  • CODE REFACTOR Pitfalls: Easily slides into worse patterns PASS Hard to avoid coverage gaps TEST Rx
  • CODE REFACTOR Accurate view of code ☺Small, incremental steps PASS Scaffold for change Focus for development TEST Rx
  • CODE REFACTOR Tautology Based Development PASS TEST Rx
  • CODE REFACTOR Definition: Tests that can’t PASS fail TEST Rx
  • CODE REFACTOR Symptoms: Bugs that should have been covered PASS Mock object misuse TEST Rx
  • CODE REFACTOR ☹Accurate view of code ☺Small, incremental steps PASS Scaffold for change ☹Focus for development TEST Rx
  • CODE REFACTOR Mitigation: Try to separate code assertions PASS from application data TEST Rx
  • CODE REFACTOR PASS TEST Rx
  • CODE REFACTOR CODE CODE CODE PASS CODE CODE CODE TEST Rx
  • CODE REFACTOR CODE CODE CODE Test-Last Development PASS CODE CODE CODE TEST Rx
  • CODE REFACTOR CODE Symptoms: CODE Significant coverage drop CODE PASS Uncovered bugs CODE Harder to write tests CODE CODE TEST Rx
  • CODE REFACTOR CODE CODE This is one way in which we talk past each other CODE PASS Unit tests ≠ TDD CODE CODE CODE TEST Rx
  • CODE REFACTOR CODE Pitfall: CODE Tests get more CODE expensive PASS CODE Lower quality tests CODE Programmer boredom CODE TEST Rx
  • CODE REFACTOR CODE CODE Needed when: CODE Hitting corner case PASS CODE Dealing with legacy CODE CODE TEST Rx
  • CODE REFACTOR CODE ☹Accurate view of code CODE ☹Small, incremental steps CODE PASS Scaffold for change CODE ☹Focus for development CODE CODE TEST Rx
  • CODE REFACTOR Escape by: CODE CODE Start the TDD process CODE Don’t look back PASS CODE Catch up to legacy parts as you touch CODE them CODE TEST Rx
  • CODE REFACTOR CODE CODE CODE PASS CODE CODE CODE TEST Rx
  • CODE REFACTOR CODE CODE CODE Run CODE CODE CODE TEST Rx
  • CODE REFACTOR CODE CODE Coverage Driven CODE Development Run CODE CODE CODE TEST Rx
  • CODE REFACTOR CODE CODE Symptom: CODE Run Tests without assertions CODE CODE CODE TEST Rx
  • CODE REFACTOR CODE Why? CODE Minimal approach to CODE Run legacy CODE Hard to reach code CODE CODE TEST Rx
  • CODE REFACTOR CODE ☹Accurate view of code CODE ☹Small, incremental steps CODE Run ☹Scaffold for change CODE ☹Focus for development CODE CODE TEST Rx
  • TEST REFACTOR FAIL PASS CODE Rx
  • TEST REFACTOR TEST TEST TEST TEST FAIL PASS CODE Rx
  • TEST REFACTOR TEST TEST TEST TEST Lots of Test FAIL PASS First Development CODE Rx
  • TEST REFACTOR TEST TEST TEST TEST Symptom: FAIL PASS Lots of test failures at once during initial developmment CODE Rx
  • TEST REFACTOR TEST TEST TEST TEST Benefit: FAIL PASS Allows planning for future code CODE Rx
  • TEST REFACTOR TEST TEST TEST TEST Cost: Loss of focus FAIL PASS Somewhat harder to write code against CODE Rx
  • TEST REFACTOR TEST TEST TEST TEST Middle Ground: FAIL PASS RSpec pending CODE Rx
  • TEST REFACTOR TEST TEST ☺Accurate view of code TEST TEST Small, incremental steps FAIL PASS ☺Scaffold for change Focus for development CODE Rx
  • TEST REFACTOR FAIL PASS CODE Rx
  • SETUP REFACTOR TEST PASS FAIL CODE Rx
  • SETUP REFACTOR TEST Setup Driven Development PASS FAIL CODE Rx
  • SETUP REFACTOR Symptom: TEST Large, brittle setup methods PASS Slow tests FAIL High-level tests CODE Rx
  • SETUP REFACTOR TEST Costs: PASS This is why people hate testing FAIL CODE Rx
  • SETUP REFACTOR Accurate view of code TEST ☹Small, incremental steps PASS ☺Scaffold for change Focus for development FAIL CODE Rx
  • SETUP REFACTOR TEST Escape by: Mock Objects PASS Real unit tests FAIL CODE Rx
  • TEST REFACTOR FAIL PASS CODE Rx
  • TEST REFACTOR Another problem: End to end failures FAIL PASS Lack of focus Expectation failures CODE Rx
  • Cucumber REFACTOR TEST A potential solution PASS FAIL CODE Rx
  • Cucumber REFACTOR TEST Acceptance Test-Driven PASS Development FAIL CODE Rx
  • Cucumber REFACTOR Symptom: TEST PASS You are writing acceptance tests FAIL CODE Rx
  • Cucumber REFACTOR Costs: TEST PASS Additional layer of test code, indirection FAIL CODE Rx
  • Cucumber REFACTOR Benefits: TEST PASS Increased focus, improved feedback FAIL CODE Rx
  • Cucumber REFACTOR ☺Accurate view of code ☺Small, incremental steps TEST PASS ☺Scaffold for change ☺Focus for development FAIL CODE Rx
  • TEST REFACTOR FAIL PASS CODE Rx
  • TEST REFACTOR And So: FAIL PASS CODE Rx
  • TEST REFACTOR Constant feedback and FAIL PASS baby steps CODE Rx
  • TEST REFACTOR Focus on what comes next Failure Driven FAIL PASS Development CODE Rx
  • TEST REFACTOR Good code has small pieces high cohesion FAIL PASS loose coupling minimal side-effects CODE Rx
  • TEST REFACTOR Invisible cost of bugs or FAIL PASS Done vs. “Done Done” CODE Rx
  • TEST REFACTOR Go write some tests! FAIL PASS CODE Rx
  • TEST REFACTOR Rails Test Prescriptions http://www.railsrx.com Pathfinder Development FAIL PASS http://www.pathf.com http://www.pathf.com/blogs @noelrap @railsrx BoF: 9PM CODE Wed Pavillion 9-10 Rx