Evolutionary development

For many, the goal of software engineering is to turn a set of requirements into code. Equally important is checking that the code you’ve written actually does implement the requirements you have – this is the point of testing, and is an area which I think, especially in open-source projects, is neglected, or not done to a sufficient standard. This is part of the reason I’m writing Arete.

A few months ago, I attended an interesting workshop on test-driven development by Kevlin Henney, which introduced the idea of thinking of unit tests as requirements specified in code – from what’s defined in a unit test you can infer the interface for a class, and automatically generate the stubs for the class. This is nothing new, even Microsoft’s Visual Studio can do this nowadays. From a unit test, you could also infer the behaviour of the class too, I mean, that’s kind of the point of a unit test, to define the behaviour of the class.

So if we can infer the interface of a class from the unit test, can we also infer the body of the class? This is a more interesting point, but possibly nonsensical, as a bug in a unit test would result in a bug in the automatically generated application, whereas bugs in a unit test are quickly spotted using the red/green/refactor method, because if you think you’ve implemented something correctly and the unit test fails, it gives a flag to check the unit test. Still, with a comprehensive set of unit tests in addition to integration tests, if one had a bug in it, then the resulting requirements definition may be impossible, or never pass.

Still, we have the problem of how do we automatically generate the method body, etc… A possible way to do this could be using genetic algorithms. Now I must admit, this isn’t an area I have much experience with, or are particularly familiar with. We have obvious fitness indicators – the passing or failing of unit tests, but it would need a particularly clever method to be able to generate code, or a lot of CPU time…

I do think it’s an interesting problem though, maybe it’s one I’ll solve one day too.

No comments.

Spending and America!

Okay, so I may have lied when I said I was going to do a vlog. Honestly, I was intending on doing one but then I got distracted and never got round to doing it.

Never mind.

So, countdown to America now :) This time in two weeks I’ll be on the final leg of my westward journey – the plane from Philadelphia to Los Angeles. I’m really looking forward to it now. I bought my travel money today:

Travel money

$280 in cash, plus $880 on this mystical thing called a travel money card, which appears to be a bit safer than carrying lots of cash with me. :)

I also bought a new wallet, and a new bean bag:

Float bean bag

(she isn’t included unfortunately)

£47, absolute bargain in my eyes, especially considering how big it is – 180 cm x 140 cm, and filled with 14 cubic feet of Fire Retardant, virgin quality EPS bead :) Sumo ones are at least twice the price, and this is manufactured in the UK!

Also, went for my final checkup today at the Fracture Clinic, and I’ve been completely discharged – saw an Xray of my plate too, might try and get Dad to get me a copy. Just need to do another 6 weeks of physio at home and I should hopefully be back to normal :) Sad news is that the plate won’t be coming out, it’ll be staying in there forever. Which is quite a scary thought.

No comments.

Offline CMS

One of the things I’ve been up to this summer is website design. I’m being paid to design a website for a local primary school in Doncaster. Now normally I’d use some sort of CMS to manage the site, but in this case this is impossible, as the webspace the school has doesn’t have any server-side scripting support.

So to accomplish the task without having to maintain a million HTML files with lots of duplicate template code, I’ve written a simple offline CMS in Bash, which takes some template files (in the form of a shell script which defines some variables) puts that into a template, and inserts a navigation bar.

It’s pretty simple, but it took me a few hours, so if anyone ever needs to do the same, feel free to use mine. I’m licensing it under BSD, so feel free to enhance it if you wish. The Bash script generate.sh has the template and config in it (just move the variables and the sitemap backticks), and the Tcl script sitemap.tcl is the logic for generating the navigation bar. The file sample contains a sample format for a template file (all your files must end in .tmpl to be considered. The order of the pages in the navigation bars is decided by the name of the .tmpl file, so you can call them 00index.tmpl 01subpage.tmpl to have a specific ordering in your navigation bars)

Download Offline CMS
No comments.

re: Pulled Snickers Ad

This is kind of a response to Stephy’s blog on the Mr T speedwalking ad at http://shylilsweety.blogspot.com/2008/07/pulled-snickers-ad.html.

Just read an interesting article about the Snickers ad – basically no LGBT groups in the UK complained, and the ad was only pulled because of pressure from the US. Surely if something targeted a British audience is seen as inoffensive by that target audience, it’s wrong for a completely unrelated third party to barge in and demands its removal?

I also found this highly amusing – there’s a group in the US called the “Human Rights Campaign” – which claims to represent LGBT rights. They then published this press release: http://www.hrc.org/10880.htm, which is absolutely hilarious. “speed walking in an exaggerated manner – conjure up stereotypes of gay men”. I’m sorry but what, since when has speed walking ever been linked with a “stereotype of gay men”? Certainly never in the UK where the ad was created and published. As someone who has occasionally speedwalked I find the suggestion that the activity is “gay”, and surely it’s completely inappropriate for a supposed LGBT rights group to be creating these stereotypes.

We all know that America is a far-right, near-facist state with very conservative thinking, who reckon themselves to be the “world police”, but when ad created in a centrist country for a more liberal audience is pulled because of offence from some conservatives in the States, what’s the world coming to? Next thing you know having photos of women not wearing hijabs in Rimmel commercials will be pulled because it offends Iranians.

The advert in question:

No comments.

France blog

(Edit: After being threatened with legal action, I’ve removed the bulk of this post)

For the last few weeks I’ve been in the Aveyron in France, enjoying some downtime after finishing at Sophos and starting the next year (although I have ended up with a big stress, more on that in a bit), but whilst I’m at my parents house, there’s always a few jobs that need doing, this year my main job has being added Sky to the “yellow room” (a task now completed!), a task not made easier by one hand being in a splint. However, today I’ve been helping my Uncle Keith sort out a blockage in one of the upstairs toilets that meant the water wasn’t draining very fast.

This is where the text was removed – it included speculation alongside facts and I unfortunately did not make a clear distinction between the two, which I apologise if it was misleading. I’ve discussed this further, in a more recent journal entry

So, just a warning if you’re planning on renovating a property in the Aveyron or Tarn – I will not be recommending using Patrick Paul Porter.

Anyway, moving on to my other stressful situation, it seems I may have failed the year, because I didn’t have a signature on some of the forms I needed to fill in to get my industrial placement accredited (the reason I didn’t get them signed is because my manager from my stint as a tester left Sophos, so I assumed it’d be okay). Then I got an e-mail a week ago telling me it wasn’t okay and I couldn’t be accredited. So I had to print off fresh forms, post them to Sophos HR who will sign it on behalf of my test manager, who then post it to Gus at the CS department. Sophos received and forwarded the forms on Friday. The accreditation board meet at 11am on Monday, so I just have to hope the corrected forms arrive by then. Otherwise I’m screwed. Royal Mail, please don’t let me down…

I’ll do another vlog soon too.

2 comments.