This is a two day training course, featuring both presentation and hands-on exercises. We will start the class with a methodology discussion, including a review of the existing processes (Agile, Waterfall, or "something in between") and how the tools from this course can integrate into attendee projects.
The course will include a review of the fundamentals of testing, including:
- JUnit deep dive
- Testing databases and web applications
- Static and runtime code analysis
- Automatic documentation generation
Attendees will have a clear understanding of how to use popular open source tools to achieve their testing goals, and apply their use in the real world.
Audience
Attendees should be comfortable with the Java programming language and understand how to build basic projects in Eclipse. Students will have a preconfigured machine set up and ready to use. Java developers of all levels, from junior developers through architect are welcome. This is an excellent class for Java developers looking to expand their skills from novice to expert users of JUnit, DBUnit, Selenium, and for anyone looking to move from a traditional QA role into Software Engineering in Test. Development Managers and Technical Project Managers familiar with basic Java programming will also learn to use and understand these tools, and how to apply them to their team.
Materials
All attendees who complete the course will receive a link to download course material as well as cheat sheet hardcopies for use on their own projects.
Course Outline
Methodology
Introducing the various methodologies and terminology (test-driven development, unit testing, integration testing, behavior-driven development). We will spend time discussing the approaches in use, review the tools and discuss how to fit the tools in to the methodology at the conclusion.
Fundamentals
Deep review and analysis of the use of JUnit 4.8. You may already use JUnit for basic tasks, but this will move you to another level. Topics include annotations, categories, full assertion review, assumptions, Eclipse integration, review of the new support for temporary resources (e.g. files, sockets, databases), listeners, timeouts, parameterized tests, complex pattern matching. Improving the assert syntax with Hamcrest.
Mock objects
Review of Mockito, a mocking framework. Easily externalize your dependencies (e.g. remote services). Use spies to wrap legacy code. We'll discuss the benefits and costs around mocking.
Web-based testing
This section will look at using Selenium and JWebUnit to automate your web testing. Learn how to save screenshots for manual visual inspection. Explore one test written for both headless and full browser display.
Database testing
We will look at the use of DBUnit to setup, verify, and tear down test data. Learn how to test stored procedures. We'll look at special considerations when using Hibernate/JPA/EJB or JDO.
Code Coverage & Reporting
First we generate our coverage reports, and then we talk about what do with them. Understand what the reports tell you about the level of coverage - and what they don't. Configuration and use of Emma.
Static Analysis & Automatic Documentation
Review of modern tools for static analysis and automatic documentation. We’ll show how to integrate these tools into a build for easy automatic generation when a build is run. Tools reviewed include Checkstyle, CPD, FindBugs, PMD, UmlGraph, and SchemaSpy.
Strategies for Continuous Integration
Review of Hudson as a continuous integration tool, and a discussion of strategies for integrating this into your workflow. We'll talk about some of the other tools available on the market, and the pros and cons of different approaches. We'll talk about how to integrate your CI into your version control system, and the implications of branching and precommit hooks.
Test Suite Management
As your test suite grows, it will take longer to run. Strategies for managing this problem while maintaining productivity.
Review and Checklist
We will review the material, and discuss how attendees will be able to apply the material in their projects.