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.Mer information & fakta
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.
Learn how to refactor code, and SOLID design concepts.
Learn the principles of Test Driven Development, and develop new features using TDD.
Learn how to Pair Program, and experience it throughout the course.
Learn about mocks, stubs, spies & fakes, and the difference between them.
Learn about testing frameworks such as jest and Jasmine, and isolation (mocking) frameworks like sinon & jest mocks.
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.fn, jest.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.