You’re writing a PHP application. You know you need to write tests. Tests aren’t something that comes naturally to you yet; you’re still working on learning the ins and outs of PHPUnit (the default standard framework). But you know that right now, your app isn’t testable. What can you do to make it testable?
Thursday, April 4th, 2013 @ 8:00 am | Comment (3) | Categories: Best Practices, Object-Oriented Development, PHP, Testing
You’re ready to start testing your application. But there’s a problem: the application is a legacy application, or based on a framework. The code is rickety and the level of the code is less than S.O.L.I.D. Is it possible to correctly unit test the application? You want to have certainty that fixing one bug won’t produce another. How do you move forward?
For a few months now I offered Five Tips For Developing Awesome Software. These tips start with an admonition to “test everything”. This is important, because unit testing is one of the easiest ways to ensure that your changes in one part of the application won’t break another part of the application. Unfortunately, as one user told me, legacy apps are notoriously bad for unit testing, because they were either developed before unit testing was a wide practice in PHP, or they use frameworks that don’t encourage unit testing at all.
Wednesday, March 13th, 2013 @ 7:00 am | Comment (2) | Categories: PHP, Testing
Anyone who knows me knows that I’m a huge fan of unit testing. At least in theory. Unit testing is something that sounds great, and is great – if your tests are already written. But it sucks if you’re trying to build a test suite. In fact, building a test suite is one of the hardest things a programmer can do. It’s probably why I’m really bad at it (despite my advice to build one anyway).
Part of my problem has always been that I never really understood how to use the tools that are offered by PHPUnit. As a result, I’ve avoided writing tests for a long time.
Monday, March 4th, 2013 @ 10:00 am | Comments (0) | Categories: Software Development, PHP, Testing
|Newer Entries »|