SlideShare a Scribd company logo
Open Source Jumpstart:
 Improve your development
           Skills




©LeanAgileMachine
Creative Commons License
Graduate Developer
                 Community


                           Meet with Companies
 www.grad-dc.co.uk         looking for interns
                    Talk to experienced
 blog.grad-dc.co.uk developers & testers
                           Ask questions about
                           what you learnt
                           tonight
©LeanAgileMachine
Creative Commons License   Socialse
Goals of OS Jumpstart

 ●   What tools are out there
 ●   What should you know
 ●   Show how Unit Testing tools support the agile
     process




©LeanAgileMachine
Creative Commons License
Goals of this session
 ●   Understand the value of TDD
 ●   Give you confidence to start learning TDD
 ●   Tools to use to start learning
     ●   I cant teach you TDD in one evening, sorry!
     ●   TDD is as big as learning something like OO
 ●   A bit of practical experience
     ●   Pair up and try it out
 ●   Deliberate practice
©LeanAgileMachine
Creative Commons License
Have you tried ”Test First” ?

  Raise your hand if you already tried TDD and
  ”test first” development ?




©LeanAgileMachine
Creative Commons License
Where does TDD fit




©LeanAgileMachine
Creative Commons License
So what is TDD ??




©LeanAgileMachine
Creative Commons License
A design activity
 ●   What is the challenge (the requirements)
 ●   What are the concepts we are dealing with
 ●   What is valuable
 ●   What behaviour do I need to understand
 ●   How do I know I have met the challenge
 ●   How do I know I can change



©LeanAgileMachine
Creative Commons License
Understanding the problem
 ●   Behaviour
 ●   Concepts
 ●   Stakeholders
 ●   Values
 ●   Priorities




©LeanAgileMachine
Creative Commons License
The TDD cycle
 ●   Write a failing test so
     we know it tests
     something
 ●   Write code to make
     the test pass
 ●   Refactor code to be
     as simple as possible



©LeanAgileMachine
Creative Commons License
Continuous / Fast Feedback
●   Are we there yet ?
●   Your own ”mini-me” tester as a guide
    ●   Only scratching the surface of testing though




©LeanAgileMachine
Creative Commons License
What tools are involved




                           Jenkins CI

©LeanAgileMachine
Creative Commons License
Anatomy of a test




©LeanAgileMachine
Creative Commons License
Make the test compile




©LeanAgileMachine
Creative Commons License
Write a class




©LeanAgileMachine
Creative Commons License
Common assertions
 ●   assertEquals()
     ●   Two objects of the same type are equal in value
 ●   assertNotNull()
     ●   The object does not have a null value
 ●   assertTrue()
     ●   The statement results is a true evaluation
 ●   assertSame()
     ●   Two objects are the same
  http://junit.sourceforge.net/javadoc/org/junit/Assert.html

©LeanAgileMachine
Creative Commons License
JUnit Annotations
●   @Test
                                                  ●   @Ignore
     ●    Defines a method as a test
                                                      ●   Dont run this
●   @Test(expected=exception.class)                       test – use
     ●    Fails if a specific exception is no             sparingly
          thrown
●   @Test(timeout = 1000)
     ●    Fails if test takes too long
          (milliseconds)
         http://junit.sourceforge.net/javadoc/org/junit/Test.html
    ©LeanAgileMachine
    Creative Commons License
Test ”smells”
 ●   Testing code rather
     than behaviour             ●   Multiple assertions
     ●   Too specific               per method
     ●   Changing tests every       ●   Bloated tests
         time you refactor          ●   Harder to refactor
                                    ●   Addressing to many
                                        scenarios
                                    ●   Harder to understand
                                        and maintain

©LeanAgileMachine
Creative Commons License
A bad test example
    @Test
    public void equalsCheck() {
      System.out.println("* VectorsJUnit4Test: equalsCheck()");
      assertTrue(Vectors.equal(new int[] {}, new int[] {}));
      assertTrue(Vectors.equal(new int[] {0}, new int[] {0}));
      assertTrue(Vectors.equal(new int[] {0, 0}, new int[] {0, 0}));
      assertTrue(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 0, 0}));
      assertTrue(Vectors.equal(new int[] {5, 6, 7}, new int[] {5, 6, 7}));

        assertFalse(Vectors.equal(new int[] {}, new int[] {0}));
        assertFalse(Vectors.equal(new int[] {0}, new int[] {0, 0}));
        assertFalse(Vectors.equal(new int[] {0, 0}, new int[] {0, 0, 0}));
        assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 0}));
        assertFalse(Vectors.equal(new int[] {0, 0}, new int[] {0}));
        assertFalse(Vectors.equal(new int[] {0}, new int[] {}));

        assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 0, 1}));
        assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 1, 0}));
        assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {1, 0, 0}));
        assertFalse(Vectors.equal(new int[] {0, 0, 1}, new int[] {0, 0, 3}));
    }
©LeanAgileMachine
Creative Commons License
Quick Netbeans / JUnit demo

       - create a new project
       - create your first test
       - run the JUnit testrunner
       - write code to fix the test
       - run the JUnit testrunner
       - write another test...


©LeanAgileMachine
Creative Commons License
Your turn
                       - pair up
                - fire up netbeans
     - start a new Java Application project
            - or check out my project
         - read the basic requirements
                   - write a test...



©LeanAgileMachine
Creative Commons License
Deliberate practice
●   Goal is to practice TDD
    ●   Become comfortable with the tools
    ●   Gain experience in writing tests
    ●   Improve confidence in TDD



●   The resulting code algorithms are not important
    ●   I dont care how fast your calculator calculates
    ●   You're here to learn not to produce
©LeanAgileMachine
Creative Commons License
Hamcrest asserts
 ●   Hamcrest is a pattern matching library
     ●   Can help make you test logic more human readable

      AssertThat() - instead of JUnit asserts

     assertThat(myCalc.addTwoNumbers(6, 7),
             is(6 + 7));

     assertThat(myCalc.addTwoNumbers(6, 7),
             is(not(6 + 9)));

©LeanAgileMachine
Creative Commons License
Build Tools
 ●   Build Automation
     ●   Compile, test and deploy code
         from your repository

                                   Ant.apache.org
                                   ant.apache.org/ivy

                                   Maven.apache.org

                                   Comparison of tools:
                                     http://ant.apache.org/ivy/
                                     m2comparison.html
©LeanAgileMachine
Creative Commons License
Integrated Development
                     Environments
●   Manage large / multiple projects
    ●   Debugger
    ●   Autocompletion (code api completion)
    ●   Refactoring                                                .org
●   Build management
        Ant / Maven – compile, test, deploy
                                                                  .org
    ●


●   Integration
    ●   Application servers, databases, unit testing,
        Scm, bug tracker, CI server,                    IntelliJ IDEA
                                                        jetbrains.org


©LeanAgileMachine
Creative Commons License
Keep the build bunny happy
●   Tests help prevent
    build errors

●   You can run your
    tests before you
    anger the build
    bunny




©LeanAgileMachine
Creative Commons License
Collaborative workspace
 ●   Can show progress of your
     tests
                                 Confluence
 ●   Show you which tests are
     failing
 ●   Gives everyone a sence of
     progress




©LeanAgileMachine
Creative Commons License
Summary
 ●   TDD is a design activity
     ●   Gives you time to use your brain before coding
 ●   This session was just enough to get you going
 ●   Try doing some coding kata
 ●   Try a coding dojo or code retreat
     ●   LJC / GDC organising these soon !
     ●   Monthly Python, Clojure, Scala dojos aready
         running

©LeanAgileMachine
Creative Commons License
We want your feedback




©LeanAgileMachine
Creative Commons License
Graduate Developer
                 Community
www.grad-dc.co.uk
                           Meet with Companies
blog.grad-dc.co.uk         looking for interns
                           Talk to experienced
                           developers & testers
                           Ask questions about
                           what you learnt
                           tonight
                           Socialse
©LeanAgileMachine
Creative Commons License
TDD / BDD Workshop
 ●
     Half day workshop at SkillsMatter 17 th May
     ●   Part of London Tester Gathering days



     http://bit.ly/LTGDays2011



