

Refactoring | The PHP Consulting Company
source link: https://thephp.cc/news/2021/01/refactoring
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Test-Driven Development has a Red-Green-Refactor cycle. First you write down your expectation as test code, then you make that test green. Writing code that works is hard enough, therefore we often fail at making it "pretty" at the same time. That is why we often end up with code that works, but is hard to maintain. Refactoring to the rescue.
Martin Fowler explains:
"Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior."
This works great if your code it covered by automated tests. But what if your legacy application has no unit tests? In their live coding session at The Online PHP Conference, Arne and Stefan will demonstrate how to refactor existing code and how to use characterization tests to safeguard these changes.
More about Stefan's and Arne's live coding session
Share this article:
Welcome to The PHP Consulting Company (thePHP.cc). We are leading experts on software development, specifically using PHP and related technologies.
You can find us on Twitter, LinkedIn, and XING.
We speak at conferences, offer best-in-breed training, publish seminal articles, and are available for consulting.
About the authors
Sebastian Bergmann is the author of PHPUnit and sets the industry standard of quality assurance.
Arne Blankerts has solutions ready before others have even understood the problem.
Stefan Priebsch inspires with a combination of new ideas and field-tested approaches.
How to get in touch with us:
- Call us at +49.8171.428058
- Write to [email protected]
-
Send us a direct message:
Your nameEmail
Recommend
-
21
The PHP Consulting Company We wish everybody a merry Christmas and some well-deserved relaxation over the...
-
13
Introduction to OOP Object Orientation is the predominant programming model in professional PHP use....
-
11
Advanced OOP Object-oriented programming is indispensable when applications become extensive. The PHP pro...
-
8
Continuous Integration As part of a raffle by Hanser-Verlag, readers could a...
-
4
Die richtige Software entwickeln. Das Richtige testen. Zum richtigen Zeitpunkt. Mit dem passenden Werkzeug sowie den richtigen Kniffen, wie man es effektiv und effizient einsetzt. In diesem Vortrag ge...
-
11
The PHP Consulting Company Extending PHPUnit Sebastian Bergmann | FrOSC...
-
8
Disintegration Testing March 20, 2014 Software is never perfect. Failures of software make the news and damage t...
-
13
Integration Testing August 25, 2013 One of the most important tasks when testing software is to find a minimum e...
-
7
Trust April 17, 2013 In January, I read a news story about a woman who wanted to drive from the outskirts of Bru...
-
4
Live-Refactoring Refactoring means improving the structure of soft...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK