SlideShare ist ein Scribd-Unternehmen logo
1 von 42
David Noble
dnoble@exist.com
Sr. Solutions Architect, Exist Global




Testing in Java

San Gabriel Valley Java Users Group
http://www.sgvjug.org/
June 25, 2007
Goal

Motivate excellence in testing
with concepts, practices, and tools




                                      2
Scope

         requirements
                              quality
               Testing        assurance
continuous    concepts,
integration
              practices,
                tools         static code
                              analysis
 debugging
                  profiling
                                          3
Agenda

               Test-Driven
 Development
               Terminology
               Tools
               Application
               Discussion


                             4
System Concept
System
Requirements
     System Design
  Detailed Design
Implementation
    Te
    Te




                http://www.flickr.com/photos/h2oalchemist/34249682
      g
      g
       st
       st




                9/                                           5
          iin
            n
Demo
A Taste of TDD
Test-Driven Development

                Add test

              Fail

            Make small change
                                Pass
             Pass

             Commit changes

                                       7
See also:
Test-Driven Development

            Add test

          Fail

            Fix bug

         Pass

        Commit changes

                          8
Test-Driven Development

Refactor   Pass    Commit changes
 Code
                      Add test
                    Fail

                  Make small change
                                      Pass
                   Pass

                   Commit changes


                                        9
Test-Driven Development

           Small steps
           Frequent check-ins




                                10
Test-Driven Development

               Deeper than “test
 first”
               Design for
 testability




                                   11
Test-Driven Development

             Unit tests as example
 code
             Interface before
 implementation
            Function drives form




                                   12
Test-Driven Development

               Loose coupling
                Services with clear
 responsibilities
               Mock objects




                                      13
Ta s t
   e
 the
s oup
   !                            14
http://flickr.com/photos/basak/227480302
Intent          Reality

Requirements,   Implementation
Architecture,   ,
Design          Deployment




                                 15
Intent                  Reality

Requirements,           Implementation
Architecture,           ,
Design                  Deployment
                G
                ap
                    !



                                         16
Intent      Accountability Reality

Requirements,   Testing, QA   Implementation
Architecture,                 ,
Design                        Deployment




                                               17
Intent      Accountability Reality

Requirements,   Testing, QA   Implementation
Architecture,                 ,
Design       R he             Deployment
              ea c
               C

                 lit k!
                    y




                                               18
Terminology

              QA – quality
 assurance
             Do the right things
             Do things right
             Ensure quality standards




                                        19
Terminology

             Test – success
 criteria
            Is it right?
            Is it done?




                              20
Terminology

          Test plan
          Test case
          Test suite
          Test report
          Test coverage



                          21
Terminology

          Unit test
          Functional test
          Integration test
          System test
          Acceptance test
          Regression test

                             22
Terminology

           Non-functional
 testing
           Performance test
           Load test
           Soak test



                              23
Terminology

               Continuous
 integration




                            24
Tools


Mock Objects    jMock, EasyMock

  Unit Tests     JUnit, TestNG
        Build      Ant, Maven

          ID    Eclipse, NetBeans
           E

                                    25
Tools



  Web Apps     Selenium, HttpUnit
 JEE Servers        Cactus

  Databases         DBUnit




                                    26
Tools



 Acceptance   Selenium, FitNesse, Stiq
Performance    JMeter, Eclipse TPTP

  Coverage       Cobertura, Emma




                                      27
Tools



 Continuous    Cruise Control,
 Integration   Continuum,
               Hudson




                                 28
Tools

Continuous Integration   Cruise Control, Continuum, Hudson
           Acceptance            Selenium, FitNesse, Stiq
         Performance               JMeter, Eclipse TPTP
             Coverage               Cobertura, Emma
            Web Apps               Selenium, HttpUnit
           JEE Servers                   Cactus
            Databases                    DBUnit
         Mock Objects               jMock, EasyMock

            Unit Tests                JUnit, TestNG

                 Build                 Ant, Maven

                  IDE               Eclipse, NetBeans

                                                             29
Demo
 Tools
Resources: SGV JUG
Web Site
  http://sgvlug.net/mailman/listinfo/java-sig

Mailing List (Hosted by SGV Linux Users Group)
  http://sgvlug.net/mailman/listinfo/java-sig
  java-sig@sgvlug.net




                                                 31
