There is still too much code without automated tests in place. It is a pity since automated tests are the foundation that safely enables rapid development.Read More »6 tips for creating tests for your code
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
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 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
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