SlideShare une entreprise Scribd logo
1  sur  55
Presenting TDD
TEST-DRIVEN DEVELOPMENT




                                                2009-04-29

                           Brian Rasmussen
                 http://www.linkedin.com/in/brianrasmussen
AGENDA

    Answers to the WH-words
                             (WHO – WHAT – WHERE)




    Where to begin



    The Turn …



    … the Twist



    Excuses and Common Traps



    Where to go from here

What is TDD
WHAT IS TDD

    Test-Driven Development (or test driven design) is a

    methodology.

Common TDD misconception:
 TDD is not about testing


    TDD is about design and development



    By testing first you design your code

WHAT IS TDD

    Short development iterations.



    Based on requirement and pre-written test cases.



    Produces code necessary to pass that iteration's test.



    Refactor both code and tests.



    The goal is to produce working clean code that fulfills

    requirements.
TEST-DRIVEN DEVELOPMENT

    Test-driven development (TDD) is a software

    development technique that uses short development
    iterations based on pre-written test cases that define
    desired improvements or new functions. Each
    iteration produces code necessary to pass that
    iteration's tests. Finally, the programmer or team
    refactors the code to accommodate changes. A key
    TDD concept is that preparing tests before coding
    facilitates rapid feedback changes. Note that test-
    driven development is a software design
    method, not merely a method of testing.
HOW DOES TDD HELP

    TDD helps you produce clean working code that

    fulfills requirements

    Write Test Code

        Code that fulfills requirements
    

    Write Functional Code

        Working code that fulfills requirements
    

    Refactor

        Clean working code that fulfills requirements
    
ORIGIN

    eXtreme Programming (XP)

        1999 Kent Beck, Martin Fowler and others…
    
TDD BASICS - UNIT TESTING

    Red, Green, Refactor



    Make it Fail

        No code without a failing test
    

    Make it Work

        As simply as possible
    

    Make it Better

        Refactor
    
TDD CYCLE

                                          New
                                        require-
                                         ment
                                                           Write
                         Run
                                                           new
  Make it Better        tests
                                                           test




                                                                Run    Make it Fail
                   Refactor
                                                               tests



                                                   Write
                                 Run
                                                   new
         Make it Work           tests
                                                   code
TDD CYCLE

    Write Test Code

        Guarantees that every functional code is testable
    
        Provides a specification for the functional code
    
        Helps to think about design
    
        Ensure the functional code is tangible
    

    Write Functional Code

        Fulfill the requirement (test code)
    
        Write the simplest solution that works
    
        Leave Improvements for a later step
    
        The code written is only designed to pass the test
    
             no further (and therefore untested code is not created).
         

    Refactor

        Clean-up the code (test and functional)
    
        Make sure the code expresses intent
    
        Remove code smells
    
        Re-think the design
    
        Delete unnecessary code
    
Why TDD
WHY / BENEFITS

    Confidence in change

        Increase confidence in code
    
        Fearlessly change your code
    




    Document requirements



    Discover usability issues early



    Regression testing = Stable software = Quality

    software
WHERE DOES IT HURT
                                                The pain is here!              This is too late…
                    100%                                                                                   10
                                                                                                           9
                    80%                                                                                    8
% defects created




                                                                                                           7




                                                                                                                Thousand $s
                    60%                                                                                    6
                                                                                                           5
                    40%                                                                                    4
                                                                                                           3
                    20%                                                                                    2
                                                                                                           1
                     0%                                                                                    0
                           Requirements        Coding       Integration         Testing          Support

                                          % of Defects Introduced         Cost to Fix a Defect
IS TDD A WASTE OF TIME (MICROSOFT RESEARCH)

160%
140%
120%
                                                Time To Code Feature
100%
                                                Time To Code Feature
 80%
                                                using TDD
 60%                                            Defect density of team
 40%
                                                Defect density of team
 20%
                                                using TDD
 0%
       MS: VS   MS: MSN    MS:   IBM: Drivers
  Major quality improvement for minor time investment
                         Windows
How to
REMEMBER - THERE ARE OTHER KINDS OF TESTS

    Unit test (Unit)

    Integration test (Collaboration)

    User interface test (Frontend, ex. WatiN)

    Regression test (Continuous Integration)

    …, System, Performance, Stress, Usability, …


      The only tests relevant to TDD is Black-box Unit Testing

Test types:
 Black-box test
 White-box test
DIFFICULT SCENARIOS TO UNIT TEST

    Closed Object Models (Sharepoint, Silverlight)

    Client – server architecture

         Communicating Across a Network
    

    An out-of-process call

         Includes talking to databases and Web Services.
    

    UI

         GUI interaction
    

    Touching the File System

    Legacy Code

    Requires the Environment to be configured

HOW TO DO TDD

    … on my component A?

    Unit Test A, but what about B, C, D…?




                            B
                                    D
                 A
                            C               E
HOW TO DO TDD

    … on my component A?

                  This, and the previous two slides,
    Ifare all thoughts on implementing tests on existing code.
       my component reference…

         My coworkers component
    
         A third party component
    
            This is all White-box Unit- or Integration Testing
         A very slow component (Database, Web service)
    
                and has therefore nothing to do with TDD.
         A component with complex set up
    
         A component with exceptional behavior (Exception)
    
         A remote component (Remoting)
    
        In TDD dependencya Black-box Unit test that fails, first,
         Circular you write
    
          and worry about the code implementation later.
    Do I have to wait on these components to be

    created and/or tested?
SINGLE MOST IMPORTANT THING
        WHEN LEARNING TDD




           Do not
write the code in your head
 before you write the test
