Test-driven Development in JavaScript Workshop

JavaScript TDD Web

Test-driven development is one of these practices that seem deceptivly simple, and yet have a profound effect on how you build software and approach problems. Would you like to build quality into software from the very start, write code that is easy to maintain and have confidence to make big changes in your codebase? Have you ever tried TDD before and felt stuck and unproductive? Struggling with fragile and hard-to-maintain tests? Dive into the world of Test-Driven Development with this practical two-day workshop. Upon completion, you will understand the forces that helped shape TDD and experience its benefits first-hand.

Learn how to

  • Design and build software driven by tests
  • Prevent defects in your code
  • Be confident when refactoring and evolving design
  • Gather quick and early feedback by "listening" to your tests
  • Use test doubles (stubs, mocks and fake objects) to focus your tests
  • Apply best practices of TDD
  • Avoid common pitfalls of unit testing

Programme

  • Why and how of TDD - red-green-refactor
  • Introduction to Jest
  • Use unit-tests to capture requirements
  • Types of verification (results, state, interaction)
  • Focusing your tests
  • Control indirect inputs with stubs
  • Verify interactions with mocks
  • Write efficient tests with fake objects (time, http)
  • Improving your code with refactoring
  • Testing UI
  • Testing asynchronous code
  • Dependency injection
  • Ports and Adapters/hexagonal architecture
  • TDD best practices
  • Common unit-testing pitfalls

Audience

This workshop is designed for experienced Web Developers designing, creating and maintaining rich web applications. It will help you build quality into software from the start and bring you up to speed with modern software development practices.

Prerequisites

To get the most out of the workshop, you should have hands-on experience with JavaScript and software design.

Labs & Exercises

This workshop is a combination of lectures, discussions and practical exercises.

Installation Guide

  • Workstations with internet access
  • Git client
  • NodeJS 10
  • Google Chrome (or any other modern browser)
  • Visual Studio Code (or any other text-editor/IDE)

This is a BYOD (bring your own device) workshop.

Tid

09:00 - 16:15