SlideShare una empresa de Scribd logo
1 de 90
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Database Refactoring
Database RefactoringDatabase Refactoring
Database RefactoringAnton Keks
 
Continuous Deployment at Lean LA
Continuous Deployment at Lean LAContinuous Deployment at Lean LA
Continuous Deployment at Lean LABrett Durrett
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best PracticesEric Bottard
 
02 test automation functional testing (qtp)
02 test automation functional testing (qtp)02 test automation functional testing (qtp)
02 test automation functional testing (qtp)Siddireddy Balu
 
Rational Functional Tester
Rational Functional TesterRational Functional Tester
Rational Functional TesterRavi Anand
 
Lean and Kanban Principles for Software Developers
Lean and Kanban Principles for Software DevelopersLean and Kanban Principles for Software Developers
Lean and Kanban Principles for Software DevelopersCory Foy
 

La actualidad más candente (9)

Database Refactoring
Database RefactoringDatabase Refactoring
Database Refactoring
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
Erlang and Scalability
Erlang and ScalabilityErlang and Scalability
Erlang and Scalability
 
Continuous Deployment at Lean LA
Continuous Deployment at Lean LAContinuous Deployment at Lean LA
Continuous Deployment at Lean LA
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best Practices
 
02 test automation functional testing (qtp)
02 test automation functional testing (qtp)02 test automation functional testing (qtp)
02 test automation functional testing (qtp)
 
Kanban by Mayur Gupta
Kanban by Mayur GuptaKanban by Mayur Gupta
Kanban by Mayur Gupta
 
Rational Functional Tester
Rational Functional TesterRational Functional Tester
Rational Functional Tester
 
Lean and Kanban Principles for Software Developers
Lean and Kanban Principles for Software DevelopersLean and Kanban Principles for Software Developers
Lean and Kanban Principles for Software Developers
 

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

Coding Together - A Dev Workflow
Coding Together - A Dev WorkflowCoding Together - A Dev Workflow
Coding Together - A Dev WorkflowPeter Chester
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsJavascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsChris Powers
 
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianDeveloper Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianRay Ploski
 
01 software test engineering (manual testing)
01 software test engineering (manual testing)01 software test engineering (manual testing)
01 software test engineering (manual testing)Siddireddy Balu
 
2010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week12010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week1Wolfram Arnold
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDDavid Rodenas
 
High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)Arnaud Bouchez
 
Refactoring For Testability
Refactoring For TestabilityRefactoring For Testability
Refactoring For TestabilityAAron EvaNS
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
 
IPTV QoE Monitoring
IPTV QoE MonitoringIPTV QoE Monitoring
IPTV QoE MonitoringYoss Cohen
 
Why Test Driven Development?
Why Test Driven Development?Why Test Driven Development?
Why Test Driven Development?Naresh Jain
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanJaehoon Oh
 
It's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecIt's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecGiulio De Donato
 
TGT#16 - Sztuka projektowania testów - Agnieszka Garwolińska
TGT#16 - Sztuka projektowania testów - Agnieszka GarwolińskaTGT#16 - Sztuka projektowania testów - Agnieszka Garwolińska
TGT#16 - Sztuka projektowania testów - Agnieszka GarwolińskaTrójmiejska Grupa Testerska
 
Refactoring Fest
Refactoring FestRefactoring Fest
Refactoring FestNaresh Jain
 
Testing Primer
Testing PrimerTesting Primer
Testing Primerblowmage
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)Brian Rasmussen
 
Mad development
Mad developmentMad development
Mad developmentEric Lewis
 

Similar a Below And Beneath Tdd Test Last Development And Other Real World Test Patterns Presentation (20)

Basic RSpec 2
Basic RSpec 2Basic RSpec 2
Basic RSpec 2
 
Coding Together - A Dev Workflow
Coding Together - A Dev WorkflowCoding Together - A Dev Workflow
Coding Together - A Dev Workflow
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end DevsJavascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
 
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianDeveloper Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
 
01 software test engineering (manual testing)
01 software test engineering (manual testing)01 software test engineering (manual testing)
01 software test engineering (manual testing)
 
2010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week12010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week1
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDD
 
High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)
 
Refactoring For Testability
Refactoring For TestabilityRefactoring For Testability
Refactoring For Testability
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
 
