TDD and the Art of Unit Testing in JavaScript with Roy Osherove

Unit testing, done badly, can hurt your project more than it helps. In some cases, it may lead to project schedule delays, and unhappy developers due to huge maintenance problems. But when unit testing is done right, it can help the project and developers’ confidence immensely.

The challenge is - how do you do it in a way that is helping, rather than hurting your project? 

In this coding-packed course we will learn essential test driven skills and techniques for writing unit tests in a readable, maintainable and trustworthy fashion, so that we can feel more confident in our code, make it simpler, and save ourselves time in debugging and maintaining our code base. We will also look at some code design issues that hurt testability. 

  1. Learn how to write readable, maintainable, trustworthy unit tests using JavaScript and node.js.

  1. Learn how to refactor code, and SOLID design concepts. 

  1. Learn the principles of Test Driven Development, and develop new features using TDD. 

  1. Learn how to Pair Program, and experience it throughout the course.

  1. Learn about mocks, stubs, spies & fakes, and the difference between them.

  1. Learn about testing frameworks such as jest and Jasmine, and isolation (mocking) frameworks like sinon & jest mocks. 

Detailed content

Day 1: Beginnings 

  • Units, entry points & exit points. 
  • The first unit test & a continuous testing environment 
  • Jest basics & Drills 
  • Writing readable, maintainable tests 
  • Test Driven Development Introduction 
  • String Calculator,Password Verifier Kata Drills 
  • Value based, State Based and Interaction Based Tests 
  • Fakes, Spies Mocks and Stubs 
  • Hand Written Fakes, Stubs and Mocks  
  • Faking Time & Drills 

Day 2: Mock Objects and Stubs 

  • Faking other dependencies & Drills 
  • Jest.fnjest.spyOn and other creatures 
  • Async in Tests & Drills 
  • Callback refactoring & Drills 
  • Faking whole modules & Drills 
  • Unit Testing Good Practices 
  • Code Review Drills

 

About Roy Osherove

Roy is the author of "The Art of Unit Testing", "Elastic Leadership" and the "Enterprise DevOps" books. He is an independent consultant working across Europe caching about TDD, Leadership, DevOps, and everything that is needed to make those three tick. 

Target Audience and Prerequisites

This course is intended for web developers. The prerequisites are: 

  • Expected developer knowledge in node.js or frontend js development (angular/react/vue etc.) 
  • Visual Studio Code, IntelliJ, Webstorm or other JS enabled IDEs 
  • JS ES2015 syntax knowledge 

This course is taught in English. 

Boka kursen

Boka din plats redan idag.

Om kursen

Pris: 20 450,00 kr

exklusive moms

Längd 2 dagar
Kurskod MC063
Boka kursen

Välj ort och kursstart

26 mars

Kunduppgifter

Kursanmälan är bindande. För mer information och avbokningsregler se våra allmänna villkor.