SINGLE MOST IMPORTANT THING
                WHEN LEARNING TDD

    When you first start at doing TDD you quot;knowquot; what the

    design should be. You quot;knowquot; what code you want to
    write. So you write a test that will let you write that bit
    of code.
    When you do this you aren't really doing TDD – since

    you are writing the code first (even if the code is only
    in your head )
    It takes some time to (and some poking by clever

    folk) to realize that you need to focus on the test.
    Write the test for the behavior you want - then write
    the minimal code needed to make it pass - then let
    the design emerge through refactoring. Repeat until
    done.
Where to begin
UNBOUNDED STACK EXAMPLE

    Requirement: FILO / LIFO messaging system



    Brainstorm a list of tests for the requirement:

        Create a Stack and verify that IsEmpty is true.
    
        Push a single object on the Stack and verify that IsEmpty is false.
    
        Push a single object, Pop the object, and verify that IsEmpty is true.
    
        Push a single object, remembering what it is; Pop the object, and verify that
    
        the two objects are equal.
        Push three objects, remembering what they are; Pop each one, and verify
    
        that they are removed in the correct order.
        Pop a Stack that has no elements.
    
        Push a single object and then call Top. Verify that IsEmpty is false.
    
        Push a single object, remembering what it is; and then call Top. Verify that
    
        the object that is returned is the same as the one that was pushed.
        Call Top on a Stack with no elements.
    
UNBOUNDED STACK EXAMPLE

    Choosing the First Test?

        The simplest.
    
        The essence.
    




Answers:
 If you need to write code that is untested, choose a
  simpler test.

    If the essence approach takes to much time to

    implement, choose a simpler test.
UNBOUNDED STACK EXAMPLE

    Anticipating future tests, or not?



Answers:
 In the beginning, focus on the test you are
  writing, and do not think of the other tests.

    As you become familiar with the technique and the

    task, you con increase the size of the steps.

    But remember still, no written code must be untested.

Unbounded stack example
UNBOUNDED STACK EXAMPLE

    As we were implementing the sixed test, a few

    additional tests came to mind, so we need to add
    them to our test list.
    We want to add tests to verify that the Stack works

    when the arguments are equal to null. The new tests
    are as follows:
        Push null onto the Stack and verify that IsEmpty returns false.
    
        Push null onto the Stack, Pop the Stack, and verify that the value returned is
    
        null.
        Push null onto the Stack, call Top, and verify that the value returned is null.
    
The Turn …
WHY DON’T YOU DO TDD, STILL

    Why, when TDD was born a decade ago?

        The one and only reason: #1: Learning curve…
    




    So why am I telling you this today?

        Something happened in the last year…
    
TECHNIQUES YOU NEEDED TO KNOW ABOUT

    Interfaces

    Dependency Injection

    Test Doubles (Mock Objects)

    Mocking Framework.

    The builder and fluent interface patterns.

    …





Not a chance – you still need to know about:
 Refactoring
THE OLD WAY VS THE NEW WAY

                 Either (the old way)
                        “Mock”
    Using Interfaces, Dependency Injection and
            Test Doubles (Mock Objects)

                Or (the new way)
              “Isolate” and “Fake”
            Using Typemock Isolator
    and AAA - The quot;Arrange-act-assertquot; pattern
WHY “ISOLATE” AND / OR “FAKE” AT ALL

… when you can hand-write mocks yourself.




    ASP.NET MVC example
WHY “ISOLATE” AND / OR “FAKE” AT ALL

… when you can hand-write mocks yourself.

    ASP.NET MVC

        AccountControllerTest file contains 25 tests.
    
                               It's a waste of time.
        The mocking code starts at line 376 and goes on until line 668 (the end of
    
        the file). That's using an isolation frameworkit contains logic.
                 Start 293 lines of mocking code, some of now.

    Rewriting all this with Isolator code

        Ends at line 392
    



    I'll let you do the math.

        I wrote mock code like that before. Can you believe my mocking code
    
        even contained bugs? I had to fix those as well.
WHY BUY WHEN YOU CAN GET IT FOR FREE

    Typemock (Commercial) vs. other frameworks.

        The quot;freequot; products are not called free, they are open-source projects.
    
        They are built in most cases by a single person, and maintained by the
    
        community if they are successful.
        There's a lot of effort and love put into that. What's the return? There's the
    
        great satisfaction someone finds your software useful (Hey, that also goes for
        commercial products).
        Ayende, creator of Rhino Mocks and Daniel, creator of Moq, put a lot of
    
        hours into feature requests and support, but there's a limit to what they can
        do.
        Take a look at Ayende's slogan on his blog: quot;Send me a patch for thisquot;.
    
        Don't be a whiner. Take responsibility. Compare the good, bad and ugly.
    
        And pick what is right for you, not because it's what you can afford, but for
        what it will save you, give you back or help you outperform your
        competitors.
        Of course you get what you pay for (Nothing + More nothing = Nothing).
    
TYPEMOCK™

    Established 2005, privately owned

    Typemock Isolator

    Thousands of customers (Fortune 500)

    Tens of thousands licenses sold

TYPEMOCK.NET HISTORY

    The Typemock Isolator product supports three sets of

    API in order to fake dependencies:

    Reflective Mocks

        String based API (Oldest framework).
    

    Natural Mocks

        Record-Replay but strongly typed (Old framework).
    

    Typemock Isolator

        Arrange Act Assert (AAA) Syntax (Latest API version - you are encouraged
    
        to use this).