IPTV QoE Monitoring
IPTV QoE MonitoringIPTV QoE Monitoring
IPTV QoE Monitoring
 
Why Test Driven Development?
Why Test Driven Development?Why Test Driven Development?
Why Test Driven Development?
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsman
 
It's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecIt's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspec
 
TGT#16 - Sztuka projektowania testów - Agnieszka Garwolińska
TGT#16 - Sztuka projektowania testów - Agnieszka GarwolińskaTGT#16 - Sztuka projektowania testów - Agnieszka Garwolińska
TGT#16 - Sztuka projektowania testów - Agnieszka Garwolińska
 
Refactoring Fest
Refactoring FestRefactoring Fest
Refactoring Fest
 
Testing Primer
Testing PrimerTesting Primer
Testing Primer
 
The Power of Refactoring
The Power of RefactoringThe Power of Refactoring
The Power of Refactoring
 
Test-Driven Development (TDD)
Test-Driven Development (TDD)Test-Driven Development (TDD)
Test-Driven Development (TDD)
 
Mad development
Mad developmentMad development
Mad development
 

Más de railsconf

Smacking Git Around Advanced Git Tricks
Smacking Git Around   Advanced Git TricksSmacking Git Around   Advanced Git Tricks
Smacking Git Around Advanced Git Tricksrailsconf
 
Running The Show Configuration Management With Chef Presentation
Running The Show  Configuration Management With Chef PresentationRunning The Show  Configuration Management With Chef Presentation
Running The Show Configuration Management With Chef Presentationrailsconf
 
Sd208 Ds%2 C0
Sd208 Ds%2 C0Sd208 Ds%2 C0
Sd208 Ds%2 C0railsconf
 
Rails Is From Mars Ruby Is From Venus Presentation 1
Rails Is From Mars  Ruby Is From Venus Presentation 1Rails Is From Mars  Ruby Is From Venus Presentation 1
Rails Is From Mars Ruby Is From Venus Presentation 1railsconf
 
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity PresentationRails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentationrailsconf
 
Quality Code With Cucumber Presentation
Quality Code With Cucumber PresentationQuality Code With Cucumber Presentation
Quality Code With Cucumber Presentationrailsconf
 
J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentationrailsconf
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amfrailsconf
 
Don T Mock Yourself Out Presentation
Don T Mock Yourself Out PresentationDon T Mock Yourself Out Presentation
Don T Mock Yourself Out Presentationrailsconf
 
Gov 2 0 Transparency Collaboration And Participation In Practice Presentation
Gov 2 0  Transparency  Collaboration  And Participation In Practice PresentationGov 2 0  Transparency  Collaboration  And Participation In Practice Presentation
Gov 2 0 Transparency Collaboration And Participation In Practice Presentationrailsconf
 
Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applicationsrailsconf
 
Develop With Pleasure Deploy With Fun Glass Fish And Net Beans For A Better...
Develop With Pleasure  Deploy With Fun  Glass Fish And Net Beans For A Better...Develop With Pleasure  Deploy With Fun  Glass Fish And Net Beans For A Better...
Develop With Pleasure Deploy With Fun Glass Fish And Net Beans For A Better...railsconf
 
Building A Mini Google High Performance Computing In Ruby
Building A Mini Google  High Performance Computing In RubyBuilding A Mini Google  High Performance Computing In Ruby
Building A Mini Google High Performance Computing In Rubyrailsconf
 
A Z Introduction To Ruby On Rails
A Z Introduction To Ruby On RailsA Z Introduction To Ruby On Rails
A Z Introduction To Ruby On Railsrailsconf
 
The Even Darker Art Of Rails Engines Presentation
The Even Darker Art Of Rails Engines PresentationThe Even Darker Art Of Rails Engines Presentation
The Even Darker Art Of Rails Engines Presentationrailsconf
 

Más de railsconf (15)

Smacking Git Around Advanced Git Tricks
Smacking Git Around   Advanced Git TricksSmacking Git Around   Advanced Git Tricks
Smacking Git Around Advanced Git Tricks
 
Running The Show Configuration Management With Chef Presentation
Running The Show  Configuration Management With Chef PresentationRunning The Show  Configuration Management With Chef Presentation
Running The Show Configuration Management With Chef Presentation
 
Sd208 Ds%2 C0
Sd208 Ds%2 C0Sd208 Ds%2 C0
Sd208 Ds%2 C0
 
