Training

 

 

Popular Courses

Browse Our Free Resources

  • whitepapers
  • whitepapers
  • webinars
  • blogs

Our Locations

Training Centres

Vancouver, BC
Calgary, AB
Edmonton, AB
Toronto, ON
Ottawa, ON
Montreal, QC
Hunt Valley
Columbia

locations map

Calgary

550 6th Av SW
Suite 475
Calgary, AB
T2P 0S2

Toronto

821A Bloor Street West
Toronto, ON
M6G 1M1

Vancouver

409 Granville St
Suite 902
Vancouver, BC
V6C 1T2

U.S. Office

436 York Road
Suite 1
Jenkintown, PA
19046

Other Locations

Dallas, TX
Miami, FL

Home > Training > Configuration Management and Testing > Mastering Test-Driven Development using JUnit Training

Mastering Test-Driven Development using JUnit Training

Course#: WA2398

This is a five-day, comprehensive hands-on test-driven development / JUnit / TDD training course geared for developers who need to get up and running with essential Test-driven development programming skills using JUnit and various open-source testing frameworks. Throughout the course students learn the best practices for writing great programs in Java, using test-driven development techniques. This comprehensive course also covers essential TDD topics and skills.

Students who attend Mastering Test-Driven Development using JUnit will leave the course armed with the skills they require to develop solid Java programs, using sound coding testing techniques and best coding practices. This course quickly introduces developers to the features of JUnit and educates them regarding JUnit’s strengths and weaknesses.

A complete understanding of TDD concepts, processes, and practices requires some in-depth hands-on experience.  During this class, students spend significant time working on a course project.  The project exercises are specifically oriented towards using TDD to implement a complex and multi-faceted web application that uses a database in its final form.  During the course project, the students:

  • Test basic Java functionality
  • Test web-functionality implemented in JEE
  • Use mocks for needed resources
  • Replace mocks and test database operations
  • Optionally, integrate the layers of the application using Spring and testing as they progress

This course includes coverage of many of the essential JUnit capabilities, and can be tailored to focus exactly on the areas that you are interested in.

Working within in a dynamic, learning environment, guided by our expert TDD team, attendees will:

  • Understand JUnit.
  • Understand and use the JUnit Test Runner interface.
  • Use JUnit to drive the implementation of Java code.
  • Test applications using native IDE support.
  • Best practices and patterns for test development.
  • Understand JUnit’s strengths and weaknesses
  • Understand the role of debugging when done in conjunction with tests.
  • Understand not only the fundamentals of the TDD using Java, but also its importance, uses, strengths and weaknesses.
  • Understand how JUnit affects your perspective on development and increases your focus on a task.
  • Learn good JUnit coding style.
  • Create well structured JUnit programs.
  • Compile and execute programs using JUnit, jWebUnit, and DBUnit using the IDE of your choice.
  • How to extend testing with mock objects using EasyMock.
  • Look at refactoring techniques available to make code as reusable/robust as possible.
  • Discuss various testing techniques.

The following JUnit-based testing frameworks are examined:

  • JUnit 4.x
  • EasyMock
  • PowerMock
  • jWebUnit
  • DBUnit

Audience

Experienced Java programmers

Duration

5 days

Outline of WA2398 Mastering Test-Driven Development using JUnit Training

1. Introducing Test-Driven Development (TDD)

  • Test-Driven Development
    • Test, code, refactor, repeat
    • The ROI of TDD
    • Rationale
    • Advantages
    • Tools

2. JUnit

  • JUnit Overview
    • Purpose of Unit Testing
    • Good Unit Tests
    • Test Stages
    • Unit Testing Vs Integration Testing
  • Jumpstart: JUnit 4.x 
    • JUnit Overview
    • How JUnit Works
    • Launching Tests
    • Test Suites
    • JUnit Test Fixture
  • @Test Annotation
    • Test Execution Cycle
    • Checking for Exceptions
    • Using Timeouts
  • Hamcrest
    • About Hamcrest
    • The Hamcrest Matcher Framework
    • Hamcrest Matchers
  • Parameterized Tests 
    • Injecting the Parameters
    • Setting the Parameters
    • Test Execution Cycle
    • Observations
  • Theories
    • Writing Theory Enabled Tests
    • Defining DataPoints
    • Defining Theories
    • Observations
  • JUnit Best Practices
    • "Good" Tests
    • Bad Smells
    • White-Box Unit Testing
    • Black-Box Unit Testing
    • Automation and Coverage

3. Testing Tools

  • Web Testing: jWebUnit/HttpUnit
    • Presentation testing
    • Integration testing
    • jWebUnit
    • jWebUnit/HttpUnit
  • Mocking of Components
    • Why We use Test Dummies
    • Mock Objects
    • Working with Mock Objects
    • Using Mocks with the User Interface
    • Mock Object Strategies
  • Mock Objects and EasyMock
    • EasyMock Description and Features
    • EasyMock Object Lifecycle
    • Create/Expect Phase
    • Replay/Verify Phase
    • Mocking Complex Objects
    • EasyMock HOWTO
  • PowerMock
    • PowerMock Description and Features
    • PowerMock Object Lifecycle
    • Mocking a Static Method

4. Advanced Topics

  • State-based vs. Interaction-based Testing 
    • State-based vs. Interaction-based Testing
    • State-based Testing 
    • Interaction-based Testing 
    • Pros and Cons of Each
  • Improving Code Quality Through Refactoring
    • Refactoring Overview
    • Refactoring and Testing
    • Refactoring to Design Patterns
    • Naming conventions
  • Database Testing
    • Database Testing: DBUnit
    • Issues related to database testing
    • Persistence mechanisms
    • DBUnit

5. Appendix: Adding Testing to the Build Process

  • JUnit and Ant
  • The Ant JUnit Tag
  • Running JUnit Tests From Ant
  • Generating a JUnitReport
We regularly offer classes in these and other cities. Atlanta, Austin, Baltimore, Calgary, Chicago, Cleveland, Dallas, Denver, Detroit, Houston, Jacksonville, Miami, Montreal, New York City, Orlando, Ottawa, Philadelphia, Phoenix, Pittsburgh, Seattle, Toronto, Vancouver, Washington DC.
*Your name:

*Your e-mail:

*Phone:

*Company name:

Additional notes:

We have received your message. A sales representative will contact you soon.

Thank you!.

more details
buy this course

Register for a courseware sample

It's simple, and free.

 

Thank You!

You will receive an email shortly containing a link to download the requested sample of the labs for this course.