©LeanAgileMachine
Creative Commons License
Thank you
Useful links
John@jr0cket.com
John.Jr0cket.co.uk
Toolingup.Jr0cket.co.uk
Ubuntu.Jr0cket.co.uk
                                Growing OO Software,
www.grad-dc.co.uk               guided by tests
blog.grad-dc.co.uk

 ©LeanAgileMachine
 Creative Commons License

More Related Content

What's hot

Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy Code
Adam Culp
 
Angular Unit Test
Angular Unit TestAngular Unit Test
Angular Unit Test
Michael Haberman
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
Jason Harmon
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testing
markstory
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
Charles Nurse
 
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Kaunas Java User Group
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
Tung Nguyen Thanh
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
Excella
 
Working with Legacy Code
Working with Legacy CodeWorking with Legacy Code
Working with Legacy Code
Eyal Golan
 
Adding Unit Test To Legacy Code
Adding Unit Test To Legacy CodeAdding Unit Test To Legacy Code
Adding Unit Test To Legacy Code
Terry Yin
 
Acceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And FriendsAcceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And Friends
Christopher Bartling
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven TestingMaveryx
 
Automated tests to a REST API
Automated tests to a REST APIAutomated tests to a REST API
Automated tests to a REST API
Luís Barros Nóbrega
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
guest5639fa9
 
Serenity-BDD training
Serenity-BDD trainingSerenity-BDD training
Serenity-BDD training
Savvycom Savvycom
 
TDD & BDD
TDD & BDDTDD & BDD
TDD & BDD
Arvind Vyas
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
harinderpisces
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Maris Prabhakaran M
 

What's hot (20)

Refactoring Legacy Code
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy Code
 
Angular Unit Test
Angular Unit TestAngular Unit Test
Angular Unit Test
 
BDD for APIs
BDD for APIsBDD for APIs
BDD for APIs
 
Win at life with unit testing
Win at life with unit testingWin at life with unit testing
Win at life with unit testing
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
 
Automation and Technical Debt
Automation and Technical DebtAutomation and Technical Debt
Automation and Technical Debt
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
 
Working with Legacy Code
Working with Legacy CodeWorking with Legacy Code
Working with Legacy Code
 
Adding Unit Test To Legacy Code
Adding Unit Test To Legacy CodeAdding Unit Test To Legacy Code
Adding Unit Test To Legacy Code
 
Acceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And FriendsAcceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And Friends
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
 
Automated tests to a REST API
Automated tests to a REST APIAutomated tests to a REST API
Automated tests to a REST API
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 
Web tech: lecture 5
Web tech: lecture 5Web tech: lecture 5
Web tech: lecture 5
 
Serenity-BDD training
Serenity-BDD trainingSerenity-BDD training
Serenity-BDD training
 
TDD & BDD
TDD & BDDTDD & BDD
TDD & BDD
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 

Similar to Improve your development skills with Test Driven Development

Open Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up Intro
Skills Matter
 
Agile Days Twin Cities 2011
Agile Days Twin Cities 2011Agile Days Twin Cities 2011
Agile Days Twin Cities 2011
Brian Repko
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
Anatoliy Okhotnikov
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
Peter Kofler
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
Lars Thorup
 
Javascript Unit Testing Tools
Javascript Unit Testing ToolsJavascript Unit Testing Tools
Javascript Unit Testing Tools
PixelCrayons
 
Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-testRoyce Haynes
 
Dot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel TettelarDot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel Tettelar
Giel Tettelaar
 
Continuous delivery - JAX London 2011
Continuous delivery - JAX London 2011Continuous delivery - JAX London 2011
Continuous delivery - JAX London 2011
John Stevenson
 
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
JAX London
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
Baskar K
 
High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering Teams
Lars Thorup
 
Unit testing for ext js apps using sencha test - Walkingtree Technologies
Unit testing for ext js apps using sencha test - Walkingtree TechnologiesUnit testing for ext js apps using sencha test - Walkingtree Technologies
Unit testing for ext js apps using sencha test - Walkingtree Technologies
Walking Tree Technologies
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development Introduction
Nguyen Hai
 
Tasting Your First Test Burger
Tasting Your First Test BurgerTasting Your First Test Burger
Tasting Your First Test Burger
Tautrimas Pajarskas
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integration
haochenglee
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortals
cgack
 
