Thursday, 29 April 2010

Programming Tools: Bugtracking

My final set of requests for a development environment involve the bug tracking system.

The initial observation that I wish to make is that bugs relate to a particular version of code. And that bugs stay with code until they are fixed. This means that bugs are related to the version control system. For any branch of the code, you should find exactly which set of bugs it has, and which bugs remain open. Closing bugs tends to relate to a particular point in a version control system: either "This is the fix for the code" or "This is the point where I verified that the bug no longer exists". When you split a branch, you take the bugs from that point in time - and when you merge a branch back into the main tree - or pick up the changes from one branch into another, you should pick up the changes to the bug database too.

In an ideal system, when you check out a branch onto a local machine, you should also be able to check out a copy of the bug tracking system... which you can make changes to - changes which will be applied when you merge back later. This allows you a full dev environment when away from the corporate network.

Bugs are also related to tests. Tests should be able to generate bugs... these bugs are probably along the lines of "Test xyz fails", providing links to an overnight test failure. Bugs should also be able to say "This test will identify this bug" so that you can get the test system to help verify when a bug has gone.

Bugs form trees (or rather directed acyclic networks), in a similar way to a version control system. For example the test system might generate the bug "Test xyz fails". I might take this bug and want to split it into two bugs "On windows test xzy fails because of foo" "On Linux test xyz fails because of something else". If I were to then notice that I already have a bug about windows failures due to foo, I should be able to merge that bug with it.

Bug entry needs to be easy. Really easy. When a test fails, I need to be able to add a few notes to it and WHAM! thats the bug added. Bugs are a place to store knowledge, and to allow me to find things that are outstanding.

Bugs also need to be integrated with email. I need to be able to send people questions, directly relating to the bug (so that the question, and the response, are stored in the bug). Bugs really are a chat system. This is not a bad thing.

Finally, Bug tracking and todo lists are tightly integrated. So much so, that most developers I know use bug tracking as their todo list. So when I send another developer a question - that needs to show up in their todo list - as an uncompleted part of a bug. And users need to be able to add their own private bugs, and import their emails into bugs to let them keep track of their own tasks.

I've talked about bug tracking for non-IT businesses elsewhere. And this bug tracker needs to support all of that.

Monday, 26 April 2010

Programing Tools : The Test Farm

In my discussions about programing tools, I've talked about there being a farm of build machines, so that builds can run in the background, and so that you always have a working build environment when you need one. The same has to be true of test.

Automated test is something which is more valuable to the software industry than anybody who doesn't have experience of it can imagine. It doesn't replace the test team, but it means they can focus their energies on finding new and better bugs rather than ensuring that old favourites don't rear their ugly heads.

As a developer, there are many things that stop me working. Sometimes its a problem, somthing I have to think about, mull over and ultimately solve. But sometimes I'm blocked by the fact that in order to do something, I first have to do something which is a hassle. Every time I am asked to test on a different platform, I feel that hassle. And I put off the move... on a bad day, I go to the warm (slightly tacky, a smelling of cheap perfume) embrace of the internet.

I wan't this hassle gone.

I want to say "Run this test in this environment" to my dev suite, and tlet the software find an appropriate machine.

And for that I need a test farm - just like build farm, it needs to have a number of daemon equipped machines, which are ready to run the tests I give them (and which ideally are able to clean themselves up totally - they really need to be able to reimage back to a newly installed state if I so wish)

But I also want wrriting tests to be easy. I must be able to go to my dev environment and say "now I want to write a test". It should give me a place to write that test, and appropriate tools to help me produce a working testable system.

Early stage test development is just a matter of setting appropriate applications running, and ammassing output. But I also later need to be able to write code to verify the output is correct.

And once I have tests that work, I need to be able to run them on every platform (perhaps scheduled overnight), and I need to be able to submit them, so that my tests enter the range of tests available to everybody.

Once I have those features, writing tests will be the standard way I choose to begin to develop my software. And as a company we will end up with many many tests.

The advantage of many many tests is overnight testing runs.

Overnight testing runs are really important. And they shouldn't just run overnight. They should run whenever there is spare time available on the test farm, testing every development build the build farm has generated. And they should report to the owner of a tree whenever a test failure is found.

On identifying a test failure, I need to know the history of the issue - has this failure occured before? On my branch? On the main tree? I need the system to binary chop for me, and find the point where the failure first occured. The test system, like the buiold system, needs to be fully aware of the version control system. And these failures should find their way into the issue tracking system. Ideally without my help - because if tests are failing, there is an issue - either with the test or with the application under test.

