Java Test Driven Development with JUnit 5

Training Summary
Test Driven Development (TDD) has become a standard best practice for developers, especially those working in an Agile development environment. TDD is a team and individual code development discipline which, when followed correctly, increases the productivity of both individual developers and entire teams. From the programmer’s perspective, TDD has another benefit – it allows programmers to eliminate the tedious tasks of debugging and rewriting code so that they can focus on the creative work of designing and writing code. It makes programming fun again. The course focuses on two main topic streams. The first is how to start using the TDD process and inte-grate it into code development or maintenance activities. The best practices for TDD are covered in depth including explanations on why these are best practices. This stream concludes with an introduction into the practice of how TDD is used to refactor and improve existing code as well as code under development. The second stream is tool oriented. Students learn the features of the new JUnit 5 tool through a hands on exploration of the framework, as well as exploring some of the common assertion and mocking libraries. The class is designed to be about 50% hands on labs and exercises, about 25% theory and 25% instructor led hands on learning where students code along with the instructor. The course closes with students developing an action plan for implementing what they have learned in class into their own development environment.
Knowledge and experience in Java is essential for understanding the course material. No experience or background in software testing is required.
3 Days/Lecture & Lab
This course is designed for intermediate level Java programmers.
Course Topics
The TDD process - “red, green, refactor”
  • Eliminating technical debt with TDD
  • Why TDD works
  • Integrating the TDD discipline into a development activites
  • TDD and programming and design best practices
  • Developing a TDD project using JUnit
  • JUnit 5 concepts, architecture and features
  • Assertion libraries (hamcrest and AssertJ.)
  • Using mocks effectively
  • Mocking libraries review (Mockito, JMockit, EasyMock, etc.)
  • Best practices for developing good test cases and test suites
  • Best practices when using TDD and JUnit to improve development
  • Code smells and refactoring
  • Using TDD to refactor code
  • Migrating to TDD as a programming discipline

Related Scheduled Courses