Test Driven Development (TDD) and Unit Testing Essentials is a three-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 you'll learn, explore and gain practical experience working with best practices for writing great programs in Java, using test-driven development techniques. This course quickly introduces you to the core features and benefits of JUnit. You'll leave this course armed with the skills required to leverage solid test driven development and unit testing techniques, using the latest industry techniques and best practices. Throughout the course, you’ll work on a project with labs specifically oriented towards using TDD to implement a complex and multi-faceted web application that uses a database in its final form.

starstarstarstarstar_half

* Actual course outline may vary depending on offering center. Contact your sales representative for more information.

Learning Objectives

Working in a hands-on learning environment, guided by our expert team, you’ll explore:
The role of Unit Testing in software development and testing
How to write effective Unit Testing
The properties of effective unit tests
The benefits of the test-first and Test-Driven Development
Techniques and practices to aid in the successful adoption of Test-Driven Development
JUnit and the JUnit Test Runner interface.
How to use JUnit to drive the implementation of Java code.
The role of debugging when done in conjunction with tests.
The fundamentals of the TDD using Java, as well as its importance, uses, strengths and weaknesses.
Understand how JUnit affects your perspective on development and increases your focus on a task.
Good JUnit coding style.
How to Create well-structured JUnit programs.
How to Compile and execute programs using JUnit and DBUnit
How to extend testing with mock objects using Mockito.
Refactoring techniques available to make code as reusable/robust as possible.
Various testing techniques.

1
  • Introducing Test-driven Development

  • Rationale for TDD 

    The process of TDD 

    Advantages to TDD 

    Side-effects of TDD 

    Tools to support TDD


2
  • UNIT TESTING FUNDAMENTALS

  • Purpose of Unit Testing

    Good Unit Tests

    Test Stages

    Unit Testing Vs Integration Testing

    Understanding Unit Testing Frameworks


3
  • JUMPSTART: JUNIT 5.X

  • Understand and work with the features of JUnit

    Write unit tests using @Test annotation

    Test Result Verification (Assertions)

    Manage fixtures using @BeforeEach, @AfterEach, @BeforeAll and @AfterAll annotations

    Maven setup using Surefire plugin


4
  • ANNOTATIONS

  • Use @DisplayName to specify a custom name for the test

    Check for exceptions thrown by test

    Use @Disabled to prevent a test class or method from running

    Use timeouts to fail test that take longer than required

    Test Execution Order


5
  • HAMCREST

  • Learn the notation of assertThat

    Know the objective of Hamcrest library

    Use Hamcrest's logical and object matchers

    Use Hamcrest's number and collection matchers


6
  • PARAMETERIZED TESTS

  • The @ParameterizedTest annotation

    A parameterized test to test code under several conditions

    Define different sources for test data (@ValueSource, @CsvSource, @CsvFileSource,@EnumSource, @MethodSource, @ArgumentSource)


7
  • ADVANCED FEATURES

  • JUnit 4 vs JUnit 5

    Nested Unit Tests

    Repeated Tests

    JUnit Extensions

    ExecutionConditions

    Lambda Support

    Grouped Assertions


8
  • JUNIT BEST PRACTICES

  • "Good" Tests

    Bad Smell

    White-Box Unit Testing

    Black-Box Unit Testing

    Automation and Coverage


9
  • MOCKING OF COMPONENTS

  • Why We use Test Dummies

    Mock Objects

    Working with Mock Objects

    Using Mocks with the User Interface

    Mock Object Strategies


10
  • MOCK OBJECTS AND MOCKITO

  • Mockito Description and Features

    Mockito Object Lifecycle

    JUnit 5 and Mockito Dependency Injection

    Stubs Using ArgumentMatchers

    Verifying Behavior in Mockito

    Partial Mock Objects

    The Spy annotation


11
  • POWERMOCK

  • PowerMock Description and Features

    Using PowerMockito

    @PrepareForTest

    Mocking a final class or final method

    Mocking a Static Method


12
  • STATE-BASED VS. INTERACTION-BASED TESTING

  • State-based Testing

    Interaction-based Testing

    Mock Objects Support Each Approach

    Three Areas to Check in a Test

    Lab: Interaction-based Testing


13
  • IMPROVING CODE QUALITY THROUGH REFACTORING

  • Refactoring Overview

    Refactoring and Testing

    Refactoring to Design Patterns

    Lab: Refactoring

    Lab: Best Practices - Refactoring Tests


14
  • Database Testing: DBUNIT

  • Setting up DbUnit

    Defining a Dataset File in XML, CSV or Excel

    Writing a DbUnit Test Class

    Assert the results

    Use the FailureHandler and ValueComparer

    Using Date and Time in test sets

    Export a data set


Audience

This programming course is for students with hands-on Java development experience. Attending titles may include Software Developers and Programmers, Agile Practitioners, Quality Assurance Professionals, Software Testers, Product Owners, Project Managers, IT Managers or Software Engineers.

Language

English

Prerequisites

Students should have development skills at least equivalent to the following course(s) or should have attended as a pre-requisite: TT2104 Core Java Programming for OO Experienced Developers – 4 days

$1,995

Length: 3.0 days (24 hours)

Level:

Not Your Location? Change

Course Schedule:

Schedule select
13
Nov
Monday
10:00 AM ET -
6:00 PM ET
Filling Fast
Available
Loading...