Unit Tests For WordPress Bug Hunt

I’ve been focusing on phpDoc for the taxonomy file and I think I’ll take over for the other files. It would probably help other developers. I’ve known a few times where I had to read the function code and it would had been easier if there were documentation to understand what the function intention was and how it was supposed to be used.

Sure the codex is good in the sense that a lot of the code is “documented” for end users. For plugin developers and hackers, you have to be somewhat skilled to understand the flow of the code. Some of the files are documented, a lot of the important files are not. Depending on blogs and the codex, doesn’t seem optimal.

The Bug Hunts

I already have a unit test in place for four of the ~20 files or so. I’m taking care of the easier files, but I’m hoping to have more coverage and better tests before the final 2.3 Release Bug Hunt.

Which means spending more time on the code coverage. I’ve been thinking of “cheating” with the code coverage by calling a single function in each file. This would give me all of the testable files and the total code coverage and not just for the files I’ve already been testing.

Going through the taxonomy API, I think I can provide full code coverage before the final release, which should be useful for testing any future bug reports. It is easier to build a bug report if everything else is tested than before.

Cleaning Up the Unit Tests

At this point, I’m more concern with completing as much code coverage and test coverage as I can. Making it pretty and acceptable can come later.

Gaining Karma

The unit tests has always been a way to further my knowledge of building Unit Tests and doing so quickly. The karma part is applying it to Astrum Futura and Quantum Game Library.

However, it wouldn’t hurt to write documentation and test suite for WordPress. If WordPress lasts a long time, the Unit Tests would be worth it. If WordPress devs had started it two years ago, who knows how different the development might be today. Who knows what might change in the future. If people see how useful Unit Testing is, more people may adopt it later.

Possibly Related Posts:


Comments are closed.