the test system should also be able to make decisions about the meaing of test failures - if a test begins to fail, that is important. If a test regularly fails intermittantly, that is less important. Tests which always pass need to be tested less often. Tests which regularly pass, but which also regularly break are the most important - every test suite has them, those tests which you recognise are the ones which regularly fail when you change something - the tests which are like a canary in a coal mine sniffing out impending doom. A test suite should be able to identify them and run them the most often, to identify problems as soon as they hit.

Oh, and the test team? Do they all go an sun themselves on the sunny sunny beaches of Acapulco? Maybe. But they have a new role. Because now they not only have a set of tools which make writing tests easier, they also have hundreds of tests being developed for them by developers... tests which migh themselves be buggy. They have a new range of applications to QA. But as tests are simpler applications, programs which can be held in ones head all in one go, they are more able to find the hidden defects, and ensure that the tests provide the QA the main application requires.

[Incidentally, I've ignored UI testing in this article. Thats because, frankly I know nothing about it. Testing that buttons work can be scripted. Testing that an application is usable will take more work. All I can say is that there is scope for manual tests which can be run by an individual with a script and be fed back into the same system. I don't quite know how this would work... consider it a reseash problem, and if you have any ideas, do get in touch]

Thursday, 22 April 2010

Highstreet of Tomorrow

The Internet is killing the highstreet. Specifically it is killing some particular types of shops: the shops which sell a particular type of product that you buy based on its features rather than its feel in your hands.


Because in the days before google, when all we had was fire and that new-fangled wheel thing, people who wanted to buy - say - an SLR camera would go to their local camera shop and ask for advice. Then, having got the advice they would buy the camera. These days they go on the Internet and look for advice. If they find the advice they buy the camera on the Internet. If they don't find the advice, they go to the camera shop and ask. Before going home and buying the camera on the Internet.

No highstreet shops are only good for

Things you need right now
Things you need to look at and touch as you buy them
Leisure shopping

The expert is gone. Almost. Apple Stores are the exception.


Because Apple don't care if you buy things from their shop. If you ask advice in their shop, then buy online, Apple still win. Apple stores are a good deal for apple even if they only break even - the stores don't need to make a profit (though high footfall is a necessity)

So in the future we will see more shops run by the manufacturers of products, in order to provide assistance to people who want to buy their product.

This could be like the Apple store (for, say, canon cameras)
But it could also be a Google cafe (with lessons and tech talks, and free surfing)
Or a Heinz food shop (with cooking demos, and free recipes)

What we won't see in the future are mobile phone shops like "Carphone Warehouse", because they'll all be online. Instead we'll see more Orange stores. And Maybe HTC stores. Just possibly there will also be Android and Windows 7 stores too... Three different approaches, but none of them require the shop itself to make money - the shop is an added extra that you pay for in the price of the product you buy.

Monday, 19 April 2010

Programming Tools: The Build Farm

In my first essay on programming tools I suggested that you take some code, press a button and it builds.

What I didn't talk about was how it builds.

Firstly, it doesn't build on your local machine (it could, if you install the right tools, but that's an unnecessary addition. If you're working locally, you just use your version control system back to the online system to build...). Instead of local builds we have a build farm - a set of one or more machines which include all the tools for building for one or more particular environments. When you hit build, your code is shunted off to the first available machine that can build for the platform you require. The build is performed, and the results are returned.

Actually - its even better. Because this is always happening in behind the scenes, as you type. Whenever it gets a chance a new build of your code is scheduled... so usually when you press the build button the results are instantly available.

And by results I mean build errors and warnings. I mean binaries. I mean all outputs one would usually see from a build. Of course, you probably won't care about the binaries because for most of your development time you'll be using a test farm to cope with these. The errors are the important thing - and they'll be checked into the appropriate point in the version control system so that they are always instantly available

In order to make such a system work, each machine in the build farm will need to have a working build environment installed (its probably best to do this with a VM image, so that making clones is easy). They will also need a daemon process to control the build. Its probably best to think of this as being the build tool - the equivalent of make.

The build tool will advertise itself on the network (using zero-conf or rendezvous or whatever), along with advertising the systems it is capable of building for. Any machine with a tool put on the network will automatically be available to build

I've spent a lot of time thinking about what the ideal replacement for make would be like, but the long and the short of it is, the characteristics of the build system tool won't matter so long as it is possible to only need to rebuild those files which have changed... it could rely heavily on the vcs here, after all, it will know from the vcs exactly which files are different from the last build.

