SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
AMIR BARYLKO
                                    TDD
                                   INTRO



                            ONLINE BUSINESS SYSTEMS
                                    APRIL 2011

Amir Barylko - OBS Apr ‘11                            MavenThought Inc.
Wednesday, April 27, 2011
WHO AM I?

    • Quality               Expert

    • Architect

    • Developer

    • Mentor

    • Great             cook

    • The           one who’s entertaining you for the next hour!
Amir Barylko - OBS Apr ‘11                                          MavenThought Inc.
Wednesday, April 27, 2011
RESOURCES

    • Email: amir@barylko.com

    • Twitter: @abarylko

    • Blog: http://www.orthocoders.com

    • Materials: http://www.orthocoders.com/presentations




Amir Barylko - OBS Apr ‘11                              MavenThought Inc.
Wednesday, April 27, 2011
TDD TRAINING

    • When: May             26 & 27

    • More             info: http://www.maventhought.com

    • Goal: Learn TDD          with real hands on examples




Amir Barylko - OBS Apr ‘11                                   MavenThought Inc.
Wednesday, April 27, 2011
INTRO
                             Why projects fail?
                              Reality Check
                             No more excuses
                               Why TDD?



Amir Barylko - OBS Apr ‘11                        MavenThought Inc.
Wednesday, April 27, 2011
WHY PROJECTS FAIL?

    • Delivering               late or over budget
    • Delivering               the wrong thing
    • Unstable                in production
    • Costly                to maintain


Amir Barylko - OBS Apr ‘11                           MavenThought Inc.
Wednesday, April 27, 2011
REALITY CHECK

    • It  is impossible to gather all the requirements at
        the beginning of a project.
    • Whatever    requirements you do gather are
        guaranteed to change.
    • There  will always be more to do than time and
        money will allow.

Amir Barylko - OBS Apr ‘11                        MavenThought Inc.
Wednesday, April 27, 2011
NO MORE EXCUSES

    • It     works on my computer!   • We need a satellite
                                      connection in order to
    • It  was like that when I got    run it!
        here!
                                     • We can’t reproduce the
    • The    previous developer       error!
        didn’t know XXXX!
                                     • We   can’t test that!


Amir Barylko - OBS Apr ‘11                                MavenThought Inc.
Wednesday, April 27, 2011
WHY TDD?

    • Prove                 that your code     • Regression   tests as
        works                                   byproduct
    • Avoid   waste                            • Makechanges with
        (debugging)                             confidence
    • Increment                 code quality   • Bring
                                                     back the joy of
                                                coding!
    • Better                design
Amir Barylko - OBS Apr ‘11                                       MavenThought Inc.
Wednesday, April 27, 2011
APPLYING TDD
                                  Iteration 0 .. N
                                Quality as a Driver
                              Red - Green - Refactor




Amir Barylko - OBS Apr ‘11                             MavenThought Inc.
Wednesday, April 27, 2011
ITERATION 0

    • Flush           out architecture.

    • Setup Testing            harness for TDD and BDD.

    • Setup             continuous integration.

    • Setup             scripts to build, deploy, etc.

    • Setup             visual communication tools.


Amir Barylko - OBS Apr ‘11                                MavenThought Inc.
Wednesday, April 27, 2011
ITERATION 1.. N
    • Start           by Story Planning

         • Pair         programming (switching often)   Every day!

         • Daily            Scrum

    • End          with Retrospective




Amir Barylko - OBS Apr ‘11                                      MavenThought Inc.
Wednesday, April 27, 2011
QUALITY AS A DRIVER
                                           Red
                                           BDD

                                           Red




        Refactor                Refactor   TDD   Green   Green




Amir Barylko - OBS Apr ‘11                                 MavenThought Inc.
Wednesday, April 27, 2011
RED

    •Write                  a test that fails
    •Relax, is                ok if it compiles




Amir Barylko - OBS Apr ‘11                        MavenThought Inc.
Wednesday, April 27, 2011
GREEN

    • Try            to make the test pass
    • Do             a simple solution
    • Use              default values (not throwing exceptions)
    • Don’t                 worry if the code “smells”


Amir Barylko - OBS Apr ‘11                                 MavenThought Inc.
Wednesday, April 27, 2011
REFACTOR

    • Avoid                 repeating code
    • Avoid                 hardcoding dependencies
    • Avoid “write                only” code
    • Refactor                with confidence!
    • Run              all tests if possible
Amir Barylko - OBS Apr ‘11                            MavenThought Inc.
Wednesday, April 27, 2011
DEMO
                             Unit Testing Frameworks
                              Given - When - Then
                                 Listing Contents
                                      Reviews



Amir Barylko - OBS Apr ‘11                             MavenThought Inc.
Wednesday, April 27, 2011
TESTING FRAMEWORKS

    • MsTest, xUnit, nUnit, MbUnit, MSpec

    • Similar “hooks”

         • Before           and after test

         • Before           and after all test

         • Arrange, Act, Assert



Amir Barylko - OBS Apr ‘11                       MavenThought Inc.
Wednesday, April 27, 2011
GIVEN WHEN THEN

    • Test          one “scenario” at a time

    • Clear            identification of functionality

    • Easy           to write, understand and maintain

    • Repeatable, easy            to learn	





Amir Barylko - OBS Apr ‘11                               MavenThought Inc.
Wednesday, April 27, 2011
LISTING CONTENTS

    • Controller “Movies” method “Index”

    • Two            scenarios

         • Given            I have no movies....

         • Given            I have the following movies....

    • Where                 do I get the movies from?


Amir Barylko - OBS Apr ‘11                                    MavenThought Inc.
Wednesday, April 27, 2011
GIVEN I HAVE NO MOVIES
    [It]
    public void Should_not_return_any_movies()
    {
         var result = (ViewResult)this.ActualResult;

             var actual = (IEnumerable<IMovie>) result.ViewData.Model;

             actual.Should().Be.Empty();
    }

    [It]
    public void Should_render_the_index_view()
    {
         this.ActualResult.AssertViewRendered();
    }


Amir Barylko - OBS Apr ‘11                                               MavenThought Inc.
Wednesday, April 27, 2011
GIVEN I HAVE 10 MOVIES
    [It]
    public void Should_return_all_the_movies()
    {
         var result = (ViewResult)this.ActualResult;

              var actual = (IEnumerable<IMovie>) result.ViewData.Model;

              actual.Should().Have.SameValuesAs(this._movies);
    }




Amir Barylko - OBS Apr ‘11                                        MavenThought Inc.
Wednesday, April 27, 2011
ARE WE DONE?

    • Fail            1: IMovieLibrary is not registered in the container

    • Fail            2: SimpleMovieLibrary needs the db name

    • How             can we make sure it works?

    • Is TDD                enough?




Amir Barylko - OBS Apr ‘11                                            MavenThought Inc.
Wednesday, April 27, 2011
FIX THE CONTAINER

    Component
      .For<IMovieLibrary>()
      .Instance(new SimpleMovieLibrary(dbFile))...




Amir Barylko - OBS Apr ‘11                      MavenThought Inc.
Wednesday, April 27, 2011
SAFETY NET
    Scenario: Browse available movies
         Given I have the following movies:
              | title             |
              | Blazing Saddles |
              | Space Balls       |
         When I go to "Movies"
         Then I should see in the listing:
              | title                 |
              | Blazing Saddles       |
              | Space Balls           |




Amir Barylko - OBS Apr ‘11                    MavenThought Inc.
Wednesday, April 27, 2011
SUMMARY
                               Benefits
                              Challenges
                              Adoption




Amir Barylko - OBS Apr ‘11                 MavenThought Inc.
Wednesday, April 27, 2011
BENEFITS

    • Let           the methodology drive
    • It      will save your bacon!
    • High                  quality the whole way!
    • Very                  few bugs!
    • Do             your duty as developer!
Amir Barylko - OBS Apr ‘11                           MavenThought Inc.
Wednesday, April 27, 2011
CHALLENGES

    • Very             different from conventional testing
    • Many                  developers find it complex to learn at first
    • Hard              to start without a Mentor
    • Management                   buy in
    • Difficult                to keep under deadline pressure
    • Beware                  of code coverage!