ARRANGE ACT ASSERT (AAA)

    The “Arrange-act-assert” pattern in the field of mock

    frameworks represents us trying to return to basics.

    Moq did that nicely by showing a way that leads

    there, and it is being taken gladly by Rhino and
    Typemock Isolator.

    AAA is guidance because there was an outcry (a

    silent, vote of feet) that record-replay is not cutting it
    – it’s too confusing for non-experts. It’s too technical.
    and it does not lend itself to the way people want to
    work. So most people didn’t use it.
… the Twist
Typemock Isolator Demo
Excuses
TOP FIVE EXCUSES FOR NOT UNIT TESTING

     I don’t have time to unit test.
1.
     The client pays me to develop code, not write unit
2.
     test.
     I am supporting a legacy application without unit
3.
     tests.
     QA and User Acceptance Testing is far more
4.
     effective in finding bugs.
     I don’t know how to unit test, or I don’t know how to
5.
     write good unit tests.
WHEN DO YOU THINK YOU'LL INTRODUCE
UNIT TESTING

    A common answer to this question:

        quot;We're in a middle of a project right now. We'll wait two months until it
    
        completes, then we'll have timequot;.

    If you gave me this answer, I won't believe you. Here's

    why:
        If I came to you in two months and asked what has changed since last
    
        time, you'll give me the same answer.

    That's because development is always done under

    pressure.
WHEN DO YOU THINK YOU'LL INTRODUCE
UNIT TESTING

    In two months time, you'll be up to your neck in fixing

    bugs, running away from QA reports. You'll fix those
    bugs, and eat away at the time you thought you'd
    have when the project completes. And when it does
    complete (late), and you think it's over, you'll start
    receiving bug reports from the customer. Guess
    what? no time to start unit testing then either.
    Let's face it, there is never a good time to start unit-

    testing, or making any change, for that matter.
    So, start today. Write your first unit tests. Change is
    painful, and you'd rather delay that. But in agile, we
    say: if it's painful, do it first.
TEST CODE IS JUST CODE - COMMON TRAPS

    Some Anti-Patterns to avoid and some techniques for

    making sure Test Code doesn't slow you down:

    Cut & Paste

        Refactor test code
    

    Poor Encapsulation

        The builder and fluent interface patterns are very useful here
    

    Bloated SetUp

        Isolation framework / Dependency Injection and Test Doubles
    

    Too hard to write the Test

        Refactor production code
    

    Code Integration Test Pain

        Remember Integration Testing as well
    
CLASSICISTS V MOCKIST V ISOLATOR

    Classicists

     The classical TDD style isdoes White-box Integrationa double if it's
           The Classicists to use real objects if possible and testing
      awkward to use the real thing. So a classical TDDer would use a real
                               First generation TDD
      warehouse and a double for the mail service. The kind of double doesn't
         really matter that much.


    Mockist

         A mockist TDD practitioner, however, will always use a mock for any object
     
                     The Mockist does White-box Unit testing
         with interesting behavior. In this case for both the warehouse and the mail
                              Sencond generation TDD
         service.


    Isolator and Fake

      An isolator TDD practitioner, will always “isolate” or “fake” any object with
             The Isolator and Fake does Black-box Unit testing
       interesting behavior. In this case for both the warehouse and the mail
                               Third generation TDD
       service.
INTRODUCING BDD

    Behaviour-Driven Development (BDD)

        By Dan North
    
        BDD is another variation on TDD that tends to use mockist testing
    

    Test method names should be sentences

    A simple sentence template keeps test methods focused

        This sentence template – The class should do something – means you can only
    
        define a test for the current class. This keeps you focused. If you find yourself
        writing a test whose name doesn’t fit this template, it suggests the behaviour may
        belong elsewhere.

    An expressive test name is helpful when a test fails

        “Behaviour” is a more useful word than “test”.
    
        Determine the next most important behaviour.
    
        Requirements are behaviour, too.
    
        BDD provides a “ubiquitous language” for analysis.
    
        Acceptance criteria should be executable.
    
WHEN TO USE TDD/BDD

    When you have to implement a new functional

    requirement, or make a requirement up yourself.

    Note: When you want to change existing code, first

    write covering Unit Tests (white box testing).
    Then use TDD to add new functionality.
TOOLS YOU NEED TO KNOW ABOUT

Continuous Integration

Build Automation Tools
 MSBuild
 Nant
 FinalBuilder


CI Servers
 Team System / Team Foundation Server
 TeamCity (R#)
 CCnet (CruiseControl.NET)
 FinalBuilder Server
TOOLS YOU NEED TO KNOW ABOUT

Visual Studio Integration
Refactoring
 R# (ReSharper)
 Code Rush
TOOLS YOU NEED TO KNOW ABOUT

Isolation / Mocking Frameworks for .net

Open Source
 Rhino Mocks for .NET
 NMock for .NET
 Moq for .Net


Commercial (costs money but worth it)
 Typemock Isolator
 Typemock Isolator For SharePoint
Where to go from here
WHERE TO GO FROM HERE

    You don’t have to start big

    Start new tasks with TDD

    Add Tests to code that you need to change or

    maintain – but only to small parts
    Proof of concept




           If it's worth building, it's worth testing.
                    If it's not worth testing,
         why are you wasting your time working on it?
LINKS

    Books

         Test-Driven Development in Microsoft® .NET (http://www.amazon.co.uk/gp/product/0735619484)
     
         Test-Driven Development by Kent Beck (C++) (http://www.amazon.co.uk/gp/product/0321146530)
     


    Blog

         The Typemock Insider Blog (http://blog.typemock.com/)
     


    Unit test study from Microsoft Research:

         http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf
     


    Typemock

         http://www.typemock.com/
     


    Unit testing Silverlight:

         http://www.codeplex.com/CThru
     


    Other links:

         http://en.wikipedia.org/wiki/Test-driven_development
     
         http://www.testdriven.com/
     
         http://www.mockobjects.com/ - Online TDD book: http://www.mockobjects.com/book/index.html
     
         http://www.martinfowler.com/articles/mocksArentStubs.html
     
         http://dannorth.net/introducing-bdd
     
         http://behaviour-driven.org/Introduction
     
Q&A

Contenu connexe

Tendances

BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVASrinivas Katakam
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
 
Introduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed ShreefIntroduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed ShreefAhmed Shreef
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentChristopher Read
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)Peter Thomas
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Edureka!
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#srivinayak
 
Introduction to E2E in Cypress
Introduction to E2E in CypressIntroduction to E2E in Cypress
Introduction to E2E in CypressFabio Biondi
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014JWORKS powered by Ordina
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To JenkinsKnoldus Inc.
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICDKnoldus Inc.
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins IntroductionPavan Gupta
 

Tendances (20)

Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
BDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVABDD WITH CUCUMBER AND JAVA
BDD WITH CUCUMBER AND JAVA
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Introduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed ShreefIntroduction to TDD (Test Driven development) - Ahmed Shreef
Introduction to TDD (Test Driven development) - Ahmed Shreef
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous Deployment
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
 
Uft Basics
Uft BasicsUft Basics
Uft Basics
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#
 
Introduction to E2E in Cypress
Introduction to E2E in CypressIntroduction to E2E in Cypress
Introduction to E2E in Cypress
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To Jenkins
 
Dev ops using Jenkins
Dev ops using JenkinsDev ops using Jenkins
Dev ops using Jenkins
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
 

En vedette

Why Follower Count is Bullshit
Why Follower Count is BullshitWhy Follower Count is Bullshit
Why Follower Count is BullshitMackenzie Fogelson
 
Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.
Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.
Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.Mark O'Toole
 
Good and Bad Power Point Examples Ed Tech
Good and Bad Power Point Examples Ed TechGood and Bad Power Point Examples Ed Tech
Good and Bad Power Point Examples Ed TechLynnylu
 
How to Master Difficult Conversations at Work – Leader’s Guide
How to Master Difficult Conversations at Work – Leader’s GuideHow to Master Difficult Conversations at Work – Leader’s Guide
How to Master Difficult Conversations at Work – Leader’s GuidePiktochart
 
4 Biggest Challenges for Creative Teams
4 Biggest Challenges for Creative Teams4 Biggest Challenges for Creative Teams
4 Biggest Challenges for Creative TeamsWrike
 
10 Dead Simple Ways to Improve Your Company Culture
10 Dead Simple Ways to Improve Your Company Culture10 Dead Simple Ways to Improve Your Company Culture
10 Dead Simple Ways to Improve Your Company CultureBonusly
 
How to think like a startup
How to think like a startupHow to think like a startup
How to think like a startupLoic Le Meur
 
10 Things your Audience Hates About your Presentation
10 Things your Audience Hates About your Presentation10 Things your Audience Hates About your Presentation
10 Things your Audience Hates About your PresentationStinson
 
WTF - Why the Future Is Up to Us - pptx version
WTF - Why the Future Is Up to Us - pptx versionWTF - Why the Future Is Up to Us - pptx version
WTF - Why the Future Is Up to Us - pptx versionTim O'Reilly
 
125 Clickass Copywriting Tips
125 Clickass Copywriting Tips125 Clickass Copywriting Tips
125 Clickass Copywriting TipsBarry Feldman
 
The Productivity Secret Of The Best Leaders
The Productivity Secret Of The Best LeadersThe Productivity Secret Of The Best Leaders
The Productivity Secret Of The Best LeadersOfficevibe
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer ExperienceYuan Wang
 
SlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design SecretsSlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design SecretsEugene Cheng
 
14 Tips to Entrepreneurs to start the Right Stuff
14 Tips to Entrepreneurs to start the Right Stuff14 Tips to Entrepreneurs to start the Right Stuff
14 Tips to Entrepreneurs to start the Right StuffPatrick Stähler
 
Leader's Guide to Motivate People at Work
Leader's Guide to Motivate People at WorkLeader's Guide to Motivate People at Work
Leader's Guide to Motivate People at WorkWeekdone.com
 
Inside Google's Numbers in 2017
Inside Google's Numbers in 2017Inside Google's Numbers in 2017
Inside Google's Numbers in 2017Rand Fishkin
 
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)Board of Innovation
 

En vedette (20)

10 Ways to be a Marketing Genius Like Lady Gaga
10 Ways to be a Marketing Genius Like Lady Gaga10 Ways to be a Marketing Genius Like Lady Gaga
10 Ways to be a Marketing Genius Like Lady Gaga
 
Why Follower Count is Bullshit
Why Follower Count is BullshitWhy Follower Count is Bullshit
Why Follower Count is Bullshit
 
Work Rules!
Work Rules!Work Rules!
Work Rules!
 
Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.
Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.
Congratulations Graduate! Eleven Reasons Why I Will Never Hire You.
 
Good and Bad Power Point Examples Ed Tech
Good and Bad Power Point Examples Ed TechGood and Bad Power Point Examples Ed Tech
Good and Bad Power Point Examples Ed Tech
 
How to Master Difficult Conversations at Work – Leader’s Guide
How to Master Difficult Conversations at Work – Leader’s GuideHow to Master Difficult Conversations at Work – Leader’s Guide
How to Master Difficult Conversations at Work – Leader’s Guide
 
4 Biggest Challenges for Creative Teams
4 Biggest Challenges for Creative Teams4 Biggest Challenges for Creative Teams
4 Biggest Challenges for Creative Teams
 
10 Dead Simple Ways to Improve Your Company Culture
10 Dead Simple Ways to Improve Your Company Culture10 Dead Simple Ways to Improve Your Company Culture
10 Dead Simple Ways to Improve Your Company Culture
 
How to think like a startup
How to think like a startupHow to think like a startup
How to think like a startup
 
10 Things your Audience Hates About your Presentation
10 Things your Audience Hates About your Presentation10 Things your Audience Hates About your Presentation
10 Things your Audience Hates About your Presentation
 
WTF - Why the Future Is Up to Us - pptx version
WTF - Why the Future Is Up to Us - pptx versionWTF - Why the Future Is Up to Us - pptx version
WTF - Why the Future Is Up to Us - pptx version
 
125 Clickass Copywriting Tips
125 Clickass Copywriting Tips125 Clickass Copywriting Tips
125 Clickass Copywriting Tips
 
The Productivity Secret Of The Best Leaders
The Productivity Secret Of The Best LeadersThe Productivity Secret Of The Best Leaders
The Productivity Secret Of The Best Leaders
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
SlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design SecretsSlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
SlideShare Experts - 7 Experts Reveal Their Presentation Design Secrets
 
14 Tips to Entrepreneurs to start the Right Stuff
14 Tips to Entrepreneurs to start the Right Stuff14 Tips to Entrepreneurs to start the Right Stuff
14 Tips to Entrepreneurs to start the Right Stuff
 
Leader's Guide to Motivate People at Work
Leader's Guide to Motivate People at WorkLeader's Guide to Motivate People at Work
Leader's Guide to Motivate People at Work
 
5 Storytelling Lessons From Superhero Stories
5 Storytelling Lessons From Superhero Stories5 Storytelling Lessons From Superhero Stories
5 Storytelling Lessons From Superhero Stories
 
Inside Google's Numbers in 2017
Inside Google's Numbers in 2017Inside Google's Numbers in 2017
Inside Google's Numbers in 2017
 
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
How I got 2.5 Million views on Slideshare (by @nickdemey - Board of Innovation)
 

Similaire à Test-Driven Development (TDD)

TDD sharevison team
TDD sharevison teamTDD sharevison team
TDD sharevison teamKhou Suylong
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldDror Helper
 
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...PHX - Session #2 Test Driven Development: Improving .NET Application Performa...
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...Steve Lange
 
Session #1: Development Practices And The Microsoft Approach
Session #1: Development Practices And The Microsoft ApproachSession #1: Development Practices And The Microsoft Approach
Session #1: Development Practices And The Microsoft ApproachSteve Lange
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern MethodologyEthan Jewett
 
Adopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy ContextAdopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy ContextXavier Warzee
 
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationJust Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationDaniel Wildt
 
Continuous Change-Driven Build Verification
Continuous Change-Driven Build Verification  Continuous Change-Driven Build Verification
Continuous Change-Driven Build Verification Perforce
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development IntroductionNguyen Hai
 
Постоянное тестирование интеграции
Постоянное тестирование интеграцииПостоянное тестирование интеграции
Постоянное тестирование интеграцииSQALab
 
PHX Session #1: Development Best Practices And How Microsoft Helps
PHX Session #1: Development  Best  Practices And  How  Microsoft  HelpsPHX Session #1: Development  Best  Practices And  How  Microsoft  Helps
PHX Session #1: Development Best Practices And How Microsoft HelpsSteve Lange
 
Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?
Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?
Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?Denim Group
 
The audacity of quality requirement-non functional testing- Aware in BugDay B...
The audacity of quality requirement-non functional testing- Aware in BugDay B...The audacity of quality requirement-non functional testing- Aware in BugDay B...
The audacity of quality requirement-non functional testing- Aware in BugDay B...Prathan Dansakulcharoenkit
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Babul Mirdha
 
Unit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of PurityUnit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of PurityVictor Rentea
 
2009 05 21 The Lean Startup At SIPA
2009 05 21 The Lean Startup At SIPA2009 05 21 The Lean Startup At SIPA
2009 05 21 The Lean Startup At SIPAEric Ries
 
Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...
Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...
Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...Eric Ries
 

Similaire à Test-Driven Development (TDD) (20)

TDD sharevison team
TDD sharevison teamTDD sharevison team
TDD sharevison team
 
Benefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real WorldBenefit From Unit Testing In The Real World
Benefit From Unit Testing In The Real World
 
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...PHX - Session #2 Test Driven Development: Improving .NET Application Performa...
PHX - Session #2 Test Driven Development: Improving .NET Application Performa...
 
Session #1: Development Practices And The Microsoft Approach
Session #1: Development Practices And The Microsoft ApproachSession #1: Development Practices And The Microsoft Approach
Session #1: Development Practices And The Microsoft Approach
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern Methodology
 
Adopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy ContextAdopting Agile Tools & Methods In A Legacy Context
Adopting Agile Tools & Methods In A Legacy Context
 
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test AutomationJust Java2007 - Daniel Wildt - Tools For Java Test Automation
Just Java2007 - Daniel Wildt - Tools For Java Test Automation
 
Continuous Change-Driven Build Verification
Continuous Change-Driven Build Verification  Continuous Change-Driven Build Verification
Continuous Change-Driven Build Verification
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development Introduction
 
Unit test
Unit testUnit test
Unit test
 
Selenium Camp 2012
Selenium Camp 2012Selenium Camp 2012
Selenium Camp 2012
 
Постоянное тестирование интеграции
Постоянное тестирование интеграцииПостоянное тестирование интеграции
Постоянное тестирование интеграции
 
PHX Session #1: Development Best Practices And How Microsoft Helps
PHX Session #1: Development  Best  Practices And  How  Microsoft  HelpsPHX Session #1: Development  Best  Practices And  How  Microsoft  Helps
PHX Session #1: Development Best Practices And How Microsoft Helps
 
Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?
Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?
Remediation Statistics: What Does Fixing Application Vulnerabilities Cost?
 
The audacity of quality requirement-non functional testing- Aware in BugDay B...
The audacity of quality requirement-non functional testing- Aware in BugDay B...The audacity of quality requirement-non functional testing- Aware in BugDay B...
The audacity of quality requirement-non functional testing- Aware in BugDay B...
 
Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)Test Driven iOS Development (TDD)
Test Driven iOS Development (TDD)
 
Unit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of PurityUnit Testing like a Pro - The Circle of Purity
Unit Testing like a Pro - The Circle of Purity
 
2009 05 21 The Lean Startup At SIPA
2009 05 21 The Lean Startup At SIPA2009 05 21 The Lean Startup At SIPA
2009 05 21 The Lean Startup At SIPA
 
Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...
Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...
Eric Ries Lean Startup Presentation For Web 2.0 Expo April 1 2009 A Disciplin...
 

Dernier

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Dernier (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Test-Driven Development (TDD)

  • 1. Presenting TDD TEST-DRIVEN DEVELOPMENT 2009-04-29 Brian Rasmussen http://www.linkedin.com/in/brianrasmussen
  • 2. AGENDA Answers to the WH-words  (WHO – WHAT – WHERE) Where to begin  The Turn …  … the Twist  Excuses and Common Traps  Where to go from here 
  • 4. WHAT IS TDD Test-Driven Development (or test driven design) is a  methodology. Common TDD misconception:  TDD is not about testing TDD is about design and development  By testing first you design your code 
  • 5. WHAT IS TDD Short development iterations.  Based on requirement and pre-written test cases.  Produces code necessary to pass that iteration's test.  Refactor both code and tests.  The goal is to produce working clean code that fulfills  requirements.
  • 6. TEST-DRIVEN DEVELOPMENT Test-driven development (TDD) is a software  development technique that uses short development iterations based on pre-written test cases that define desired improvements or new functions. Each iteration produces code necessary to pass that iteration's tests. Finally, the programmer or team refactors the code to accommodate changes. A key TDD concept is that preparing tests before coding facilitates rapid feedback changes. Note that test- driven development is a software design method, not merely a method of testing.
  • 7. HOW DOES TDD HELP TDD helps you produce clean working code that  fulfills requirements Write Test Code  Code that fulfills requirements  Write Functional Code  Working code that fulfills requirements  Refactor  Clean working code that fulfills requirements 
  • 8. ORIGIN eXtreme Programming (XP)  1999 Kent Beck, Martin Fowler and others… 
  • 9. TDD BASICS - UNIT TESTING Red, Green, Refactor  Make it Fail  No code without a failing test  Make it Work  As simply as possible  Make it Better  Refactor 
  • 10. TDD CYCLE New require- ment Write Run new Make it Better tests test Run Make it Fail Refactor tests Write Run new Make it Work tests code
  • 11. TDD CYCLE Write Test Code  Guarantees that every functional code is testable  Provides a specification for the functional code  Helps to think about design  Ensure the functional code is tangible  Write Functional Code  Fulfill the requirement (test code)  Write the simplest solution that works  Leave Improvements for a later step  The code written is only designed to pass the test  no further (and therefore untested code is not created).  Refactor  Clean-up the code (test and functional)  Make sure the code expresses intent  Remove code smells  Re-think the design  Delete unnecessary code 
  • 13. WHY / BENEFITS Confidence in change  Increase confidence in code  Fearlessly change your code  Document requirements  Discover usability issues early  Regression testing = Stable software = Quality  software
  • 14. WHERE DOES IT HURT The pain is here! This is too late… 100% 10 9 80% 8 % defects created 7 Thousand $s 60% 6 5 40% 4 3 20% 2 1 0% 0 Requirements Coding Integration Testing Support % of Defects Introduced Cost to Fix a Defect
  • 15. IS TDD A WASTE OF TIME (MICROSOFT RESEARCH) 160% 140% 120% Time To Code Feature 100% Time To Code Feature 80% using TDD 60% Defect density of team 40% Defect density of team 20% using TDD 0% MS: VS MS: MSN MS: IBM: Drivers Major quality improvement for minor time investment Windows
  • 17. REMEMBER - THERE ARE OTHER KINDS OF TESTS Unit test (Unit)  Integration test (Collaboration)  User interface test (Frontend, ex. WatiN)  Regression test (Continuous Integration)  …, System, Performance, Stress, Usability, …  The only tests relevant to TDD is Black-box Unit Testing Test types:  Black-box test  White-box test
  • 18. DIFFICULT SCENARIOS TO UNIT TEST Closed Object Models (Sharepoint, Silverlight)  Client – server architecture  Communicating Across a Network  An out-of-process call  Includes talking to databases and Web Services.  UI  GUI interaction  Touching the File System  Legacy Code  Requires the Environment to be configured 
  • 19. HOW TO DO TDD … on my component A?  Unit Test A, but what about B, C, D…?  B D A C E
  • 20. HOW TO DO TDD … on my component A?  This, and the previous two slides, Ifare all thoughts on implementing tests on existing code. my component reference…  My coworkers component  A third party component  This is all White-box Unit- or Integration Testing A very slow component (Database, Web service)  and has therefore nothing to do with TDD. A component with complex set up  A component with exceptional behavior (Exception)  A remote component (Remoting)  In TDD dependencya Black-box Unit test that fails, first, Circular you write  and worry about the code implementation later. Do I have to wait on these components to be  created and/or tested?
  • 21. SINGLE MOST IMPORTANT THING WHEN LEARNING TDD Do not write the code in your head before you write the test
  • 22. SINGLE MOST IMPORTANT THING WHEN LEARNING TDD When you first start at doing TDD you quot;knowquot; what the  design should be. You quot;knowquot; what code you want to write. So you write a test that will let you write that bit of code. When you do this you aren't really doing TDD – since  you are writing the code first (even if the code is only in your head ) It takes some time to (and some poking by clever  folk) to realize that you need to focus on the test. Write the test for the behavior you want - then write the minimal code needed to make it pass - then let the design emerge through refactoring. Repeat until done.
  • 24. UNBOUNDED STACK EXAMPLE Requirement: FILO / LIFO messaging system  Brainstorm a list of tests for the requirement:  Create a Stack and verify that IsEmpty is true.  Push a single object on the Stack and verify that IsEmpty is false.  Push a single object, Pop the object, and verify that IsEmpty is true.  Push a single object, remembering what it is; Pop the object, and verify that  the two objects are equal. Push three objects, remembering what they are; Pop each one, and verify  that they are removed in the correct order. Pop a Stack that has no elements.  Push a single object and then call Top. Verify that IsEmpty is false.  Push a single object, remembering what it is; and then call Top. Verify that  the object that is returned is the same as the one that was pushed. Call Top on a Stack with no elements. 
  • 25. UNBOUNDED STACK EXAMPLE Choosing the First Test?  The simplest.  The essence.  Answers:  If you need to write code that is untested, choose a simpler test. If the essence approach takes to much time to  implement, choose a simpler test.
  • 26. UNBOUNDED STACK EXAMPLE Anticipating future tests, or not?  Answers:  In the beginning, focus on the test you are writing, and do not think of the other tests. As you become familiar with the technique and the  task, you con increase the size of the steps. But remember still, no written code must be untested. 
  • 28. UNBOUNDED STACK EXAMPLE As we were implementing the sixed test, a few  additional tests came to mind, so we need to add them to our test list. We want to add tests to verify that the Stack works  when the arguments are equal to null. The new tests are as follows: Push null onto the Stack and verify that IsEmpty returns false.  Push null onto the Stack, Pop the Stack, and verify that the value returned is  null. Push null onto the Stack, call Top, and verify that the value returned is null. 
  • 30. WHY DON’T YOU DO TDD, STILL Why, when TDD was born a decade ago?  The one and only reason: #1: Learning curve…  So why am I telling you this today?  Something happened in the last year… 
  • 31. TECHNIQUES YOU NEEDED TO KNOW ABOUT Interfaces  Dependency Injection  Test Doubles (Mock Objects)  Mocking Framework.  The builder and fluent interface patterns.  …  Not a chance – you still need to know about:  Refactoring
  • 32. THE OLD WAY VS THE NEW WAY Either (the old way) “Mock” Using Interfaces, Dependency Injection and Test Doubles (Mock Objects) Or (the new way) “Isolate” and “Fake” Using Typemock Isolator and AAA - The quot;Arrange-act-assertquot; pattern
  • 33. WHY “ISOLATE” AND / OR “FAKE” AT ALL … when you can hand-write mocks yourself. ASP.NET MVC example
  • 34. WHY “ISOLATE” AND / OR “FAKE” AT ALL … when you can hand-write mocks yourself. ASP.NET MVC  AccountControllerTest file contains 25 tests.  It's a waste of time. The mocking code starts at line 376 and goes on until line 668 (the end of  the file). That's using an isolation frameworkit contains logic. Start 293 lines of mocking code, some of now. Rewriting all this with Isolator code  Ends at line 392  I'll let you do the math.  I wrote mock code like that before. Can you believe my mocking code  even contained bugs? I had to fix those as well.
  • 35. WHY BUY WHEN YOU CAN GET IT FOR FREE Typemock (Commercial) vs. other frameworks.  The quot;freequot; products are not called free, they are open-source projects.  They are built in most cases by a single person, and maintained by the  community if they are successful. There's a lot of effort and love put into that. What's the return? There's the  great satisfaction someone finds your software useful (Hey, that also goes for commercial products). Ayende, creator of Rhino Mocks and Daniel, creator of Moq, put a lot of  hours into feature requests and support, but there's a limit to what they can do. Take a look at Ayende's slogan on his blog: quot;Send me a patch for thisquot;.  Don't be a whiner. Take responsibility. Compare the good, bad and ugly.  And pick what is right for you, not because it's what you can afford, but for what it will save you, give you back or help you outperform your competitors. Of course you get what you pay for (Nothing + More nothing = Nothing). 
  • 36. TYPEMOCK™ Established 2005, privately owned  Typemock Isolator  Thousands of customers (Fortune 500)  Tens of thousands licenses sold 
  • 37. TYPEMOCK.NET HISTORY The Typemock Isolator product supports three sets of  API in order to fake dependencies: Reflective Mocks  String based API (Oldest framework).  Natural Mocks  Record-Replay but strongly typed (Old framework).  Typemock Isolator  Arrange Act Assert (AAA) Syntax (Latest API version - you are encouraged  to use this).
  • 38. ARRANGE ACT ASSERT (AAA) The “Arrange-act-assert” pattern in the field of mock  frameworks represents us trying to return to basics. Moq did that nicely by showing a way that leads  there, and it is being taken gladly by Rhino and Typemock Isolator. AAA is guidance because there was an outcry (a  silent, vote of feet) that record-replay is not cutting it – it’s too confusing for non-experts. It’s too technical. and it does not lend itself to the way people want to work. So most people didn’t use it.
  • 42. TOP FIVE EXCUSES FOR NOT UNIT TESTING I don’t have time to unit test. 1. The client pays me to develop code, not write unit 2. test. I am supporting a legacy application without unit 3. tests. QA and User Acceptance Testing is far more 4. effective in finding bugs. I don’t know how to unit test, or I don’t know how to 5. write good unit tests.
  • 43. WHEN DO YOU THINK YOU'LL INTRODUCE UNIT TESTING A common answer to this question:  quot;We're in a middle of a project right now. We'll wait two months until it  completes, then we'll have timequot;. If you gave me this answer, I won't believe you. Here's  why: If I came to you in two months and asked what has changed since last  time, you'll give me the same answer. That's because development is always done under  pressure.
  • 44. WHEN DO YOU THINK YOU'LL INTRODUCE UNIT TESTING In two months time, you'll be up to your neck in fixing  bugs, running away from QA reports. You'll fix those bugs, and eat away at the time you thought you'd have when the project completes. And when it does complete (late), and you think it's over, you'll start receiving bug reports from the customer. Guess what? no time to start unit testing then either. Let's face it, there is never a good time to start unit-  testing, or making any change, for that matter. So, start today. Write your first unit tests. Change is painful, and you'd rather delay that. But in agile, we say: if it's painful, do it first.
  • 45. TEST CODE IS JUST CODE - COMMON TRAPS Some Anti-Patterns to avoid and some techniques for  making sure Test Code doesn't slow you down: Cut & Paste  Refactor test code  Poor Encapsulation  The builder and fluent interface patterns are very useful here  Bloated SetUp  Isolation framework / Dependency Injection and Test Doubles  Too hard to write the Test  Refactor production code  Code Integration Test Pain  Remember Integration Testing as well 
  • 46. CLASSICISTS V MOCKIST V ISOLATOR Classicists   The classical TDD style isdoes White-box Integrationa double if it's The Classicists to use real objects if possible and testing awkward to use the real thing. So a classical TDDer would use a real First generation TDD warehouse and a double for the mail service. The kind of double doesn't really matter that much. Mockist  A mockist TDD practitioner, however, will always use a mock for any object  The Mockist does White-box Unit testing with interesting behavior. In this case for both the warehouse and the mail Sencond generation TDD service. Isolator and Fake   An isolator TDD practitioner, will always “isolate” or “fake” any object with The Isolator and Fake does Black-box Unit testing interesting behavior. In this case for both the warehouse and the mail Third generation TDD service.
  • 47. INTRODUCING BDD Behaviour-Driven Development (BDD)  By Dan North  BDD is another variation on TDD that tends to use mockist testing  Test method names should be sentences  A simple sentence template keeps test methods focused  This sentence template – The class should do something – means you can only  define a test for the current class. This keeps you focused. If you find yourself writing a test whose name doesn’t fit this template, it suggests the behaviour may belong elsewhere. An expressive test name is helpful when a test fails  “Behaviour” is a more useful word than “test”.  Determine the next most important behaviour.  Requirements are behaviour, too.  BDD provides a “ubiquitous language” for analysis.  Acceptance criteria should be executable. 
  • 48. WHEN TO USE TDD/BDD When you have to implement a new functional  requirement, or make a requirement up yourself. Note: When you want to change existing code, first  write covering Unit Tests (white box testing). Then use TDD to add new functionality.
  • 49. TOOLS YOU NEED TO KNOW ABOUT Continuous Integration Build Automation Tools  MSBuild  Nant  FinalBuilder CI Servers  Team System / Team Foundation Server  TeamCity (R#)  CCnet (CruiseControl.NET)  FinalBuilder Server
  • 50. TOOLS YOU NEED TO KNOW ABOUT Visual Studio Integration Refactoring  R# (ReSharper)  Code Rush
  • 51. TOOLS YOU NEED TO KNOW ABOUT Isolation / Mocking Frameworks for .net Open Source  Rhino Mocks for .NET  NMock for .NET  Moq for .Net Commercial (costs money but worth it)  Typemock Isolator  Typemock Isolator For SharePoint
  • 52. Where to go from here
  • 53. WHERE TO GO FROM HERE You don’t have to start big  Start new tasks with TDD  Add Tests to code that you need to change or  maintain – but only to small parts Proof of concept  If it's worth building, it's worth testing. If it's not worth testing, why are you wasting your time working on it?
  • 54. LINKS Books  Test-Driven Development in Microsoft® .NET (http://www.amazon.co.uk/gp/product/0735619484)  Test-Driven Development by Kent Beck (C++) (http://www.amazon.co.uk/gp/product/0321146530)  Blog  The Typemock Insider Blog (http://blog.typemock.com/)  Unit test study from Microsoft Research:  http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf  Typemock  http://www.typemock.com/  Unit testing Silverlight:  http://www.codeplex.com/CThru  Other links:  http://en.wikipedia.org/wiki/Test-driven_development  http://www.testdriven.com/  http://www.mockobjects.com/ - Online TDD book: http://www.mockobjects.com/book/index.html  http://www.martinfowler.com/articles/mocksArentStubs.html  http://dannorth.net/introducing-bdd  http://behaviour-driven.org/Introduction 
  • 55. Q&A