I do think, however, that directory structure is probably not a desirable thing to have. Rather, it should be possible to put files into groups either explicitly, or by smart groups (just as you have smart folders in itunes). A file can be in many groups. When a build tool needs an arbitrary structure, it should be possible to generate it on the fly by moving (groups of )files to the correct locations. This gets over the issues with - say - Microsoft's driver build environment, which only allows two levels of directory structure, and helps where the directory structures need to be different on different platforms. It also helps with version control: at the moment version control systems have to try to emulate every filing system their files may run on, so that permissions and so forth can be replicated correctly. Moving files around is a pain. With this system, everything can fall into build system metadata, and we can provide our own security features (such as restricting changes different code areas to different program groups) if we need them. Of course, build system metadata is stored in a file in version control - so if a file is merged or permissions need to be changed, those changes are tracked like everything else - transparently.

The end result of this complexity is simplicity. Once a build has been set up, it will 'just work' for everybody. If you suddenly need to build for another platform, its just a simple choice of a new platform to see if it works. You can test every platform quickly and easily without searching for appropriate machines and solving 101 build problems.

And because a build daemon is externally controllable - it is no effort at all to use it (and maybe a particular 'gold' machine) for scheduling nightly builds. Or rolling test builds of the code integration branch.

Programmers life is simpler. Builds are easier. Testing is easier. And everyones' lives can be made faster and easier still just by throwing on new hardware. Its a win for everybody.

Thursday, 15 April 2010

Bug Tracking For Business

Lets assume that telecommuting is desirable. Lets also assume that this is going to bring in a new raft of management issue (which is why the current generation are still dragging their feet on the way towards it). One of the biggest issues is visibility

At the moment, managers can manage by walking around, coming up behind you, suprising you and occasionally overhearig what you are doing. They get a good idea of what is going on from the office atmosphere. With everyone apart, communicating by a number of channels, both public and private, they will lose this sense of being in touch.

The IT indisutry is, however, already full of people who don't like to talk. Or see each other if at all possible. And we write tools to keep track of what we ought to be doing - one of the most used is the bug tracking system. Each software bug is entered into the database, passed around between people who take responsibility for it, and eventually it is closed. At the flick of a swithc a manager can see which bugs are still a problem and (by reading comments) exactly how near a programmer is to solving it.

And in the IT industry we have learned to abuse the bug tracking system. Almost everywhere managers add new features to the bug trackign system, as a way of assigning new tasks to programmers. And at one place I worked, an early bug was "We have run out of milk in the kitchen" which later became "we keep runing out of milk and need to find a way to stop this happening"

I was shocked when I heard that other white collar industries don't have anything similar. Sure they have their emails, their outlooks, their calendars and maybe their todo lists, but a simple Way of tracking how far they are on each problem, and of collecting all the information on each task, so that, if they need to hand it over to someone else they can do so trivially, all while being visible to anyone interested is missing.

The problem is we call bug tracking systems bug tracking systems, and orient them towards the sort of tasks programmers do.

While I was wondering about my ideal system for implementing something like Getting Things Done in my own life, it became clear that I wanted all the characteristics of a bug tracking system behind everything. I wanted to create dependencies and to be able to see all open tasks. I wanted to be able to categorise tasks and filter my searching appropriately. I wanted emails to tell me what I needed to do and when.

And I think this would be a superb addition to any office environment, especially one where telecommuting was considered desirable.

