News Feed
Sections




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

Chris Hartjes:
So You Want to Write Tests
December 19, 2012 @ 09:07:26

Chris Hartjes has written up a new post for his site, So you want to write tests, giving a good overview of some of the things you'll need to consider when wanting to move into a more test-friendly development world.

I often get asked for some advice on how to get started with writing tests for your PHP code. It's a fair question, since I am presenting myself as an expert-ninja-rockstar-sensei-opinionated-egomaniac on the topic. I often struggle with coming up with an answer that can fit into the 140 characters available via Twitter, but clearly this is not a good strategy. As an early Christmas 2012 present to all my loyal followers, who put up with my never-ending stream of nonsense and provide a slowly-increasing portion of my income, here are my thoughts on how to get started with testing your PHP code.

He offers a list of suggestions, each with a bit of explanation:

  • Learn how to recognize untestable code
  • Keep learning the language
  • Chain units of code together for greatness
  • Start asking "how am I going to test this?"
  • Stop people from pushing code without proof it's fixed
  • Stop people from doing things manually
  • Stop using tools without test suites
  • Always wonder if you're doing it right
0 comments voice your opinion now!
unittest advice opinion testable application


blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Webinar: Create Secure LAMP Applications

Michael Nitschinger's Blog: Understanding the Lithium Router - Part 2

Debuggable Blog: How To Execute Only Specific Test Methods in CakePHP Unit Tests

PHPMaster.com: Openbiz Cubi: A Robust PHP Application Framework, Part 1

JSLabs Blog: 5 tips for creating high performance web apps


Community Events

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


install api extension opinion laravel5 example podcast xdebug release interview introduction framework unittest community series php7 voicesoftheelephpant laravel library language

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