Rails Is From Mars Ruby Is From Venus Presentation 1
Rails Is From Mars  Ruby Is From Venus Presentation 1Rails Is From Mars  Ruby Is From Venus Presentation 1
Rails Is From Mars Ruby Is From Venus Presentation 1
 
Rails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity PresentationRails 3 And The Real Secret To High Productivity Presentation
Rails 3 And The Real Secret To High Productivity Presentation
 
Quality Code With Cucumber Presentation
Quality Code With Cucumber PresentationQuality Code With Cucumber Presentation
Quality Code With Cucumber Presentation
 
J Ruby On Rails Presentation
J Ruby On Rails PresentationJ Ruby On Rails Presentation
J Ruby On Rails Presentation
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amf
 
Don T Mock Yourself Out Presentation
Don T Mock Yourself Out PresentationDon T Mock Yourself Out Presentation
Don T Mock Yourself Out Presentation
 
Gov 2 0 Transparency Collaboration And Participation In Practice Presentation
Gov 2 0  Transparency  Collaboration  And Participation In Practice PresentationGov 2 0  Transparency  Collaboration  And Participation In Practice Presentation
Gov 2 0 Transparency Collaboration And Participation In Practice Presentation
 
Crate Packaging Standalone Ruby Applications
Crate  Packaging Standalone Ruby ApplicationsCrate  Packaging Standalone Ruby Applications
Crate Packaging Standalone Ruby Applications
 
Develop With Pleasure Deploy With Fun Glass Fish And Net Beans For A Better...
Develop With Pleasure  Deploy With Fun  Glass Fish And Net Beans For A Better...Develop With Pleasure  Deploy With Fun  Glass Fish And Net Beans For A Better...
Develop With Pleasure Deploy With Fun Glass Fish And Net Beans For A Better...
 
Building A Mini Google High Performance Computing In Ruby
Building A Mini Google  High Performance Computing In RubyBuilding A Mini Google  High Performance Computing In Ruby
Building A Mini Google High Performance Computing In Ruby
 
A Z Introduction To Ruby On Rails
A Z Introduction To Ruby On RailsA Z Introduction To Ruby On Rails
A Z Introduction To Ruby On Rails
 
The Even Darker Art Of Rails Engines Presentation
The Even Darker Art Of Rails Engines PresentationThe Even Darker Art Of Rails Engines Presentation
The Even Darker Art Of Rails Engines Presentation
 

Último

Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...amitlee9823
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxAndy Lambert
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...rajveerescorts2022
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Centuryrwgiffor
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noidadlhescort
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...allensay1
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceDamini Dixit
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfAmzadHosen3
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...lizamodels9
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture conceptP&CO
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfAdmir Softic
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLkapoorjyoti4444
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756dollysharma2066
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
 