Not a bug tracking system (that's too IT oriented) but a Workflow Organisation System. Something which does to bug tracking what Facebook did to email, something that makes it all friendlier and simpler, with all the complexities hidden.

And with one feature that most bug tracking systems miss: the ability to create private tasks for your own use... because that allows you to use it for everything in your life (or your worklife) not just those things a manager wants visibility on. And that makes it something that can become generally useful to everyone.

Monday, 12 April 2010

Bring Back the Gentlemans Club

Working at Google seems to be an attractive proposition - free food, lots of colourful spheres everywhere, smart people. Its the sort of club I could cope with being a member of. But consultancy also appeals - working on my own schedule, for myself, total flexibility of lifestyle. A club with only one member, me.

I fully expect the IT industry (and indeed many white collar industries) to move over to consultancy model (or at least a telecommuting model). It makes sense. It's ecomental and everything. Once the current generation of senior managers move on and today's twenty and thirty year olds take their place, we'll see it more and more.

But working from home misses out all the benefits of having a place to work at - the enforced social interaction of a job. While you gain freedom, you lose all the fringe benefits... and you get cooped up in a place that its nice to get out from every so often.

The answer: lets reinvent the gentleman's club.

Not so fast: "what about co-working venues", you might ask. Co-working is a good first step. It gives you a workplace. It gives you people.

But when I take a job, the job self-selects the sort of people I work with. They are smart. They know their stuff. They are reasonably non-annoying (and I'm annoyed by pretty much everyone).

At a co-working venue, anyone who can afford the price of renting a desk can be your work buddy. The only selection category is, potentially, income.

And the co-working venue doesn't provide all the helpful features of an office. Nowhere to post your mail. No canteen to eat in at lunchtime. No rooms for meetings.

These are exactly the sort of features that gentleman's clubs had. Clubs attracted a certain type... and applicants who weren't that type were back-balled. Clubs had lots of fringe benefits - you had a bar, food was served, rooms were available.

I'm not suggesting we all sit in big chairs by a fireside, drinking snifters of whisky and making bets about how quickly we can travel around the world (although I'm sure there would be a club to attract the likes of Gorman, Wallace and Hawkes), and for people like me in the IT industry, I'm sure many of them would feel more like Google. Or Microsoft. Because what people want from their workplace, and what people want from their work are two different things.

Thursday, 8 April 2010


Another approach to internet dating is to get rid of the computer.

Several of my friends are inveterate match makers. They look for ideal partners to pair up. This gives them satisfaction, and (apparently) some sort of meaning in life. I can exploit this for profit, right?

We've all seen "Hot Or Not". Why not have a dating site where you get to see the classified ads of one guy and three (random) gals, or one lady and three (arbirary) lads, and get to say "I think the best bet for this bloke or the wisest way for this woman is this one of the three". You could also say "Actually, I think these two are ideally matched"

And then you get to see

"Did I think the same as the rest of the crowd"?

and possibly, in the future, if that the guy writes to your choice of girl, you get points... and can ascend though a series of lables which mark out how good a match maker you are.

Meanwhile, the daters are using a dating website like normal. They see the ususal set of potential matches. But the matches are ordered, not by an algorithm based on a form they filled in (or their star sign and place of birth), but my what the people who are making the matching decisions suggest. You don't get matched by a soulless computer, but by people (and people have had centuries of evolution to get the art of matchmaking right. They probably know what they are doing)

And the final benefit of this idea? it could well go viral. Free advertising for your dating site. Which is what you need to draw people in.

Monday, 5 April 2010

The allergy assistor

I am gluten intolerant. Which can make shopping a pain. I have to check the ingredients on all sorts of things to see if I can eat them. And even then, I'm not sure, without a 'gluten free' symbol, I'm still taking my life in my own two hands.

And I'm quite hip to all this. I know what I'm doing. There must be scores of people with fool allergies and intolerance's who don't know what to look out for, or what has passed tests.

So I propose a mobile phone app. One for the iPhone. One for Android. We can talk about Windows phone 7 or whatever they're calling it later.

The app would allow you to enter your intolerance.

It would allow you to scan bar codes of products and see if you can eat them (given your previously input intolerance's)

It would keep a user submitted wiki (photograph the ingredients, submit reports by phone) so that new products could be kept up to date in our database

We could also buy into some of the online allergy food directories. I know Coeliac UK offer one to their members, perhaps there is a way to license that.

And, if you could simply search by name, brand or product type, that would be very handy too.

Maybe the app could suggest alternatives to items you are allergic to (could you buy them online through it? is that an alternative to charging for the app?)

Maybe the app could also let you know if you're near a known good allergy-aware restaurant.

Moreover, this app is an itch that I actually have to scratch (damn gluten-intolerance-related psoriasis) so its something I would really quite like to work on.

Thursday, 1 April 2010

Programing Tools: New Version

Once we've asserted that your programming tools should run in a web browser, we can start deciding what back end functionality it needs. The most important is version control.

Now, there is nothing new about version control, so I won't go into it here... but I want to point out that my last article just assumed version control: I suggested you could go to the code and start to edit it. Of course, what I meant was

You log into the system

You find the code you want to edit

You pick a button marked new workspace

You enter that workspace and modify the code.

The workspace is a version controlled branch. There will be options to update your workspace, and merge your workspace into other workspaces.

But all of this is transparent - for the developer its just how you work. Each time you save, thats a revision (auto saves may or may not be revisions... I suggest not). You can tag revisions with comments when you reach points where that is useful.

One final clever bit: the version control system is one of the standard ones... or compatible with one of the standard ones. A distributed VCS, naturally - git or mercurial (I have almost no git experience, so assume I'm talking about mercurial here). So, if a developer wants to work outside of the online toolchain, they can simply download a brnach to their own machine and work from there. When they are done (or just want to compile - they can push their branch back to their online workspace, and take advantage of the compilation and test features provided.

But the compilation and test features are other articles...