Resources: TDD
Articles
  http://www.agiledata.org/essays/tdd.html
  http://en.wikipedia.org/wiki/Test_driven_development
  http://www.testdriven.com/modules/xoopsfaq/
  http://www.artima.com/intv/testdriven.html
  http://www.google.com/search?hl=en&q=test+driven+development (really!)




                                                                    32
Resources: IDE & Build Tools
Eclipse IDE
  http://www.eclipse.org/
NetBeans IDE
  http://www.netbeans.org/
Ant
  http://ant.apache.org/
Maven 2
  http://maven.apache.org/
  http://www.devzuz.com/web/guest/products/resources#BBWM
Maven & Eclipse
  http://m2eclipse.codehaus.org/
Maven & Netbean
  http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html


                                                                               33
Resources: Unit Testing
JUnit Framework
  http://junit.org/
JUnit FAQ
  http://junit.sourceforge.net/doc/faq/faq.htm
JUnit with Ant
  http://ant.apache.org/manual/OptionalTasks/junit.html
  http://ant.apache.org/manual/OptionalTasks/junitreport.html
JUnit with Maven
  http://maven.apache.org/plugins/maven-surefire-plugin/
TestNG Framework
  http://testng.org/doc/
Jester – Mutation Testing
  http://jester.sourceforge.net/
  http://www.ibm.com/developerworks/java/library/j-jester/
                                                                34
Resources: Mock Objects
Mock Objects Blog
  http://mockobjects.com/

EasyMock Library
  http://easymock.org/

jMock Library
  http://jmock.org/




                            35
Resources: Unit & Functional
XmlUnit Library
  http://xmlunit.sourceforge.net/

DBUnit Library
  http://dbunit.sourceforge.net/

HttpUnit Library
  http://httpunit.sourceforge.net/

Cactus for JEE Server Code
  http://jakarta.apache.org/cactus/

Cargo for JEE Server Code
  http://cargo.codehaus.org/




                                      36
Resources: Test Coverage
Cobertura
  http://cobertura.sourceforge.net/
  http://www.ibm.com/developerworks/java/library/j-cobertura/

Cobertura with Ant
  http://cobertura.sourceforge.net/anttaskreference.html

Cobertura with Maven
  http://mojo.codehaus.org/cobertura-maven-plugin/usage.html

Emma
  http://emma.sourceforge.net/




                                                                37
Resources: Perf. & Load
JUnitPerf
  http://clarkware.com/software/JUnitPerf.html

JMeter
  http://jakarta.apache.org/jmeter/

Eclipse TPTP (Test & Performance Tools Platform)
  http://www.eclipse.org/tptp/

Netbeans Profiler
  http://profiler.netbeans.org/




                                                   38
Resources: Acceptance Tests
Selenium for Web Apps
  http://www.openqa.org/selenium/
  http://www.openqa.org/selenium-ide/download.action

Automating Selenium (“Remote Control”)
  http://www.openqa.org/selenium-rc/
  http://wiki.openqa.org/display/SRC/Selenium-RC+and+Continuous+Integration

Selenium & Maven
  http://raibledesigns.com/rd/entry/selenium_plugin_for_maven

FitNesse
  http://fitnesse.org/

Stiq
  http://storytestiq.sourceforge.net/


                                                                              39
Resources: Cont. Integration
Cruise Control
  http://cruisecontrol.sourceforge.net/

Continuum
  http://maven.apache.org/continuum/

Hudson
  https://hudson.dev.java.net/




                                          40
Resources: App used in Demo
Open Source Medical Record System
  http://www.openmrs.org/

Prerequisites: SVN, MySQL 5, Tomcat 5
  http://subclipse.tigris.org/update_1.2.x
  http://mysql.org/
  http://tomcat.apache.org/

SVN Repository
  http://svn.openmrs.org/openmrs/branches/alpha

Installation
  Edit build.properties and properties.xml to set tomcat.user/password,
  or add test/test to $CATALINA_HOME/conf/tomcat-users.xml file.
  Edit build.properties and/or properties.xml to set tomcat.home file.
  Comment out creation of "test" MySQL user in schema if it already exists.
  Default username/password is admin/test.
                                                                              41
Thank you
To all who participated!

Weitere ähnliche Inhalte

Was ist angesagt?

TDD with Visual Studio 2010
TDD with Visual Studio 2010TDD with Visual Studio 2010
TDD with Visual Studio 2010Stefano Paluello
 
