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:
How to Write Testable and Maintainable Code in PHP
May 16, 2013 @ 11:53:18

NetTuts.com has a new tutorial posted suggesting a few ways you can make testable and maintainable code in PHP applications.

Frameworks provide a tool for rapid application development, but often accrue technical debt as rapidly as they allow you to create functionality. Technical debt is created when maintainability isn't a purposeful focus of the developer. Future changes and debugging become costly, due to a lack of unit testing and structure. Here's how to begin structuring your code to achieve testability and maintainability - and save you time.

There's a few concepts they cover in the tutorial including DRY (don't repeat yourself), working with dependency injection and actually writing the tests with PHPUnit. They start with a bit of code that needs some work and use the tests to help refactor it into something that can be easily mocked (using Mockery).

0 comments voice your opinion now!
testable maintainable code tutorial bestpractice mock object

Link: http://net.tutsplus.com/tutorials/php/how-to-write-testable-and-maintainable-code-in-php

blog comments powered by Disqus

Similar Posts

DevShed: Databases: Finishing a Listing Service

Brian Swan's Blog: How to Page Data with the SQL Server Drivers for PHP

Michael Nitschinger's Blog: Writing a simple lexer in PHP

IBM developerWorks: Java and PHP technology on AIX - Integrate the Java business application w/ DB2

SitePoint PHP Blog: How to Avoid 404s and Redirect Old URLs in PHP


Community Events





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


symfony tips bugfix release interview list zendserver series framework opinion deployment podcast developer conference laravel language community api library introduction

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