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

Refactoring

Refactoring is the process of cleaning up code or changing a design using a sequence of very small steps. No new functionality is added or removed during the refactoring process. The aim of refactoring is to make the code better by eliminating some code smell. There are many types of refactoring, from the extremely simple going up to much more complex refactorings. Let us apply some of these to the code above.

The Rename Variable and Rename Method refactorings

These two are probably the two simplest refactorings. The names are self explanatory—the refactoring is to rename a variable or a method. Although simple, they are very important because poor variable and method names are very common code smells.

The following are the steps to ...

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