Tuesday, June 29, 2010

Outdoor office with hammock vs. cubicle

So Stefan Silke popped in for a visit from Amsterdam. Johannesburg is a nightmare in winter. Jozie winters suck. It's cold and dry and I can hardly entertain a guest there. A road trip down to Cape Town was the first bad idea and considering the weather and sordid winters I started leaning east and north. It also soon became apparent that Stefan was doing quite a bit of work and so was I. Mtunzini here we come.

We're chatting about his business and the pains he suffers as a result. Recruiters generally suck. I dread encounters with recruiters. They're an awefull bunch. Silly buggers out for a quick buck. So clumsy and impersonal. Often downright incompetent. Not all though. There are exceptions that prove the rule. And Stefan is that exception. Connecting the dots. The best people for the best jobs, establishes crystal clear focus. Add a city, Amsterdam, an industry, IT and a role, recruiter with integrity who so happens to be a programmer as well. Made me reconsider my job as a software programmer to one of life hacker. He so happened to also be the first person to send me a lifehacker.com link.

It's winter here too. Between 20 and 31 degrees celcius. While it is summer in Europe when it is certainly at it's best. And my friends there exclaim their joy at lesser temperatures. Hanging in a hammock in the forest here looking at some Zebra in a small grass field while working just feels so much better than sitting crouched over a keyboard in a cubicle at a desk. I guess it's each to his own. Different folks for different strokes said Alec. The hammock seems to have the perfect ergonomic design. It's just a matter of sliding into the right position. Life is a treat. Thank you Anton and Diricia for running telamenta.com and making this possible. And thank you Stefan Silke for hacking life and giving us thewhitedoor.com. And the inspiration to have a go at it myself.

It's lovely to have 3g mobile broadband in South Africa and screw the @#$%*&! who are responsible for making it so expensive. Liberate us from such oppression. why is it so much cheaper in other parts of the world?

So, I am off to walk a friend's dogs and then cook something for whoever is in ;) Indulge in the wonderful state of affairs while it last.

Monday, June 7, 2010

Address project risk with testing starting from the top

So we have a website that grew to some size and I need to manage my risks on that system while cowboy young developers explain to their superiors that the code should be difficult to read because it was difficult to write. Yes, totally organic stuff.

I need something quickly to start with. Hello Selenium. Quickly run through a few scenarios. At least the main cases to start with. Hey , wait, let's teach a tester how to record their tests and ask them for a copy. Voila. And then run that test suite after changes to confirm the system state.

It would actually be nice if I didn't have to sit here and stare at the screen while these macros play their way through all the clicks and form submissions. Let's automate it.

It's a Drupal website and it is always a good idea to search for something related to drupal as there just may be a module for it already. And so it is. On Drupal 6 install the examples module with drush and enable the simple test module. Voila, with some example tests and, hey looky, some modules have tests on the admin page at http://mydrupalsite.bom/admin/build/testing. Where do they come from? Select a few tests and run them. Beautiful. I'm getting a warm and fuzzy feeling around my heart.

Quickly write a test. Translate the Selenese to Simpletest and voila, it does not work. Simple test like other test frameworks are spawned from the testing realm and there are some ideas you have to subscribe to and they all make sense and we will get there while right now i just want to run tests against the test site on the highest level. And I can use the scripts I get from testers easily. It will take a bit of modification to get the assumptions ironed out of simple test and I should perhaps do that as soon as I have some extra time on my hands

In the meantime export the selenium scripts to Java code, write a class and call that ever so often. Convert the Selenese to Webdriver so we do not have to worry about browsers crashing or bothering our screens. Junit have those asserts and the reporting is convenient. Hudson presents the test results conveniently and has a nice interface to run the tests from and keep track of their trends. And Bob is your auntie. Hudson picks up the changes in my git repository and runs the tests. I can get an email of the reports and see who changed what and what the results was. Beautiful.