Course Code: tdduntesbesp
Duration: 14 hours
Prerequisites:

Basic knowledge of Java and object oriented programming

Course Outline:

Day 1 : Unit Testing

Introduction

  • types of testing
  • unit testing
  • writing testable code
  • refactoring where necessary

JUnit the unit testing framework

Getting started

  • structuring a project
  • creating test classes
  • annotations
  • basic asserts (e.g. assertEquals, assertThrows)
  • running tests and examining results
  • test suites

Getting better

  • additional asserts e.g. regular expressions
  • code coverage
  • mocks and stubs
  • additional JUnit features : parameterised tests, nested tests, dynamic tests
  • parallel execution
  • reporting

Lot of hands on activities in the sections above

Summary

  • best practices

Day 2 : Test Driven Development

Introduction

  • the origins of TDD (Kent Beck and Extreme Programming)
  • unit testing and TDD
  • challenges in TDD
  • coding principles related to TDD

TDD with JUnit - (participants should have already attended day 1 or have equivalent knowledge)

  • quick recap of JUnit
  • the TDD process
  • the red-green-refactor cycle
  • worked examples - starting simple and getting more complex - (this would be the main content of the day)
  • getting help from AI

Summary

  • looking ahead to ATTD and BDD