Front end-modernization
Front end-modernizationFront end-modernization
Front end-modernization
devObjective
 
Intro to java test frameworks
Intro to java test frameworksIntro to java test frameworks
Intro to java test frameworks
Lim Sim
 

Similar to Improve your development skills with Test Driven Development (20)

Open Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up Intro
 
Agile Days Twin Cities 2011
Agile Days Twin Cities 2011Agile Days Twin Cities 2011
Agile Days Twin Cities 2011
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
Javascript Unit Testing Tools
Javascript Unit Testing ToolsJavascript Unit Testing Tools
Javascript Unit Testing Tools
 
Django strategy-test
Django strategy-testDjango strategy-test
Django strategy-test
 
Dot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel TettelarDot all 2019 | Testing with Craft | Giel Tettelar
Dot all 2019 | Testing with Craft | Giel Tettelar
 
Continuous delivery - JAX London 2011
Continuous delivery - JAX London 2011Continuous delivery - JAX London 2011
Continuous delivery - JAX London 2011
 
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
Java Tech & Tools | Continuous Delivery - the Writing is on the Wall | John S...
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering Teams
 
Unit testing for ext js apps using sencha test - Walkingtree Technologies
Unit testing for ext js apps using sencha test - Walkingtree TechnologiesUnit testing for ext js apps using sencha test - Walkingtree Technologies
Unit testing for ext js apps using sencha test - Walkingtree Technologies
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development Introduction
 
Tasting Your First Test Burger
Tasting Your First Test BurgerTasting Your First Test Burger
Tasting Your First Test Burger
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integration
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortals
 
Front end-modernization
Front end-modernizationFront end-modernization
Front end-modernization
 
Front end-modernization
Front end-modernizationFront end-modernization
Front end-modernization
 
Intro to java test frameworks
Intro to java test frameworksIntro to java test frameworks
Intro to java test frameworks
 

More from John Stevenson

ClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of Clojure
John Stevenson
 
Confessions of a developer community builder
Confessions of a developer community builderConfessions of a developer community builder
Confessions of a developer community builder
John Stevenson
 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
John Stevenson
 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with Clojurescript
John Stevenson
 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with Clojure
John Stevenson
 
Communication improbable
Communication improbableCommunication improbable
Communication improbable
John Stevenson
 
Getting into public speaking at conferences
Getting into public speaking at conferencesGetting into public speaking at conferences
Getting into public speaking at conferences
John Stevenson
 
Functional web with clojure
Functional web with clojureFunctional web with clojure
Functional web with clojure
John Stevenson
 
Get into Functional Programming with Clojure
Get into Functional Programming with ClojureGet into Functional Programming with Clojure
Get into Functional Programming with Clojure
John Stevenson
 
Guiding people into Clojure
Guiding people into ClojureGuiding people into Clojure
Guiding people into Clojure
John Stevenson
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
John Stevenson
 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with Clojure
John Stevenson
 
So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?
John Stevenson
 
Trailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudTrailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App Cloud
John Stevenson
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
John Stevenson
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
John Stevenson
 
Dreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlDreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version Control
John Stevenson
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
John Stevenson
 
Salesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionSalesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - Introduction
John Stevenson
 
Heroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesHeroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & services
John Stevenson
 

More from John Stevenson (20)

ClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of Clojure
 
Confessions of a developer community builder
Confessions of a developer community builderConfessions of a developer community builder
Confessions of a developer community builder
 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with Clojurescript
 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with Clojure
 
Communication improbable
Communication improbableCommunication improbable
Communication improbable
 
Getting into public speaking at conferences
Getting into public speaking at conferencesGetting into public speaking at conferences
Getting into public speaking at conferences
 
Functional web with clojure
Functional web with clojureFunctional web with clojure
Functional web with clojure
 
Get into Functional Programming with Clojure
Get into Functional Programming with ClojureGet into Functional Programming with Clojure
Get into Functional Programming with Clojure
 
Guiding people into Clojure
Guiding people into ClojureGuiding people into Clojure
Guiding people into Clojure
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with Clojure
 
So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?
 
Trailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudTrailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App Cloud
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
 
Dreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlDreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version Control
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
Salesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionSalesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - Introduction
 
Heroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesHeroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & services
 

Recently uploaded

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 

Recently uploaded (20)

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

Improve your development skills with Test Driven Development

  • 1. Open Source Jumpstart: Improve your development Skills ©LeanAgileMachine Creative Commons License
  • 2. Graduate Developer Community Meet with Companies www.grad-dc.co.uk looking for interns Talk to experienced blog.grad-dc.co.uk developers & testers Ask questions about what you learnt tonight ©LeanAgileMachine Creative Commons License Socialse
  • 3. Goals of OS Jumpstart ● What tools are out there ● What should you know ● Show how Unit Testing tools support the agile process ©LeanAgileMachine Creative Commons License
  • 4. Goals of this session ● Understand the value of TDD ● Give you confidence to start learning TDD ● Tools to use to start learning ● I cant teach you TDD in one evening, sorry! ● TDD is as big as learning something like OO ● A bit of practical experience ● Pair up and try it out ● Deliberate practice ©LeanAgileMachine Creative Commons License
  • 5. Have you tried ”Test First” ? Raise your hand if you already tried TDD and ”test first” development ? ©LeanAgileMachine Creative Commons License
  • 6. Where does TDD fit ©LeanAgileMachine Creative Commons License
  • 7. So what is TDD ?? ©LeanAgileMachine Creative Commons License
  • 8. A design activity ● What is the challenge (the requirements) ● What are the concepts we are dealing with ● What is valuable ● What behaviour do I need to understand ● How do I know I have met the challenge ● How do I know I can change ©LeanAgileMachine Creative Commons License
  • 9. Understanding the problem ● Behaviour ● Concepts ● Stakeholders ● Values ● Priorities ©LeanAgileMachine Creative Commons License
  • 10. The TDD cycle ● Write a failing test so we know it tests something ● Write code to make the test pass ● Refactor code to be as simple as possible ©LeanAgileMachine Creative Commons License
  • 11. Continuous / Fast Feedback ● Are we there yet ? ● Your own ”mini-me” tester as a guide ● Only scratching the surface of testing though ©LeanAgileMachine Creative Commons License
  • 12. What tools are involved Jenkins CI ©LeanAgileMachine Creative Commons License
  • 13. Anatomy of a test ©LeanAgileMachine Creative Commons License
  • 14. Make the test compile ©LeanAgileMachine Creative Commons License
  • 16. Common assertions ● assertEquals() ● Two objects of the same type are equal in value ● assertNotNull() ● The object does not have a null value ● assertTrue() ● The statement results is a true evaluation ● assertSame() ● Two objects are the same http://junit.sourceforge.net/javadoc/org/junit/Assert.html ©LeanAgileMachine Creative Commons License
  • 17. JUnit Annotations ● @Test ● @Ignore ● Defines a method as a test ● Dont run this ● @Test(expected=exception.class) test – use ● Fails if a specific exception is no sparingly thrown ● @Test(timeout = 1000) ● Fails if test takes too long (milliseconds) http://junit.sourceforge.net/javadoc/org/junit/Test.html ©LeanAgileMachine Creative Commons License
  • 18. Test ”smells” ● Testing code rather than behaviour ● Multiple assertions ● Too specific per method ● Changing tests every ● Bloated tests time you refactor ● Harder to refactor ● Addressing to many scenarios ● Harder to understand and maintain ©LeanAgileMachine Creative Commons License
  • 19. A bad test example @Test public void equalsCheck() { System.out.println("* VectorsJUnit4Test: equalsCheck()"); assertTrue(Vectors.equal(new int[] {}, new int[] {})); assertTrue(Vectors.equal(new int[] {0}, new int[] {0})); assertTrue(Vectors.equal(new int[] {0, 0}, new int[] {0, 0})); assertTrue(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 0, 0})); assertTrue(Vectors.equal(new int[] {5, 6, 7}, new int[] {5, 6, 7})); assertFalse(Vectors.equal(new int[] {}, new int[] {0})); assertFalse(Vectors.equal(new int[] {0}, new int[] {0, 0})); assertFalse(Vectors.equal(new int[] {0, 0}, new int[] {0, 0, 0})); assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 0})); assertFalse(Vectors.equal(new int[] {0, 0}, new int[] {0})); assertFalse(Vectors.equal(new int[] {0}, new int[] {})); assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 0, 1})); assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {0, 1, 0})); assertFalse(Vectors.equal(new int[] {0, 0, 0}, new int[] {1, 0, 0})); assertFalse(Vectors.equal(new int[] {0, 0, 1}, new int[] {0, 0, 3})); } ©LeanAgileMachine Creative Commons License
  • 20. Quick Netbeans / JUnit demo - create a new project - create your first test - run the JUnit testrunner - write code to fix the test - run the JUnit testrunner - write another test... ©LeanAgileMachine Creative Commons License
  • 21. Your turn - pair up - fire up netbeans - start a new Java Application project - or check out my project - read the basic requirements - write a test... ©LeanAgileMachine Creative Commons License
  • 22. Deliberate practice ● Goal is to practice TDD ● Become comfortable with the tools ● Gain experience in writing tests ● Improve confidence in TDD ● The resulting code algorithms are not important ● I dont care how fast your calculator calculates ● You're here to learn not to produce ©LeanAgileMachine Creative Commons License
  • 23. Hamcrest asserts ● Hamcrest is a pattern matching library ● Can help make you test logic more human readable AssertThat() - instead of JUnit asserts assertThat(myCalc.addTwoNumbers(6, 7), is(6 + 7)); assertThat(myCalc.addTwoNumbers(6, 7), is(not(6 + 9))); ©LeanAgileMachine Creative Commons License
  • 24. Build Tools ● Build Automation ● Compile, test and deploy code from your repository Ant.apache.org ant.apache.org/ivy Maven.apache.org Comparison of tools: http://ant.apache.org/ivy/ m2comparison.html ©LeanAgileMachine Creative Commons License
  • 25. Integrated Development Environments ● Manage large / multiple projects ● Debugger ● Autocompletion (code api completion) ● Refactoring .org ● Build management Ant / Maven – compile, test, deploy .org ● ● Integration ● Application servers, databases, unit testing, Scm, bug tracker, CI server, IntelliJ IDEA jetbrains.org ©LeanAgileMachine Creative Commons License
  • 26. Keep the build bunny happy ● Tests help prevent build errors ● You can run your tests before you anger the build bunny ©LeanAgileMachine Creative Commons License
  • 27. Collaborative workspace ● Can show progress of your tests Confluence ● Show you which tests are failing ● Gives everyone a sence of progress ©LeanAgileMachine Creative Commons License
  • 28. Summary ● TDD is a design activity ● Gives you time to use your brain before coding ● This session was just enough to get you going ● Try doing some coding kata ● Try a coding dojo or code retreat ● LJC / GDC organising these soon ! ● Monthly Python, Clojure, Scala dojos aready running ©LeanAgileMachine Creative Commons License
  • 29. We want your feedback ©LeanAgileMachine Creative Commons License
  • 30. Graduate Developer Community www.grad-dc.co.uk Meet with Companies blog.grad-dc.co.uk looking for interns Talk to experienced developers & testers Ask questions about what you learnt tonight Socialse ©LeanAgileMachine Creative Commons License
  • 31. TDD / BDD Workshop ● Half day workshop at SkillsMatter 17 th May ● Part of London Tester Gathering days http://bit.ly/LTGDays2011 ©LeanAgileMachine Creative Commons License
  • 32. Thank you Useful links John@jr0cket.com John.Jr0cket.co.uk Toolingup.Jr0cket.co.uk Ubuntu.Jr0cket.co.uk Growing OO Software, www.grad-dc.co.uk guided by tests blog.grad-dc.co.uk ©LeanAgileMachine Creative Commons License

Editor's Notes

  1. If we think about designng a museum, what does it need to do. Well we want to hold a lot of interesting pieces and we want lots of people to come along . So it needs to be a big spacious building. We need people to enter the building so we need people sized doors . We want to charge people, so we need to filter people through a payment channel. We need walls to hang things on and to keep out the cold. The building needs to be secure as there will be valuable itens that some people may want to remove, so we need some sort of security. We want to keep the items in good condition, so the internal atmosphere of the museum needs to be regularted, so we need some sort of plumbing