Último (20)

Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdf
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 

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

  • 1. Below And Beneath TDD Test-Last Development and other real world test patterns Noel Rappin @noelrap Pathfinder Development pathf.com railsprescriptions.com
  • 3. TEST REFACTOR FAIL PASS CODE Rx
  • 4. TEST REFACTOR Why does testing work? FAIL PASS Why does testing fail? CODE Rx
  • 5. TEST REFACTOR What does it mean for testing to “work”? FAIL PASS CODE Rx
  • 6. TEST REFACTOR Improve effectiveness of team and quality of code NOT FAIL PASS A perfect guarantee of code correctness CODE Rx
  • 7. 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
  • 8. TEST REFACTOR Accurate view of code Small, incremental steps FAIL PASS Scaffold for change Focus for development CODE Rx
  • 9. TEST REFACTOR What does it mean for testing to “fail”? FAIL PASS CODE Rx
  • 10. TEST REFACTOR Decrease efficiency and code quality FAIL PASS CODE Rx
  • 11. 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
  • 12. 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
  • 13. TEST REFACTOR FAIL PASS CODE Rx
  • 14. TEST REFACTOR Test-Driven Development FAIL PASS CODE Rx
  • 15. TEST REFACTOR AKA: Behavior-Driven Development or FAIL PASS Test-First Programming CODE Rx
  • 16. TEST REFACTOR TDD Code has: small pieces FAIL PASS high cohesion loose coupling minimal side-effects CODE Rx
  • 17. TEST REFACTOR ☺Accurate view of code ☺Small, incremental steps FAIL PASS ☺Scaffold for change ☺Focus for development CODE Rx
  • 18. TEST REFACTOR FAIL PASS CODE Rx
  • 19. TEST Lose the refactoring FAIL PASS CODE Rx
  • 20. TEST Development, that FAIL PASS happens to have tests CODE Rx
  • 21. TEST Symptoms: FAIL PASS Increased duplicaton in code. Long methods CODE Rx
  • 22. TEST Benefits: FAIL PASS May seem faster at first CODE Rx
  • 23. TEST Over time... FAIL PASS CODE Rx
  • 24. TEST ☺Accurate view of code Small, incremental steps FAIL PASS Scaffold for change ☺Focus for development CODE Rx
  • 25. TEST Fix by: FAIL PASS Cleaning up your mess CODE Rx
  • 26. TEST REFACTOR FAIL PASS CODE Rx
  • 27. TEST REFACTOR FAIL PASS TEST FAIL CODE Rx
  • 28. TEST REFACTOR assert_equal(nil, actual) assert_equal(4.314, actual) FAIL PASS TEST actual = 4.314 FAIL CODE Rx
  • 29. TEST REFACTOR Data-Driven Testing or FAIL PASS Using your program as a calculator TEST FAIL CODE Rx
  • 30. TEST REFACTOR Benefits: Failed Test Guaranteed FAIL PASS Value may be hard to calculate TEST FAIL CODE Rx
  • 31. TEST REFACTOR Pitfalls: Can mask ignorance of domain FAIL PASS Can lead to worse TEST problems FAIL CODE Rx
  • 32. TEST REFACTOR Accurate view of code ☺Small, incremental steps FAIL PASS ☺Scaffold for change ☺Focus for development TEST FAIL CODE Rx
  • 33. TEST REFACTOR assert_equal(nil, actual) assert_equal(4.314, actual) FAIL PASS TEST actual = 4.314 FAIL CODE Rx
  • 34. REFACTOR CODE actual = 4.314 assert_equal(4.314, actual) PASS TEST Rx
  • 35. CODE REFACTOR Test-Next Development aka PASS Code-Driven Development TEST Rx
  • 36. CODE REFACTOR Symptoms: No more failing tests Tweaking tests to PASS match code Coverage drop TEST Rx
  • 37. CODE REFACTOR Benefits: Useful when exploring PASS Useful when testing views TEST Rx
  • 38. CODE REFACTOR Pitfalls: Easily slides into worse patterns PASS Hard to avoid coverage gaps TEST Rx
  • 39. CODE REFACTOR Accurate view of code ☺Small, incremental steps PASS Scaffold for change Focus for development TEST Rx
  • 40. CODE REFACTOR Tautology Based Development PASS TEST Rx
  • 41. CODE REFACTOR Definition: Tests that can’t PASS fail TEST Rx
  • 42. CODE REFACTOR Symptoms: Bugs that should have been covered PASS Mock object misuse TEST Rx
  • 43. CODE REFACTOR ☹Accurate view of code ☺Small, incremental steps PASS Scaffold for change ☹Focus for development TEST Rx
  • 44. CODE REFACTOR Mitigation: Try to separate code assertions PASS from application data TEST Rx
  • 45. CODE REFACTOR PASS TEST Rx
  • 46. CODE REFACTOR CODE CODE CODE PASS CODE CODE CODE TEST Rx
  • 47. CODE REFACTOR CODE CODE CODE Test-Last Development PASS CODE CODE CODE TEST Rx
  • 48. CODE REFACTOR CODE Symptoms: CODE Significant coverage drop CODE PASS Uncovered bugs CODE Harder to write tests CODE CODE TEST Rx
  • 49. 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
  • 50. CODE REFACTOR CODE Pitfall: CODE Tests get more CODE expensive PASS CODE Lower quality tests CODE Programmer boredom CODE TEST Rx
  • 51. CODE REFACTOR CODE CODE Needed when: CODE Hitting corner case PASS CODE Dealing with legacy CODE CODE TEST Rx
  • 52. CODE REFACTOR CODE ☹Accurate view of code CODE ☹Small, incremental steps CODE PASS Scaffold for change CODE ☹Focus for development CODE CODE TEST Rx
  • 53. 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
  • 54. CODE REFACTOR CODE CODE CODE PASS CODE CODE CODE TEST Rx
  • 55. CODE REFACTOR CODE CODE CODE Run CODE CODE CODE TEST Rx
  • 56. CODE REFACTOR CODE CODE Coverage Driven CODE Development Run CODE CODE CODE TEST Rx
  • 57. CODE REFACTOR CODE CODE Symptom: CODE Run Tests without assertions CODE CODE CODE TEST Rx
  • 58. CODE REFACTOR CODE Why? CODE Minimal approach to CODE Run legacy CODE Hard to reach code CODE CODE TEST Rx
  • 59. CODE REFACTOR CODE ☹Accurate view of code CODE ☹Small, incremental steps CODE Run ☹Scaffold for change CODE ☹Focus for development CODE CODE TEST Rx
  • 60. TEST REFACTOR FAIL PASS CODE Rx
  • 61. TEST REFACTOR TEST TEST TEST TEST FAIL PASS CODE Rx
  • 62. TEST REFACTOR TEST TEST TEST TEST Lots of Test FAIL PASS First Development CODE Rx
  • 63. TEST REFACTOR TEST TEST TEST TEST Symptom: FAIL PASS Lots of test failures at once during initial developmment CODE Rx
  • 64. TEST REFACTOR TEST TEST TEST TEST Benefit: FAIL PASS Allows planning for future code CODE Rx
  • 65. TEST REFACTOR TEST TEST TEST TEST Cost: Loss of focus FAIL PASS Somewhat harder to write code against CODE Rx
  • 66. TEST REFACTOR TEST TEST TEST TEST Middle Ground: FAIL PASS RSpec pending CODE Rx
  • 67. TEST REFACTOR TEST TEST ☺Accurate view of code TEST TEST Small, incremental steps FAIL PASS ☺Scaffold for change Focus for development CODE Rx
  • 68. TEST REFACTOR FAIL PASS CODE Rx
  • 69. SETUP REFACTOR TEST PASS FAIL CODE Rx
  • 70. SETUP REFACTOR TEST Setup Driven Development PASS FAIL CODE Rx
  • 71. SETUP REFACTOR Symptom: TEST Large, brittle setup methods PASS Slow tests FAIL High-level tests CODE Rx
  • 72. SETUP REFACTOR TEST Costs: PASS This is why people hate testing FAIL CODE Rx
  • 73. SETUP REFACTOR Accurate view of code TEST ☹Small, incremental steps PASS ☺Scaffold for change Focus for development FAIL CODE Rx
  • 74. SETUP REFACTOR TEST Escape by: Mock Objects PASS Real unit tests FAIL CODE Rx
  • 75. TEST REFACTOR FAIL PASS CODE Rx
  • 76. TEST REFACTOR Another problem: End to end failures FAIL PASS Lack of focus Expectation failures CODE Rx
  • 77. Cucumber REFACTOR TEST A potential solution PASS FAIL CODE Rx
  • 78. Cucumber REFACTOR TEST Acceptance Test-Driven PASS Development FAIL CODE Rx
  • 79. Cucumber REFACTOR Symptom: TEST PASS You are writing acceptance tests FAIL CODE Rx
  • 80. Cucumber REFACTOR Costs: TEST PASS Additional layer of test code, indirection FAIL CODE Rx
  • 81. Cucumber REFACTOR Benefits: TEST PASS Increased focus, improved feedback FAIL CODE Rx
  • 82. Cucumber REFACTOR ☺Accurate view of code ☺Small, incremental steps TEST PASS ☺Scaffold for change ☺Focus for development FAIL CODE Rx
  • 83. TEST REFACTOR FAIL PASS CODE Rx
  • 84. TEST REFACTOR And So: FAIL PASS CODE Rx
  • 85. TEST REFACTOR Constant feedback and FAIL PASS baby steps CODE Rx
  • 86. TEST REFACTOR Focus on what comes next Failure Driven FAIL PASS Development CODE Rx
  • 87. TEST REFACTOR Good code has small pieces high cohesion FAIL PASS loose coupling minimal side-effects CODE Rx
  • 88. TEST REFACTOR Invisible cost of bugs or FAIL PASS Done vs. “Done Done” CODE Rx
  • 89. TEST REFACTOR Go write some tests! FAIL PASS CODE Rx
  • 90. 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