Android Test Driven Development
Android Test Driven DevelopmentAndroid Test Driven Development
Android Test Driven DevelopmentArif Huda
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questionsKuldeep Pawar
 
Ajit jadhav automation_qa_4_ yrs
Ajit jadhav automation_qa_4_ yrsAjit jadhav automation_qa_4_ yrs
Ajit jadhav automation_qa_4_ yrsAjit Jadhav
 
Web Application Software Testing
Web Application Software TestingWeb Application Software Testing
Web Application Software TestingAndrew Kandels
 
San Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker PresentationSan Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker PresentationClever Moe
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++TestEngineering Software Lab
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersAjit Jadhav
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in YiiIlPeach
 
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object DesignerMigrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object DesignerClever Moe
 
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019Sam Brannen
 
Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Deepak Singhvi
 
Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsSam Brannen
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?Dmitry Buzdin
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven TestingMaveryx
 
Generic Test Automation Architecture
Generic Test Automation ArchitectureGeneric Test Automation Architecture
Generic Test Automation ArchitectureTestingCR
 
Oh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationOh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationPaul Blundell
 

Was ist angesagt? (20)

TDD with Visual Studio 2010
TDD with Visual Studio 2010TDD with Visual Studio 2010
TDD with Visual Studio 2010
 
Android Test Driven Development
Android Test Driven DevelopmentAndroid Test Driven Development
Android Test Driven Development
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questions
 
Ajit jadhav automation_qa_4_ yrs
Ajit jadhav automation_qa_4_ yrsAjit jadhav automation_qa_4_ yrs
Ajit jadhav automation_qa_4_ yrs
 
Web Application Software Testing
Web Application Software TestingWeb Application Software Testing
Web Application Software Testing
 
San Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker PresentationSan Jose Selenium Meet-up PushToTest TestMaker Presentation
San Jose Selenium Meet-up PushToTest TestMaker Presentation
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++Test
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
 
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object DesignerMigrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
 
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
JUnit 5 - Evolution and Innovation - SpringOne Platform 2019
 
Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.
 
Testing Spring MVC and REST Web Applications
Testing Spring MVC and REST Web ApplicationsTesting Spring MVC and REST Web Applications
Testing Spring MVC and REST Web Applications
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
 
Generic Test Automation Architecture
Generic Test Automation ArchitectureGeneric Test Automation Architecture
Generic Test Automation Architecture
 
Oh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationOh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to Mutation
 
Automation Testing Syllabus - Checklist
Automation Testing Syllabus - ChecklistAutomation Testing Syllabus - Checklist
Automation Testing Syllabus - Checklist
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 

Ähnlich wie Testing in Java: Motivate excellence with concepts, practices and tools

Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevillePromet Source
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
Rajiv Profile_Sept_2016
Rajiv Profile_Sept_2016Rajiv Profile_Sept_2016
Rajiv Profile_Sept_2016Rajiv Joseph
 
Agile Open Source Performance Test Workshop for Developers, Testers, IT Ops
Agile Open Source Performance Test Workshop for Developers, Testers, IT OpsAgile Open Source Performance Test Workshop for Developers, Testers, IT Ops
Agile Open Source Performance Test Workshop for Developers, Testers, IT OpsClever Moe
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScriptSimon Guest
 
Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsBhavin Javia
 
Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6Clever Moe
 
Agile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business ManagersAgile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business ManagersClever Moe
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App EngineInphina Technologies
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App EngineIndicThreads
 
Neev Independent Testing Services
Neev Independent Testing ServicesNeev Independent Testing Services
Neev Independent Testing ServicesNeev Technologies
 
Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)Mike McGarr
 
Performance Testing
Performance TestingPerformance Testing
Performance TestingCodelattice
 

Ähnlich wie Testing in Java: Motivate excellence with concepts, practices and tools (20)

Testing In Java
Testing In JavaTesting In Java
Testing In Java
 
Testing In Java4278
Testing In Java4278Testing In Java4278
Testing In Java4278
 
Selenium Camp 2012
Selenium Camp 2012Selenium Camp 2012
Selenium Camp 2012
 
Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in AshevilleAutomated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Rajiv Profile_Sept_2016
Rajiv Profile_Sept_2016Rajiv Profile_Sept_2016
Rajiv Profile_Sept_2016
 
