8/8

•August 8, 2009 • Leave a Comment

Things are coming along quite satisfactory. Over the past week, I’ve been adding more tests to the package, and fixing various bugs and other issues that have been cropping up with the package’s first live install online (a pretty exciting thing to see).

The next week? Google recommends that our ‘pencils down’ date be soon, so I’ll be adding some more tests to the package and going over everything to make sure it’s in order. Adding to the documentation explaining just how the system works would help too, as the instructions for using the testpackage in the README don’t offer much insight on how the suite actually works.

7/25

•July 25, 2009 • Leave a Comment

What a mess! My computer unexpectedly died, leaving me with no other option but to buy a new one, get it rush shipped to me, and come up with creative ways to scrounge my files from the old one. After an irritating couple days, all my programs and files seem to back in place and running.

The framework changed structure a little bit, mostly to allow for a more complex logging system and easily allow mini-scripts to be plugged into it.  This makes it simpler to understand how the GUI works, and makes it possible for automation scripts to run from cronjobs or a task schedule – just about any action that you could want to use on the framework is possible. The GUI has gone from a simple tool for convenience to the control center for logging (saving, loading, deleting) and testing – not to mention it spawning something of an API for the test framework.

The only other addition I’d like to make to the GUI is having a text input box that you can use instead of the console, since PHPUnit offers quite a few console options that would be great to have in conjunction with the framework’s logging and output system.

So for the next week? Implement that feature (shouldn’t be difficult at this point), and give the actual test suite some more meat on its bones.

July 11

•July 12, 2009 • Leave a Comment

Things got complicated this week. I took a break from writing unit tests, and decided to finalize the package structure. Unfortunately, this turned into an endless cycle of “Oh, I’ll do this… and this needs that…” – but the end result is that the way the package handles running tests and logging/showing results is much better off. The GUI interacts with a class that runs tests, with plenty of easy-to-implement options for different scenarios that we might want (a cronjob to run the entire suite was in mind). In addition, I switched the logging system from XML to JSON – after enough tests are written, the XML files would devour too much memory to parse and deliver. The GUI is turning into a more program-like interface than a few happy javascript hacks; as we’ll be able to load any historical test’s results (stored in a master log) to view in it, even if we aren’t running a test.

This week, I’m planning to finalize the GUI (completely, this time) and write a few simple scripts that a task scheduler or cronjob can run, bringing this project into adulthood. I’ll need to look into PHPUnit’s listener classes more, but if one can easily be implemented in the structure I have, it would be great – then we can have live output of test results in the GUI (right now, it’s hard to tell if the test processing froze, failed, or is just merrily thinking). The README can also use a final go-over, as the structure shouldn’t be changing after this week, and more information is needed for other developers to work with the suite. Then, back to the dark recesses of lib-common it seems….

June 30

•June 30, 2009 • Leave a Comment

Finally, the package is all bundled up and ready to go! It has a fully-functioning GUI (using ajax and a spiffy loader, mind you), a pure PHP version as a fallback for those who disabled javascript, and properly configured paths. Now, all it needs are a lot more tests…

Lib-common is ready for testing, a complete dummy environment has been set up for it to run. Over the next week I’ll be working on testing what I can – it’s proving quite difficult. The code is procedural, and doesn’t have much clear output to test (understanding what one of the functions expects and outputs is proving to be pretty complex). Nonetheless, we’ll see what clever hacks I can come up with.

June 20

•June 20, 2009 • Leave a Comment

The past week has been quite productive. I was able to work an XML database and class easily into a few test classes for a library file. Thursday night I had (another) programming dream, woke up Friday, and realized the dummy install structure I had for the package wasn’t secure at all on any live Geeklog install (the tests and databases were all in the public_html folder, while they would need to be outside the webroot to be safe). The configuration structure and GUI I had set up didn’t allow them to be easily moved outside.

Speaking of configuration, in the next week I’m considering looking into creating an install script for the package. Right now, the user only needs to open 3 files and configure 6 paths… but given the extremely fickle and securely delicate structure of the package, it will probably save people a lot of head-scratching if a script puts things together for them, especially if they aren’t Geeklog developers.

My main goal for the next week is to begin the assault on lib-common. I’ve spent some time poking around and trying to understand what’s happening and why, but without too much luck. My mentor mentioned that this was one area he would like to see tested, however (for obvious reasons: it appears to be the core of the CMS). Once I understand what’s happening in it, Geeklog won’t hold many mysteries for me, and I’ll be ready to write the much-needed documentation for this test package. In addition, any serious design flaws in the package right now should be exposed while working through lib-common – which will save me the trouble of reorganizing the package later, restructuring paths and calls, and rewriting documentation.

June 16

•June 16, 2009 • Leave a Comment

Another late update.

Things have gotten more complicated in the last week with my shift to the more complicated classes. The need for a completely portable SQL independent testing package has driven me to try integrating an XML dump of the Geeklog database with the testing package. This offers a few benefits; one is that XML has a relatively simple structure that PHP handles very well with simpleXML and XPath. Once the class that I’m working on (handling XML ‘databases’ with simple commands) is finished, I’ll be able to put a variety of XML databases with different configuration values with the test packages to test a variety of situations in a much cleaner way than say, stubbing every function and test class. I’ve also created a simple GUI for PHPUnit and Geeklog, because the configuration of the tests package has some quirks that would make it a hassle for any developer or client to work with otherwise.

It’s looking like progress on actual code coverage may be slower than I expected; the concepts of PHPUnit are simple, but difficult to integrate in the environment. Hopefully things will speed up once I finish work on the XML connections and have a better understanding for Geeklog’s organs,  but I’m pretty impatient right now. Given that my project’s focus is primarily setting up a testing framework, I’m focusing most of my attention on that right now. Other developers will probably be more efficient at testing the code than I am currently, but we might be equally matched in the actual effort put into setting up the system.

In the near future, I’m planning on putting out some documentation on PHPUnit basics and how the developers will be able to use it with Geeklog. I’m also looking into the possibility of rewriting the database classes to work with XML, and finding a way to trick Geeklog into using those in the testing environment (rather than interacting with the database simply to retrieve cleaner stubs).

Nonetheless, it’s fascinating (to me) work, and I’m thoroughly enjoying it (although it definitely does have an acquired taste). I’m quite excited about where this test package is going – it’s something like watching your child grow and mature as you invest yourself in their life. Perhaps?

June 6

•June 6, 2009 • Leave a Comment

More of the same for this week; a few more system/classes down, and the same ominous environmentally complex challenges looming in the near future.

Once I’m done writing a test for one particularly beastlyfunction in the current class I’m testing, I’m planning to test one or two more of the more complex classes to get a solid feel for what I’m doing, and then put together some sort of documentation for the other developers. After all, if they understand the need and have the ability to write their own tests, it will save me or whoever continues testing the code quite a bit of time, trying to comprehend what specific functions are supposed to do. Unfortunately, the documentation is going to need a hefty section on adapting PHPUnit for tests in the more complicated areas of code – which I’m still relatively inexperienced with.