Amir Barylko - OBS Apr ‘11                                           MavenThought Inc.
Wednesday, April 27, 2011
ADOPTION

    • Find           Mentor/Couch/Trainer
    • Small             iterations
    • Have              metrics ready (velocity, etc)
    • Do           whatever works for you
    • Find           out which tools will benefit you
    • Automate,                  automate, automate!
Amir Barylko - OBS Apr ‘11                              MavenThought Inc.
Wednesday, April 27, 2011
QUESTIONS?




Amir Barylko - .NET UG Mar ‘11                MavenThought Inc.
Wednesday, April 27, 2011
RESOURCES

    • Email: amir@barylko.com

    • Twitter: @abarylko

    • Slides: http://www.orthocoders.com/presentations




Amir Barylko - OBS Apr ‘11                               MavenThought Inc.
Wednesday, April 27, 2011
RESOURCES II




Amir Barylko - OBS Apr ‘11                  MavenThought Inc.
Wednesday, April 27, 2011
TDD TRAINING

    • When: May             26 & 27

    • More             info: http://www.maventhought.com

    • Goal: Learn TDD          with real hands on examples




Amir Barylko - OBS Apr ‘11                                   MavenThought Inc.
Wednesday, April 27, 2011

Weitere ähnliche Inhalte

Andere mochten auch

TDD Boot Camp Sapporo 1.5
TDD Boot Camp Sapporo 1.5 TDD Boot Camp Sapporo 1.5
TDD Boot Camp Sapporo 1.5 Shuji Watanabe
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentConsulthinkspa
 
VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)Rob Hale
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web developmentAmir Barylko
 
TDD for the Newb Who Wants to Become an Apprentice
TDD for the Newb Who Wants to Become an ApprenticeTDD for the Newb Who Wants to Become an Apprentice
TDD for the Newb Who Wants to Become an ApprenticeHoward Deiner
 
Pitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiPitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiAgileee
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep diveAmir Barylko
 

Andere mochten auch (9)

TDD Boot Camp Sapporo 1.5
TDD Boot Camp Sapporo 1.5 TDD Boot Camp Sapporo 1.5
TDD Boot Camp Sapporo 1.5
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 
TDD for the Newb Who Wants to Become an Apprentice
TDD for the Newb Who Wants to Become an ApprenticeTDD for the Newb Who Wants to Become an Apprentice
TDD for the Newb Who Wants to Become an Apprentice
 
Pitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz BankowskiPitfalls Of Tdd Adoption by Bartosz Bankowski
Pitfalls Of Tdd Adoption by Bartosz Bankowski
 
No estimates
No estimatesNo estimates
No estimates
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep dive
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 

Ähnlich wie obs-tdd-intro

Codemash-iron-ruby-match-made-in-heaven
Codemash-iron-ruby-match-made-in-heavenCodemash-iron-ruby-match-made-in-heaven
Codemash-iron-ruby-match-made-in-heavenAmir Barylko
 
Quality web-acceptance
Quality web-acceptanceQuality web-acceptance
Quality web-acceptanceAmir Barylko
 
Is Advanced Verification for FPGA based Logic needed
Is Advanced Verification for FPGA based Logic neededIs Advanced Verification for FPGA based Logic needed
Is Advanced Verification for FPGA based Logic neededchiportal
 
High quality iOS development
High quality iOS developmentHigh quality iOS development
High quality iOS developmentRobin Lu
 
Atlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide DeckAtlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide DeckAtlassian
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)zeeg
 
Mozilla: Continuous Deploment on SUMO
Mozilla: Continuous Deploment on SUMOMozilla: Continuous Deploment on SUMO
Mozilla: Continuous Deploment on SUMOMatt Brandt
 
MDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make somethingMDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make somethingBoulder Digital Works at CU
 
David Mytton, Boxed Ice
David Mytton, Boxed Ice   David Mytton, Boxed Ice
David Mytton, Boxed Ice Mashery
 
PRDC11-Jruby-ironruby
PRDC11-Jruby-ironrubyPRDC11-Jruby-ironruby
PRDC11-Jruby-ironrubyAmir Barylko
 
Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011Atlassian
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackabilityPuppet
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Leonardo Borges
 
ExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias Sociais
ExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias SociaisExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias Sociais
ExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias SociaisDOGSCAMP Summit
 
Journey to 1000 tests a day
Journey to 1000 tests a dayJourney to 1000 tests a day
Journey to 1000 tests a dayBruce McLeod
 
Devopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the UnionDevopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the UnionJohn Willis
 

Ähnlich wie obs-tdd-intro (20)

agile-planning
agile-planningagile-planning
agile-planning
 
Codemash-iron-ruby-match-made-in-heaven
Codemash-iron-ruby-match-made-in-heavenCodemash-iron-ruby-match-made-in-heaven
Codemash-iron-ruby-match-made-in-heaven
 
Quality web-acceptance
Quality web-acceptanceQuality web-acceptance
Quality web-acceptance
 
Iterations-zero-n
Iterations-zero-nIterations-zero-n
Iterations-zero-n
 
Is Advanced Verification for FPGA based Logic needed
Is Advanced Verification for FPGA based Logic neededIs Advanced Verification for FPGA based Logic needed
Is Advanced Verification for FPGA based Logic needed
 
High quality iOS development
High quality iOS developmentHigh quality iOS development
High quality iOS development
 
Atlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide DeckAtlassian RoadTrip 2011 Slide Deck
Atlassian RoadTrip 2011 Slide Deck
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)
 
Mozilla: Continuous Deploment on SUMO
Mozilla: Continuous Deploment on SUMOMozilla: Continuous Deploment on SUMO
Mozilla: Continuous Deploment on SUMO
 
MDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make somethingMDW Boulder April '11 | Tim Malbon_How to actually make something
MDW Boulder April '11 | Tim Malbon_How to actually make something
 
Godoggo
GodoggoGodoggo
Godoggo
 
David Mytton, Boxed Ice
David Mytton, Boxed Ice   David Mytton, Boxed Ice
David Mytton, Boxed Ice
 
why-tdd
why-tddwhy-tdd
why-tdd
 
PRDC11-Jruby-ironruby
PRDC11-Jruby-ironrubyPRDC11-Jruby-ironruby
PRDC11-Jruby-ironruby
 
Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackability
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011)
 
ExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias Sociais
ExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias SociaisExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias Sociais
ExpOn 2011 - Diego Monteiro - Níveis de Maturidade nas Mídias Sociais
 
Journey to 1000 tests a day
Journey to 1000 tests a dayJourney to 1000 tests a day
Journey to 1000 tests a day
 
Devopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the UnionDevopsdays Goteborg 2011 - State of the Union
Devopsdays Goteborg 2011 - State of the Union
 

Mehr von Amir Barylko

Functional converter project
Functional converter projectFunctional converter project
Functional converter projectAmir Barylko
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting trainingAmir Barylko
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessAmir Barylko
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6Amir Barylko
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?Amir Barylko
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideAmir Barylko
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityAmir Barylko
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilitiesAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
Rich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; CoffeescriptRich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; CoffeescriptAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integrationAmir Barylko
 

Mehr von Amir Barylko (20)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting training
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomeness
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6
 
Productive teams
Productive teamsProductive teams
Productive teams
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other side
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivity
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Refactoring
RefactoringRefactoring
Refactoring
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilities
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
Rich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; CoffeescriptRich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; Coffeescript
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescript
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 

Kürzlich hochgeladen

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Kürzlich hochgeladen (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

obs-tdd-intro

  • 1. AMIR BARYLKO TDD INTRO ONLINE BUSINESS SYSTEMS APRIL 2011 Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 2. WHO AM I? • Quality Expert • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour! Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 3. RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Blog: http://www.orthocoders.com • Materials: http://www.orthocoders.com/presentations Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 4. TDD TRAINING • When: May 26 & 27 • More info: http://www.maventhought.com • Goal: Learn TDD with real hands on examples Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 5. INTRO Why projects fail? Reality Check No more excuses Why TDD? Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 6. WHY PROJECTS FAIL? • Delivering late or over budget • Delivering the wrong thing • Unstable in production • Costly to maintain Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 7. REALITY CHECK • It is impossible to gather all the requirements at the beginning of a project. • Whatever requirements you do gather are guaranteed to change. • There will always be more to do than time and money will allow. Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 8. NO MORE EXCUSES • It works on my computer! • We need a satellite connection in order to • It was like that when I got run it! here! • We can’t reproduce the • The previous developer error! didn’t know XXXX! • We can’t test that! Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 9. WHY TDD? • Prove that your code • Regression tests as works byproduct • Avoid waste • Makechanges with (debugging) confidence • Increment code quality • Bring back the joy of coding! • Better design Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 10. APPLYING TDD Iteration 0 .. N Quality as a Driver Red - Green - Refactor Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 11. ITERATION 0 • Flush out architecture. • Setup Testing harness for TDD and BDD. • Setup continuous integration. • Setup scripts to build, deploy, etc. • Setup visual communication tools. Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 12. ITERATION 1.. N • Start by Story Planning • Pair programming (switching often) Every day! • Daily Scrum • End with Retrospective Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 13. QUALITY AS A DRIVER Red BDD Red Refactor Refactor TDD Green Green Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 14. RED •Write a test that fails •Relax, is ok if it compiles Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 15. GREEN • Try to make the test pass • Do a simple solution • Use default values (not throwing exceptions) • Don’t worry if the code “smells” Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 16. REFACTOR • Avoid repeating code • Avoid hardcoding dependencies • Avoid “write only” code • Refactor with confidence! • Run all tests if possible Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 17. DEMO Unit Testing Frameworks Given - When - Then Listing Contents Reviews Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 18. TESTING FRAMEWORKS • MsTest, xUnit, nUnit, MbUnit, MSpec • Similar “hooks” • Before and after test • Before and after all test • Arrange, Act, Assert Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 19. GIVEN WHEN THEN • Test one “scenario” at a time • Clear identification of functionality • Easy to write, understand and maintain • Repeatable, easy to learn Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 20. LISTING CONTENTS • Controller “Movies” method “Index” • Two scenarios • Given I have no movies.... • Given I have the following movies.... • Where do I get the movies from? Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 21. GIVEN I HAVE NO MOVIES [It] public void Should_not_return_any_movies() { var result = (ViewResult)this.ActualResult; var actual = (IEnumerable<IMovie>) result.ViewData.Model; actual.Should().Be.Empty(); } [It] public void Should_render_the_index_view() { this.ActualResult.AssertViewRendered(); } Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 22. GIVEN I HAVE 10 MOVIES [It] public void Should_return_all_the_movies() { var result = (ViewResult)this.ActualResult; var actual = (IEnumerable<IMovie>) result.ViewData.Model; actual.Should().Have.SameValuesAs(this._movies); } Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 23. ARE WE DONE? • Fail 1: IMovieLibrary is not registered in the container • Fail 2: SimpleMovieLibrary needs the db name • How can we make sure it works? • Is TDD enough? Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 24. FIX THE CONTAINER Component .For<IMovieLibrary>() .Instance(new SimpleMovieLibrary(dbFile))... Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 25. SAFETY NET Scenario: Browse available movies Given I have the following movies: | title | | Blazing Saddles | | Space Balls | When I go to "Movies" Then I should see in the listing: | title | | Blazing Saddles | | Space Balls | Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 26. SUMMARY Benefits Challenges Adoption Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 27. BENEFITS • Let the methodology drive • It will save your bacon! • High quality the whole way! • Very few bugs! • Do your duty as developer! Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 28. CHALLENGES • Very different from conventional testing • Many developers find it complex to learn at first • Hard to start without a Mentor • Management buy in • Difficult to keep under deadline pressure • Beware of code coverage! Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 29. ADOPTION • Find Mentor/Couch/Trainer • Small iterations • Have metrics ready (velocity, etc) • Do whatever works for you • Find out which tools will benefit you • Automate, automate, automate! Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 30. QUESTIONS? Amir Barylko - .NET UG Mar ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 31. RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Slides: http://www.orthocoders.com/presentations Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 32. RESOURCES II Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011
  • 33. TDD TRAINING • When: May 26 & 27 • More info: http://www.maventhought.com • Goal: Learn TDD with real hands on examples Amir Barylko - OBS Apr ‘11 MavenThought Inc. Wednesday, April 27, 2011