O'Reilly logo

Test-Driven Python Development by Siddharta Govindaraj

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Techniques to break dependencies

Now that we've seen some techniques to help us understand the code, our next step is to break dependencies. This will help us write further characterization tests. To do this, we will very carefully start modifying the code. All the while, we will try to stick to the following goals:

  • Make small changes that are very unlikely to break
  • Try to change the public interface as little as possible

Why these goals? Because we have a lack of tests, we have to be careful with the changes we make. Hence, small changes are better. We also need to be careful of changing the public interface because we have to go and fix all the other files and modules that use this class.

The Rope refactoring library

The Rope refactoring library ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required