Archive for July, 2006

Testing is fun

I’m way behind the “good development” curve on this, but I just discovered the wonder and power of a good and simple test framework. I’m using SimpleTest, which provides some powerful features that are dead simple to use. I can drive the site programmatically using the real forms, and look for text patterns in the returned pages to make sure I am getting back the right data. I’ve written some test cases to cover the creation of a new account, including various error conditions, and the subsequent changing of account settings.

It makes me excited whenever “the machine” does rote work. Rather than me running through some basic steps to test the site, or even worse not running through them, the machine is doing this for me, very completely and thoroughly, without my intervention. More work for the machine is good.

On about 10 occasions, something new I made broke something old. Now I won’t have to worry about that as much, so long as these tests are run before I upload. It’s very freeing.

Comments

A few new features

I’m productive again after ditching CakePHP and writing my own ActiveRecord classes based on some code I found. So, there are a few things I’ve finally gotten off my to-do list:

1. Copying. You can copy items to other shelves in addition to moving them. Your note is not copied currently, but I’m thinking of having it do that by default.

2. Check all. I finally figured out how to implement “check all” with checkboxes that all have different name attributes. So, on shelves and on search results you can check all the items. This is especially important on the Import page, which can list tons of your imported items.

3. Queuing. I’m moving towards having a real queue for querying Amazon. To adhere to their terms of use, I have to make sure I don’t query too often, and if multiple users are searching, the current implementation doesn’t guarantee that. So, I have to have a global server process running all the time that handles the querying. I’ve implemented the database table and the PHP script, and learned how to run cron jobs on my shared host, it’s just a matter of deciding how the UI should go. Maybe this is only for Import and the regular keyword searching can always happen right away, just to avoid regular searches being delayed by the queue.

4. Five or six fixes to long-standing bugs and issues. Feels great to get rid of these.

Comments