Unit-test

How to add a Test Harness

Adding tests to an existing code base is not always easy. So, where do you start? In the video, I showcase how to do it using a code kata called the gilded rose. It is complicated enough that you should be able to extrapolate it to the code you are working on.

Read More »How to add a Test Harness

Breaking Dependencies

  • by

In a legacy codebase, there are often a considerable amount of dependencies. It makes it hard to introduce unit tests. But since tests are essential to make changes safely, we need techniques to break the dependencies. In this video, I try to explain how to do just that.

Read More »Breaking Dependencies

Adding Unit-tests to a legacy codebase

  • by

Adding unit tests to a legacy codebase is quite different beast than adding it to new code. It provides some unique challenges.

With new code, we have the luxury to apply principles like test-driven development and make sure the code is designed for testing. In a legacy codebase, we are given the code we must approach it with much more care.

Read More »Adding Unit-tests to a legacy codebase

Integration testing in Python – RabbitMQ

  • by

When testing we mostly think about unit-testing. Even though the lines are a bit fuzzy most agree that a unit-test needs to run without any external dependencies and that it must run fast. In most cases, a unit is a single method or class that we test to see if it gives the expected output. If the unit has dependencies they should be exchanged for a test double/mock to make sure that we only test the logic inside the unit and not the workings of the dependencies.

But we can’t test everything using a unit-test. To expand our test coverage, one way to go is to use integration-tests. When using an integration we want to test how a unit interacts with other units or external dependencies.

Read More »Integration testing in Python – RabbitMQ