Testing in Java <ul><ul><li>San Gabriel Valley Java Users Group </li></ul></ul><ul><ul><li>http://www.sgvjug.org/ </li></u...
Goal <ul><li>Motivate  excellence  in  testing </li></ul><ul><li>with  concepts ,  practices,  and  tools </li></ul>
Scope requirements static code analysis debugging profiling continuous integration quality assurance Testing concepts, pra...
Agenda <ul><li>Test-Driven Development </li></ul><ul><li>Terminology </li></ul><ul><li>Tools </li></ul><ul><li>Application...
http://www.flickr.com/photos/h2oalchemist/342496829/ System Concept System Requirements System Design Detailed Design Impl...
Demo A Taste of TDD
Test-Driven Development See also: http://www.agiledata.org/essays/tdd.html Fail Pass Pass Add test Make small change Commi...
Test-Driven Development Fail Pass Add test Fix bug Commit changes
Test-Driven Development Fail Pass Pass Pass Add test Make small change Refactor Code Commit changes Commit changes
Test-Driven Development <ul><li>Small steps </li></ul><ul><li>Frequent check-ins </li></ul>
Test-Driven Development <ul><li>Deeper than “test first” </li></ul><ul><li>Design for testability </li></ul>
Test-Driven Development <ul><li>Unit tests as example code </li></ul><ul><li>Interface before implementation </li></ul><ul...
Test-Driven Development <ul><li>Loose coupling </li></ul><ul><li>Services with clear responsibilities </li></ul><ul><li>Mo...
http://flickr.com/photos/basak/227480302/ Taste the soup!
Reality Intent Requirements, Architecture, Design Implementation, Deployment
Gap! Reality Intent Requirements, Architecture, Design Implementation, Deployment
Reality Accountability Intent Requirements, Architecture, Design Testing, QA Implementation, Deployment
Intent Reality Check! Reality Accountability Requirements, Architecture, Design Testing, QA Implementation, Deployment
Terminology <ul><li>QA – quality assurance </li></ul><ul><ul><li>Do the right things </li></ul></ul><ul><ul><li>Do things ...
Terminology <ul><li>Test – success criteria </li></ul><ul><ul><li>Is it right? </li></ul></ul><ul><ul><li>Is it done? </li...
Terminology <ul><li>Test plan </li></ul><ul><li>Test case </li></ul><ul><li>Test suite </li></ul><ul><li>Test report </li>...
Terminology <ul><li>Unit test </li></ul><ul><li>Functional test </li></ul><ul><li>Integration test </li></ul><ul><li>Syste...
Terminology <ul><li>Non-functional testing </li></ul><ul><li>Performance test </li></ul><ul><li>Load test </li></ul><ul><l...
Terminology <ul><li>Continuous integration </li></ul>
Tools IDE Build Unit Tests Mock Objects Eclipse, NetBeans Ant, Maven JUnit, TestNG jMock, EasyMock
Tools Databases JEE Servers Web Apps DBUnit Cactus Selenium, HttpUnit
Tools Coverage Performance Acceptance Cobertura, Emma JMeter, Eclipse TPTP Selenium, FitNesse, Stiq
Tools Continuous Integration Cruise Control, Continuum, Hudson
Tools IDE Build Unit Tests Mock Objects Databases JEE Servers Web Apps Coverage Performance Acceptance Continuous Integrat...
Demo Tools
Resources: SGV JUG <ul><li>Web Site </li></ul><ul><ul><li>http://sgvlug.net/mailman/listinfo/java-sig </li></ul></ul><ul><...
Resources: TDD <ul><li>Articles </li></ul><ul><ul><li>http://www.agiledata.org/essays/tdd.html </li></ul></ul><ul><ul><li>...
Resources: IDE & Build Tools <ul><li>Eclipse IDE </li></ul><ul><ul><li>http://www.eclipse.org/ </li></ul></ul><ul><li>NetB...
Resources: Unit Testing <ul><li>JUnit Framework </li></ul><ul><ul><li>http://junit.org/ </li></ul></ul><ul><li>JUnit FAQ <...
Resources: Mock Objects <ul><li>Mock Objects Blog </li></ul><ul><ul><li>http://mockobjects.com/ </li></ul></ul><ul><li>Eas...
Resources: Unit & Functional <ul><li>XmlUnit Library </li></ul><ul><ul><li>http://xmlunit.sourceforge.net/ </li></ul></ul>...
Resources: Test Coverage <ul><li>Cobertura </li></ul><ul><ul><li>http://cobertura.sourceforge.net/ </li></ul></ul><ul><ul>...
Resources: Perf. & Load <ul><li>JUnitPerf </li></ul><ul><ul><li>http://clarkware.com/software/JUnitPerf.html </li></ul></u...
Resources: Acceptance Tests <ul><li>Selenium for Web Apps </li></ul><ul><ul><li>http://www.openqa.org/selenium/ </li></ul>...
Resources: Cont. Integration <ul><li>Cruise Control </li></ul><ul><ul><li>http://cruisecontrol.sourceforge.net/ </li></ul>...
Resources: App used in Demo <ul><li>Open Source Medical Record System </li></ul><ul><ul><li>http://www.openmrs.org/ </li><...
Thank you To all who participated!
Upcoming SlideShare
Loading in...5
×

Testing In Java

64,279

Published on

Overview of testing concepts, practices, and tools in Java.

Published in: Technology
8 Comments
108 Likes
Statistics
Notes
No Downloads
Views
Total Views
64,279
On Slideshare
0
From Embeds
0
Number of Embeds
31
Actions
Shares
0
Downloads
4,201
Comments
8
Likes
108
Embeds 0
No embeds

No notes for slide
  • My background: Mostly C &amp; Perl from 1990 – 1997 Mostly Java since then. Telemetry processing, mission ops, EIS @ JPL. BPM, workflow, assorted biz apps.
  • Testing In Java

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

      Clipping is a handy way to collect important slides you want to go back to later.

    ×