Sunday, February 18, 2007

Catching up on testing....

I've been delinquent about keeping up with this. You'd think that with simple few-sentence updates, I'd remember to keep a log, but no. I'll have to reconstruct much of the past week from memory.

So, when I left off, I was just getting Emacs running again with VMWare. My next priority was testing.

I setup a MakeFile with some really simple phony targets - one to clean out all the .pyc and ~ backup files, one to run the built-in server for development, and one to run all the unit tests. I think this was Friday or Saturday a week ago. I do remember that I had no demo for last Sunday's conference call - I was still working on testing and refactoring.

Testing was a little tricky. I had to figure out twill - I think that was mostly last weekend, and the week before last. I'm beginning to love Python's dir() and help() functions - there's no complete API reference twill, but it has great docstrings. From there, I had to integrate it into doctest (I punted on unittest because I really hate xUnit-style tests; they require so much boilerplate code that I find myself ignoring the unit tests anyway). Never did get doctest.testfile() working; instead, I wrote a script to walk all the source dirs, turn the Python file into a module name, dynamically import it, get a reference to the module via globals().__dict__[modulename], and pass it to doctest.testmod(). I also wrote a twilltest helper module with some assertion functions that I wanted to be able to use for tests, and then added it to the doctest scope via extraglobs. This was done throughout most of last week; I wrote the helper functions as I needed them for specific tests.

After the meeting last Sunday, I spent the day coming up with usability personas. I think they're a good thing to have; as we design new features, it's nice to be able to say "David needs this" or "Katie won't use the site if we can't do this." They've already helped illuminate some conceptual muddiness.

Last weekend, I also moved things around so that all controllers live in one directory in the www directory, and pulled lib (helper Python files) and templates (HTML) back to the top of the trunk. The main entry point (main.py) and the unit testing script (runtests.py) were moved all the way to the top level. Still not sure if this is the right organization; there will likely be further changes as the program grows.

While I was at it, I had the request dispatcher auto-detect controller classes (through looking in www/controllers) and construct the URL list itself (through looking at the exported url_pattern global). My svn log says this was last Tuesday, 2/13. Python's dynamicity is fun.

You would've thought that with Wednesday being a snow day, I would've gotten more done, but no. I was working on stuff for my real job (from home) almost all day. And then on Thursday I had to shovel. Finally finished the unit testing framework on Thursday night, while watching Grey's Anatomy, and these last couple days have involved writing more tests for front page, logins, sessions, etc.

Am working on integrating James's rough cut at a layout now. If I get that done, I may take a crack at comments.

1 comment:

shopping online said...

Adsense of Jordan Shoes : just do it!
Adsense of Moncler Jackets : sends to warm, give you more comforts of life!
Adsense of NFL Jerseys : everything is possible!
Adsense of Christian Louboutin : choice me is choice beautiful foot and body!
Adsense of Puma Shoes : champion is in the first line!
Adsense of Gucci Shoes : Allows you to enjoy the leisure life in the fun!
Adsense of Vibram Fivefingers : taste original life, wear the most morden and comfortable shoes!
Adsense of GHD Hair straighteners : why make our hair so beautiful and lots stylers, for choice me is choice happy!
Adsense of Michael Jordan Shoes : just do it!