News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

NetTuts.com:
Refactoring Legacy Code Part 9 - Analyzing Concerns
July 24, 2014 @ 11:27:56

The NetTuts.com site has posted part nine in their series sharing helpful hints and methods for refactoring legacy code. In this new post they continue on with their example application and look at where methods should be moved to/created and mocking in their tests.

In this tutorial, we will continue to focus on our business logic. We will evaluate if RunnerFunctions.php belongs to a class and if so, to which class? We will think about concerns and where methods belong. Finally, we will learn a little bit more about the concept of mocking.

They show how to move some of the "Runner" functions from procedural to OOP, integrating them with some of the classes and methods that already exist. Tests are also included showing how it all links together. From there they get into concerns about the placement of functionality and how that relates to the work at hand. They also use Mockery to mock out some of the needed objects in their tests for the new structure.

0 comments voice your opinion now!
refactor legacy code series part6 concerns functionality mock unittest

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-9-analyzing-concerns--cms-21760

blog comments powered by Disqus

Similar Posts

Volker Dusch's Blog: Setting up Hudson for PHP Projects in 15 minutes

International PHP Magazine: Poll Question: What Is the Best Way to Do QA for PHP?

Matthew Weir O'Phinney's Blog: File_Fortune refactored

Sebastian Bergmann's Blog: PHP Has No Culture of Testing

Michelangelo van Dam: Look mama, no databases


Community Events





Don't see your event here?
Let us know!


release library opinion install series api laravel update community package zendserver interview introduction symfony deployment framework podcast tips language list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework