Mastering Unit Testing with JUnit with Best Practices

COURSE OUTLINE:

Description

This course is geared for developers who need to learn essential unit testing skills using JUnit, EasyMock, and other tools. You will learn the best practices for writing great programs in Java, using unit testing techniques. This comprehensive course also covers essential test-driven development (TDD) topics and skills.

Audience

Experienced Java programmers who wish to get up and running on test-driven development immediately

Prerequisites

At least one of the following courses:

Learning Objectives

  • What unit testing is and what it is not intended to cover
  • JUnit
  • 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 unit testing
  • JUnit's strengths and weaknesses
  • The role of debugging when done in conjunction with tests
  • Fundamentals of the TDD using Java and its importance, uses, strengths and weaknesses
  • How JUnit affects your perspective on development and increases your focus on a task
  • Learn good JUnit coding style
  • Create well-structured JUnit programs
  • How JUnit testing can be used for either state-based or interaction-based testing
  • How to extend testing with mock objects using EasyMock
  • Look at refactoring techniques available to make code as reusable/robust as possible
  • Various testing techniques

1. JUnit

  • JUnit Overview
  • Jumpstart: JUnit 4.x
  • @Test Annotation
  • Hamcrest
  • Parameterized Tests
  • Theories
  • JUnit Best Practices

2. Testing Tools and Techniques

  • Improving Code Quality Through Refactoring
  • Mocking of Components
  • Mock Objects and EasyMock
  • PowerMock

3. Appendix: Adding Testing to the Build Process