Session

From Fragile to Fearless: Writing Tests That Last

Abstract
We all know writing tests is important to ensure that our code behaves as expected. Tests should not only ensure that our new code is correct, but they should also serve as a means of detecting regression bugs early.
Most of the unit tests I’ve seen in my previous projects is, however, coupled to the technical implementation, which makes it hard to detect regression issues! Bugs are often introduced while refactoring existing code. Refactoring should be a task to improve the existing code, without altering the functionality.
If our tests are coupled to the structure of the code, we will have to update our tests while refactoring. This change can cause programming mistakes, because we don’t have working tests while completing the refactoring.
During this presentation, I’ll elaborate on two different styles of writing unit tests. We will explore different opinions about the definition of a unit; and we will explore how these opinions are translated into tests. Very often, these tests are called solitary and sociable unit tests.
I will demonstrate the difference with some practical code examples, which will clarify the pros and cons of the different styles of writing tests. But we will also explore the subtle differences between the sociable unit tests and integration tests.
Afterwards, I believe that you will be able to write tests that can survive refactoring the code while minimizing the amount of work to keep the tests running!

Outline
- Introduction
- What is a unit test?
- What is the definition of a unit?
- Types of unit tests
- Demo
- Introduction of UnitSocializer
- Q&A

Wouter Bauweraerts

Full-stack developer @ The Beehive

Olen, Belgium

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top