Agile Open Source Performance Test Workshop for Developers, Testers, IT Ops
Agile Open Source Performance Test Workshop for Developers, Testers, IT OpsAgile Open Source Performance Test Workshop for Developers, Testers, IT Ops
Agile Open Source Performance Test Workshop for Developers, Testers, IT Ops
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
 
Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails Applications
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6
 
Agile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business ManagersAgile Open Source Performance Testing Workshop for Business Managers
Agile Open Source Performance Testing Workshop for Business Managers
 
Rajiv Profile
Rajiv ProfileRajiv Profile
Rajiv Profile
 
Alm 4 Azure
Alm 4 AzureAlm 4 Azure
Alm 4 Azure
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App Engine
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App Engine
 
Neev Independent Testing Services
Neev Independent Testing ServicesNeev Independent Testing Services
Neev Independent Testing Services
 
Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)Continuous Delivery Applied (AgileDC)
Continuous Delivery Applied (AgileDC)
 
Performance Testing
Performance TestingPerformance Testing
Performance Testing
 
Continuous Delivery Applied
Continuous Delivery AppliedContinuous Delivery Applied
Continuous Delivery Applied
 

Mehr von Adrian Treacy

Arrows Group Corporate Brochure
Arrows Group Corporate BrochureArrows Group Corporate Brochure
Arrows Group Corporate BrochureAdrian Treacy
 
Dan North Embracinguncertaintyv3
Dan North Embracinguncertaintyv3Dan North Embracinguncertaintyv3
Dan North Embracinguncertaintyv3Adrian Treacy
 
Mobile.Broadband John.Frieslaar 10.10.12
Mobile.Broadband John.Frieslaar 10.10.12Mobile.Broadband John.Frieslaar 10.10.12
Mobile.Broadband John.Frieslaar 10.10.12Adrian Treacy
 
Mobile.Broadband Maurice.Patrick 101012
Mobile.Broadband Maurice.Patrick 101012Mobile.Broadband Maurice.Patrick 101012
Mobile.Broadband Maurice.Patrick 101012Adrian Treacy
 
Mobile.Broadband Gavin.Franks 10.10.12
Mobile.Broadband Gavin.Franks 10.10.12Mobile.Broadband Gavin.Franks 10.10.12
Mobile.Broadband Gavin.Franks 10.10.12Adrian Treacy
 
Mobile.Broadband Dan.Warren 101012
Mobile.Broadband Dan.Warren 101012Mobile.Broadband Dan.Warren 101012
Mobile.Broadband Dan.Warren 101012Adrian Treacy
 
Back To Basics Hyper Free Principles For Software Developers
Back To Basics Hyper Free Principles For Software DevelopersBack To Basics Hyper Free Principles For Software Developers
Back To Basics Hyper Free Principles For Software DevelopersAdrian Treacy
 
Introductiontoagile Scrum 120808133533 Phpapp01
Introductiontoagile Scrum 120808133533 Phpapp01Introductiontoagile Scrum 120808133533 Phpapp01
Introductiontoagile Scrum 120808133533 Phpapp01Adrian Treacy
 
Tw Technology Radar Qtb Sep11
Tw Technology Radar Qtb Sep11Tw Technology Radar Qtb Sep11
Tw Technology Radar Qtb Sep11Adrian Treacy
 
Thezenofscrum1 090221154550 Phpapp01
Thezenofscrum1 090221154550 Phpapp01Thezenofscrum1 090221154550 Phpapp01
Thezenofscrum1 090221154550 Phpapp01Adrian Treacy
 
Shareaholicwordcamp 120716084731 Phpapp01
Shareaholicwordcamp 120716084731 Phpapp01Shareaholicwordcamp 120716084731 Phpapp01
Shareaholicwordcamp 120716084731 Phpapp01Adrian Treacy
 
Whatisux 120716141232 Phpapp02
Whatisux 120716141232 Phpapp02Whatisux 120716141232 Phpapp02
Whatisux 120716141232 Phpapp02Adrian Treacy
 
Mark Neild Nsn Beyond 4 G
Mark Neild Nsn   Beyond 4 GMark Neild Nsn   Beyond 4 G
Mark Neild Nsn Beyond 4 GAdrian Treacy
 
