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!
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!
Wouter Bauweraerts
The Beehive
Wouter is a skilled Java developer with over seven years at The Beehive. As a full stack developer, he excels at solving complex problems efficiently and always focuses on quality. He is known for his creativity and forward-thinking at The Beehive. He enjoys experimenting with new frameworks and technologies to make the best decisions for future projects.
Beyond coding, Wouter is dedicated to coaching and mentoring his colleagues. He helps them improve by discussing project challenges and opportunities.
In the past, Wouter has also taught programming courses at Karel de Grote Community College in Antwerp. His practical experience and love for learning make him a valuable asset to his team and the IT community.
Beyond coding, Wouter is dedicated to coaching and mentoring his colleagues. He helps them improve by discussing project challenges and opportunities.
In the past, Wouter has also taught programming courses at Karel de Grote Community College in Antwerp. His practical experience and love for learning make him a valuable asset to his team and the IT community.