[wp-hackers] User Feedback and Testing

John Joseph Bachir jjb at ibiblio.org
Mon Jan 2 01:05:21 GMT 2006

On Mon, 2 Jan 2006, David House wrote:

> 2. Old bugs come up again. Due to WP's history, looking at the code 
> sometimes looks like it's a hangover from the old b2 days. Lets face it, 
> WP's code isn't as nice as, say, Wikipedia or Gallery. It's improving, 
> but it's still very coupled. New fixes tend to rebreak old bugs. That's 
> why I think we need some kind of regression testing. I'm not sure how 
> this would be embodied, perhaps through automated testing (although that 
> would require a BIG shift in the WP development paradigm -- there's no 
> point doing automated testing if you don't do test-driven development), 
> perhaps through ruthless human testing. Whatever. We need to make sure 
> that once a bug is fixed, it stays fixed.

I once sat down to try to write a unit testing suite for WordPress, but 
soon realized what a difficult task it would be, due to [1] the coupled 
code, aka lack of separation of presentation and business logic (if I 
understand what you mean by coupled) [2] the unbridled use of global 

I hope to eventually put together an integration testing suite (at the 
browser-interaction level-- simpletest has good facilities for doing 
this). Which for many functions is basically what a unit testing suite 
would be, given the amount of environmental initialization that needs to 
be performed before each test.

I think an ongoing goal of WordPress should be moving toward a more MVC 
and OO model. Which isn't to say that a purist MVC model is necesarily 
ideal for this project. But just decoupling the business code from the 
display code, and trying to cut down on global variables, would go a long 
way in terms of code stability and maintainability.


More information about the wp-hackers mailing list