Rec 12 073 Lte Small Cells Presentation Arrows
Rec 12 073 Lte  Small Cells Presentation ArrowsRec 12 073 Lte  Small Cells Presentation Arrows
Rec 12 073 Lte Small Cells Presentation ArrowsAdrian Treacy
 
Arrows Group Information
Arrows Group InformationArrows Group Information
Arrows Group InformationAdrian Treacy
 

Mehr von Adrian Treacy (15)

Arrows Group Corporate Brochure
Arrows Group Corporate BrochureArrows Group Corporate Brochure
Arrows Group Corporate Brochure
 
Dan North Embracinguncertaintyv3
Dan North Embracinguncertaintyv3Dan North Embracinguncertaintyv3
Dan North Embracinguncertaintyv3
 
Mobile.Broadband John.Frieslaar 10.10.12
Mobile.Broadband John.Frieslaar 10.10.12Mobile.Broadband John.Frieslaar 10.10.12
Mobile.Broadband John.Frieslaar 10.10.12
 
Mobile.Broadband Maurice.Patrick 101012
Mobile.Broadband Maurice.Patrick 101012Mobile.Broadband Maurice.Patrick 101012
Mobile.Broadband Maurice.Patrick 101012
 
Mobile.Broadband Gavin.Franks 10.10.12
Mobile.Broadband Gavin.Franks 10.10.12Mobile.Broadband Gavin.Franks 10.10.12
Mobile.Broadband Gavin.Franks 10.10.12
 
Mobile.Broadband Dan.Warren 101012
Mobile.Broadband Dan.Warren 101012Mobile.Broadband Dan.Warren 101012
Mobile.Broadband Dan.Warren 101012
 
Back To Basics Hyper Free Principles For Software Developers
Back To Basics Hyper Free Principles For Software DevelopersBack To Basics Hyper Free Principles For Software Developers
Back To Basics Hyper Free Principles For Software Developers
 
Introductiontoagile Scrum 120808133533 Phpapp01
Introductiontoagile Scrum 120808133533 Phpapp01Introductiontoagile Scrum 120808133533 Phpapp01
Introductiontoagile Scrum 120808133533 Phpapp01
 
Tw Technology Radar Qtb Sep11
Tw Technology Radar Qtb Sep11Tw Technology Radar Qtb Sep11
Tw Technology Radar Qtb Sep11
 
Thezenofscrum1 090221154550 Phpapp01
Thezenofscrum1 090221154550 Phpapp01Thezenofscrum1 090221154550 Phpapp01
Thezenofscrum1 090221154550 Phpapp01
 
Shareaholicwordcamp 120716084731 Phpapp01
Shareaholicwordcamp 120716084731 Phpapp01Shareaholicwordcamp 120716084731 Phpapp01
Shareaholicwordcamp 120716084731 Phpapp01
 
Whatisux 120716141232 Phpapp02
Whatisux 120716141232 Phpapp02Whatisux 120716141232 Phpapp02
Whatisux 120716141232 Phpapp02
 
Mark Neild Nsn Beyond 4 G
Mark Neild Nsn   Beyond 4 GMark Neild Nsn   Beyond 4 G
Mark Neild Nsn Beyond 4 G
 
Rec 12 073 Lte Small Cells Presentation Arrows
Rec 12 073 Lte  Small Cells Presentation ArrowsRec 12 073 Lte  Small Cells Presentation Arrows
Rec 12 073 Lte Small Cells Presentation Arrows
 
Arrows Group Information
Arrows Group InformationArrows Group Information
Arrows Group Information
 

Testing in Java: Motivate excellence with concepts, practices and tools

  • 1. David Noble dnoble@exist.com Sr. Solutions Architect, Exist Global Testing in Java San Gabriel Valley Java Users Group http://www.sgvjug.org/ June 25, 2007
  • 2. Goal Motivate excellence in testing with concepts, practices, and tools 2
  • 3. Scope requirements quality Testing assurance continuous concepts, integration practices, tools static code analysis debugging profiling 3
  • 4. Agenda Test-Driven Development Terminology Tools Application Discussion 4
  • 5. System Concept System Requirements System Design Detailed Design Implementation Te Te http://www.flickr.com/photos/h2oalchemist/34249682 g g st st 9/ 5 iin n
  • 7. Test-Driven Development Add test Fail Make small change Pass Pass Commit changes 7 See also:
  • 8. Test-Driven Development Add test Fail Fix bug Pass Commit changes 8
  • 9. Test-Driven Development Refactor Pass Commit changes Code Add test Fail Make small change Pass Pass Commit changes 9
  • 10. Test-Driven Development Small steps Frequent check-ins 10
  • 11. Test-Driven Development Deeper than “test first” Design for testability 11
  • 12. Test-Driven Development Unit tests as example code Interface before implementation Function drives form 12
  • 13. Test-Driven Development Loose coupling Services with clear responsibilities Mock objects 13
  • 14. Ta s t e the s oup ! 14 http://flickr.com/photos/basak/227480302
  • 15. Intent Reality Requirements, Implementation Architecture, , Design Deployment 15
  • 16. Intent Reality Requirements, Implementation Architecture, , Design Deployment G ap ! 16
  • 17. Intent Accountability Reality Requirements, Testing, QA Implementation Architecture, , Design Deployment 17
  • 18. Intent Accountability Reality Requirements, Testing, QA Implementation Architecture, , Design R he Deployment ea c C lit k! y 18
  • 19. Terminology QA – quality assurance Do the right things Do things right Ensure quality standards 19
  • 20. Terminology Test – success criteria Is it right? Is it done? 20
  • 21. Terminology Test plan Test case Test suite Test report Test coverage 21
  • 22. Terminology Unit test Functional test Integration test System test Acceptance test Regression test 22
  • 23. Terminology Non-functional testing Performance test Load test Soak test 23
  • 24. Terminology Continuous integration 24
  • 25. Tools Mock Objects jMock, EasyMock Unit Tests JUnit, TestNG Build Ant, Maven ID Eclipse, NetBeans E 25
  • 26. Tools Web Apps Selenium, HttpUnit JEE Servers Cactus Databases DBUnit 26
  • 27. Tools Acceptance Selenium, FitNesse, Stiq Performance JMeter, Eclipse TPTP Coverage Cobertura, Emma 27
  • 28. Tools Continuous Cruise Control, Integration Continuum, Hudson 28
  • 29. Tools Continuous Integration Cruise Control, Continuum, Hudson Acceptance Selenium, FitNesse, Stiq Performance JMeter, Eclipse TPTP Coverage Cobertura, Emma Web Apps Selenium, HttpUnit JEE Servers Cactus Databases DBUnit Mock Objects jMock, EasyMock Unit Tests JUnit, TestNG Build Ant, Maven IDE Eclipse, NetBeans 29
  • 31. Resources: SGV JUG Web Site http://sgvlug.net/mailman/listinfo/java-sig Mailing List (Hosted by SGV Linux Users Group) http://sgvlug.net/mailman/listinfo/java-sig java-sig@sgvlug.net 31
  • 32. Resources: TDD Articles http://www.agiledata.org/essays/tdd.html http://en.wikipedia.org/wiki/Test_driven_development http://www.testdriven.com/modules/xoopsfaq/ http://www.artima.com/intv/testdriven.html http://www.google.com/search?hl=en&q=test+driven+development (really!) 32
  • 33. Resources: IDE & Build Tools Eclipse IDE http://www.eclipse.org/ NetBeans IDE http://www.netbeans.org/ Ant http://ant.apache.org/ Maven 2 http://maven.apache.org/ http://www.devzuz.com/web/guest/products/resources#BBWM Maven & Eclipse http://m2eclipse.codehaus.org/ Maven & Netbean http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html 33
  • 34. Resources: Unit Testing JUnit Framework http://junit.org/ JUnit FAQ http://junit.sourceforge.net/doc/faq/faq.htm JUnit with Ant http://ant.apache.org/manual/OptionalTasks/junit.html http://ant.apache.org/manual/OptionalTasks/junitreport.html JUnit with Maven http://maven.apache.org/plugins/maven-surefire-plugin/ TestNG Framework http://testng.org/doc/ Jester – Mutation Testing http://jester.sourceforge.net/ http://www.ibm.com/developerworks/java/library/j-jester/ 34
  • 35. Resources: Mock Objects Mock Objects Blog http://mockobjects.com/ EasyMock Library http://easymock.org/ jMock Library http://jmock.org/ 35
  • 36. Resources: Unit & Functional XmlUnit Library http://xmlunit.sourceforge.net/ DBUnit Library http://dbunit.sourceforge.net/ HttpUnit Library http://httpunit.sourceforge.net/ Cactus for JEE Server Code http://jakarta.apache.org/cactus/ Cargo for JEE Server Code http://cargo.codehaus.org/ 36
  • 37. Resources: Test Coverage Cobertura http://cobertura.sourceforge.net/ http://www.ibm.com/developerworks/java/library/j-cobertura/ Cobertura with Ant http://cobertura.sourceforge.net/anttaskreference.html Cobertura with Maven http://mojo.codehaus.org/cobertura-maven-plugin/usage.html Emma http://emma.sourceforge.net/ 37
  • 38. Resources: Perf. & Load JUnitPerf http://clarkware.com/software/JUnitPerf.html JMeter http://jakarta.apache.org/jmeter/ Eclipse TPTP (Test & Performance Tools Platform) http://www.eclipse.org/tptp/ Netbeans Profiler http://profiler.netbeans.org/ 38
  • 39. Resources: Acceptance Tests Selenium for Web Apps http://www.openqa.org/selenium/ http://www.openqa.org/selenium-ide/download.action Automating Selenium (“Remote Control”) http://www.openqa.org/selenium-rc/ http://wiki.openqa.org/display/SRC/Selenium-RC+and+Continuous+Integration Selenium & Maven http://raibledesigns.com/rd/entry/selenium_plugin_for_maven FitNesse http://fitnesse.org/ Stiq http://storytestiq.sourceforge.net/ 39
  • 40. Resources: Cont. Integration Cruise Control http://cruisecontrol.sourceforge.net/ Continuum http://maven.apache.org/continuum/ Hudson https://hudson.dev.java.net/ 40
  • 41. Resources: App used in Demo Open Source Medical Record System http://www.openmrs.org/ Prerequisites: SVN, MySQL 5, Tomcat 5 http://subclipse.tigris.org/update_1.2.x http://mysql.org/ http://tomcat.apache.org/ SVN Repository http://svn.openmrs.org/openmrs/branches/alpha Installation Edit build.properties and properties.xml to set tomcat.user/password, or add test/test to $CATALINA_HOME/conf/tomcat-users.xml file. Edit build.properties and/or properties.xml to set tomcat.home file. Comment out creation of "test" MySQL user in schema if it already exists. Default username/password is admin/test. 41
  • 42. Thank you To all who participated!

Hinweis der Redaktion

  1. My background: Mostly C & Perl from 1990 – 1997 Mostly Java since then. Telemetry processing, mission ops, EIS @ JPL. BPM, workflow, assorted biz apps.
  2. Goal falls within the larger context of pursuing excellence in software development.
  3. In traditional software development, testing is usually at the end of the schedule. If development runs late, the testing often suffers.
  4. An old man calls the waiter over to his table. "What would you like, sir?" asks the waiter. "Taste the soup," he says. "Is the soup too cold?" asks the waiter. "Taste the soup," says the old man. "Is it too salty?" asks the waiter. "Taste the soup!" says the old man. "Is there a fly in it?" asks the waiter. "Taste the soup!" the old man insists. The waiter looks down: "There's no spoon!" "Aha!" exclaims the old man.
  5. Miriam-Webster: “ a program for the systematic monitoring and evaluation of the various aspects of a project, service, or facility to ensure that standards of quality are being met”
  6. Test plan: document Test case: implementation of specific test. Test suite: collection of test cases. Test report: results of running the tests. Test coverage: description of how much code (and which code) was exercised by tests.
  7. Unit test: typically at the granularity of a class. Functional test: a feature or use case. Integration test: multiple modules. System test: all the modules. Acceptance test: defined by user/customer.
  8. Non-functional testing: the “-ilities”. Performance test: how fast. Load test: how many. Soak test: how long.
  9. This is an alternative to “big bang integration”, otherwise known as “integration hell”.
  10. HttpUnit is better suited to situations where you want to examine the DOM at a low level. If you're looking for convenience, and don't need to get deep into the details, look at Selenium instead.
  11. Selenium IDE, a Firefox plugin, lets users or product managers create their own scenarios. Selenium is also useful during development, to quickly fast forward through actions to get the web application into a desired state.
  12. The items in green aren't really a stack, just a collection of technology-specific libraries that can be useful for creating test cases.
  13. Be sure to design Selenium tests so they can be repeatable. Either delete data when they are done, or always start from a fixed known state.