Archive for the ‘Software Testing’ Category

I’m going to be attending CITCON coming up in Melbourne at the end of June.

There will be a bunch of people from all different tech areas to discuss CI and the testing thereof. It’s an ‘OpenSpace‘ format, so I’m looking forward to seeing what sort of things people want to discuss and hear about.

It’s a free seminar and I have it on good authority from people who attended last year’s event that it is highly worthwhile. The event is limited to 150 places and I believe many of them have already been filled, so if you’re considering attending then I’d act sooner rather than later.

I hope to see you there.

After blogging about tester advocacy I began to wonder whether I could come up with a code of conduct that testers could use to guide their actions and decisions. I don’t think you’re likely to get a one-size-fits-all code, so perhaps I should say a collection of heuristics by which a tester can guide his own actions.

I’m not talking so much about the day-to-day activities of a tester, though that certainly plays a part. I’m more concerned by the actions in his relationships with his peers, his employer and the people whom his testing may represent. I was hoping that with some careful consideration, I’d be able to put together a concise list of points.

I started listing the sort of things that are handy to remind myself about, but I quickly realised that they aren’t really that useful in all situations.

I listed things like

I will pro-actively educate myself in the art of testing.
I will find out who matters and test and report accordingly.
I will use all the resources at my disposal
I will not be the gatekeeper of the decision to ship/not ship

The problem with these is that while they work for me right now, they may not work for testers in other places, or with differing levels of experience, different duties, different responsibilities. The other problem with a list like the one above is that you could easily expand it to a hundred points or more.

I don’t want a laundry list, or a bunch of ‘thou shalt’ commandments. I am also wary of locking the art of testing into some sort of cookie-cutter formula/recipe to be followed by rote, rather something that is applicable in all situations that any tester can use to guide their thinking and actions in a positive way. This appears to me no small task.

I put it to the MAST list to see what they had to say about it. There was some interesting and spirited discussion around the term ‘trusted advisor’, but what I took away from the conversation was that Paul Szymkowiak‘s suggestion the exercise of attempting to define such a code of conduct is perhaps as important (or more so) than the results.

It is still something that I am spending time thinking about, but if the journey turns out to be as important as the destination, then perhaps someone else out there might gain something if I document my endeavours here. To that effect, I shall do my best to post updates here as and when I make progress on this front.

I have been reading Matt’s blog for a while now. Since October last year, Matt has been periodically expanding and evolving his thinking about ‘technical debt’ – the small, seemingly inconsequential short-cuts and hacks that we tend to implement or let slide in order to hit deadlines or save us doing more work (at least in the short term). Like most bad habits (such as the gradual accrual of fiscal debt, say, on a credit card), these things tend to lead to large amounts of pain down the track.

Rather than regurgitate what Matt has been saying, let me point you at his work. I think it is worthy of consideration for anyone who has had to interact with another human being in a professional capacity, ever.

If you’ve skipped to this bit of text because you’re not up for six essays on an unfamiliar concept, let me recommend that you at least read #6 before checking out details on Matt’s upcoming Technical Debt Workshop.

If you’re in the vicinity and have something you can contribute, then why not do it? If you’re not, then keep an eye on Matt’s blog. I’ve no doubt there will be some very interesting outcomes from the workshop.

The company I work for has been using subversion for several years now and it suits our needs reasonably well. It’s generally pretty easy to use; it’s certainly an improvement on CVS, but on the other hand there are some things that aren’t all that great. The way externals were implemented leaves much room for improvement and svn tends not to play nicely with mixed user permissions (such as when files are written alongside or over checked-out code by www-data). Subversion has a relationship with posix ACLs that is rather less cordial than the one described in The Pogues’ Fairytale of New York, but these are perhaps war stories for another time. These errors at least have the decency to fail with the requisite amount of melodrama.

More recently we’ve come across some more subtle and potentially nasty issues that subversion barely bothers to notify you about, if at all.

The way our shop works, we have a single trunk from which branches are forked. Changes are made on-branch before being tested and re-integrated into the trunk. Problems can arise when you make changes to a file on one branch (A), and move the same file on another (B).

Subversion treats moving files as a ‘delete’ and an ‘add’ (delete the old file, add a new file with the same contents and a different name).  If you integrate branch A and then branch B, the newer changes from branch A will be lost (as the file is deleted) and the branch B version will be instated with its new name. SVN does not warn you that a newer instance has been overwritten – charming.

If on the other hand, you merge branch B first, then branch A, then because subversion can’t find the the file to merge with branch A (because it was renamed in B), it simply reports that the file is ‘skipped’. No mention that changes to that file could not be merged as the file was not found just ‘skipped <filename>’.

Easy enough to miss when you have several hundred files scrolling past you at a rapid rate of knots.

Apparently, the best you can do is be very, very careful when integrating branches that contain deleted or renamed files. I’ve taken to pointing any sizeable svn output to a file and grepping the hell out of it.

A similar thing happens when you use nested branches.  This one is perhaps more understandable, but the level of reporting is just as woeful. If you branch from the trunk, then make a second branch from the branch then care must be taken if you attempt to merge the second tier branch directly back to the trunk. If you have added files in the second tier branch, they too will simply be ‘skipped’ if you attempt such a merge.

Merging back to the first tier branch is no problem, and is probably what the system was designed for. We discovered this issue when a developer created the nested branch to make newer updates to a very old branch. A better solution would have been to create a fresh branch from the trunk and merge the changes from the old branch into it, before making the required modifications.

Hopefully these are useful to some of you other SVN users out there.

I used to think that as a software tester, ‘if you’re doing your job well, then no one notices’. This sort of thinking was something I was perpetuating by misunderstanding my role as (merely) someone who performs test execution. I could see the benefit of the work I was doing and assumed that because no one else seemed really interested, they didn’t care.

From my experience, there is a tendency for testers to be thought of as second-class dev-team citizens, if not overtly then subconsciously. A developers job is perhaps easier to visualise than that of a tester. I’m not saying their job is easier, but for some reason a coder implementing programming algorithms by writing code seems easier to picture than a tester implementing testing algorithms by… ‘you guys just click on stuff to make sure it works, right?’.

I spent a lot of time arguing for recognition of testers and questioning why other members of the dev team seemed not to understand how important testing was. It was frustrating to me. It seemed like more often than not, when people took notice it was because something had gone pear-shaped because it was my fault (I’m the quality guy, right?).

It slowly dawned on me that it wasn’t because they weren’t interested, but because the way I was conveying the how, what and why of testing was not compelling. My colleagues knew development. They understood development, but their experience with software testing was limited. It’s not that they didn’t value the test team, but the way I was reporting my testing wasn’t as relevant to them because it was more or less a binary ‘Yes I have found problems’ or ‘no I haven’t’. This had a dangerous side effect of making me a defacto deployment gatekeeper.

They valued the ‘yes’ or ‘no’ a great deal, but because that’s all I was providing, and because that was their experience with testing, that’s all that was expected. I was thinking hard about testing and how the product might break and what else might go wrong, but I wasn’t really focused on how to get that across to the people that mattered. They assumed that when I said I was done, I knew enough to know that was true. To be honest, at that point, I didn’t know enough to argue otherwise.

As my experience in testing grew, I realised that test execution is a small (but of course important) facet of a tester’s role. I began to see the testers role as multifaceted and I became part devils advocate, part psychopomp and possibly large amounts of the damned from various circles of Dante’s inferno :) . I pushed to be included earlier in the project lifecycle. I asked questions, made suggestions, asked for documentation and information and made sure the people I was working with were across the thinking I was doing about risk and risk mitigation. I started talking in terms of how the testing we were doing was covering the risks we’d raised (and sometimes how it wasn’t). I didn’t always go the most diplomatic way about it, but gradually things began to change for the better.

The role of a tester to me now is to really be a central information hub, and a representative for those who may not have a voice (such as the end user). Reporting the test effort should be a matter of knowing who your audience is (or more broadly, who matters) and what matters to them. The development group I work with now have come to expect assessments of risk, analysis of proposed solutions – the thought behind the effort is as important as the effort itself.

I suspect that my early experiences are not uncommon. I have heard and read many accounts of testers feeling undervalued and misunderstood, being blamed for errors that go into production, being the gatekeeper for the decision to deploy. I don’t think testing is nearly as understood as a profession as coding is and it’s something I’d like to change.

I think the onus is on the software tester to be proactive in promoting their effort in such a way that it adds value to those that matter; so that the people they are supporting understand exactly what the tester’s role is. I think there is a need for education both of non-testers, to show them the value of software testing, as well as education of software testers so they are able to convey a compelling story of what their testing is and does and why it matters.

My situation is of course going to differ from other testing shops out there, both in the style of work and the relationship with developers in the development or project group. There may be an element of ‘picking your battles’, or making change in small increments over time. Testers might face extreme reluctance or hostility to change. I think at that point it becomes a matter of the tester being clear on the sort of behaviour they are willing to commit/adhere to, and those that they will not. More on that soon.

I am reasonably certain that somewhere in the world, a tester is being blamed for not finding this.

I am a little pressed for time right now, but I have been thinking a lot lately about the perception of testers by the people they support and what that can mean in the context of the projects they work on, the companies they work for and testers as individuals. I think there’s a rich vein of blogworthy material to mine here, which I promise to attempt just as soon as time permits.

Jared Quinert pointed out to me that I missed an opportunity to work in a good point about testing in my entry supporting the WGA. I’ve recently been struggling with the task of coming up with meaningful stats to report to my handlers to help justify the existence of my team and anyone with a brain cell would have noticed that talking about prodco execs massaging stats of WGA writers would have been the perfect segue into this. Apparently I still suck at the blogging thing. I’m sorry.

Let’s pretend for a moment that I was clever enough to put two and two together. Here’s what I might have said.

You can make statistics say pretty much whatever you want. This is potentially dangerous because in my experience, more often than not, your audience is passive won’t care at how you arrived at your final figures as long as the layman’s explanation sounds reasonable.

A tester worth their salt is different. They’re conditioned to ask ‘why’ to almost everything, but I have a sneaking suspicion that there are many people out there that accept any given number at face value as long as it’s not obviously outrageous, maybe because they’re afraid of numbers, maybe because it simply doesn’t occur to them to question why.

Let’s take the following statement on the AMPTP’s website:

According to WGAw, 4,434 of its working film and television members earned a combined $905.8 million in 2006. The average member earned $204,295 and over half earned at least $104,750. The WGA noted that these numbers are based on earnings reported for dues purposes and thus do not fully reflect above-scale payments.

In case you’re wondering where they got their information, they got it from a report like this one.

It would be very easy to read that statement and conclude that at least half of screenwriters earned over 100K last year – not a bad paypacket in most people’s book. Certainly the AMPTP seem quite content to leave it at that.

Let’s have a closer look though. One key word that jumps out at me is ‘working’. ‘4,434 of its working film and television members…’ – meaning that there is an unstated number of non-working film and television guild members. What is the guild’s total membership? According to the report I linked to above, it’s 7313 +/- 400.

So when they say ‘The average member earned $204,295‘ they mean 910m divided by 4,434, which they use to arrive at their average figure of around 200k. Let’s factor in the conservative figure of total membership – 6913 (7313 – 400).

910m / 6913 = $131,636

Very different to their figure of 205K. Still, 131K is still a pretty good wicket to be on, right? Maybe, but remember, we’re averaging wages earned by all across a large number and at least 2,479 of those people (36%) did not work at all during the fiscal year stated.

Let’s add a little more contextual information. As a writer, you might work steadily for a season on TV, or be paid for a script during one year, and then not work again for 12 months or more. The 36% of writers that didn’t work this year are predominantly not going to be the same people who don’t work next year (assuming the strike is resolved by then).

Taking our average figure of 131.6K and stretching that across two years, we’re suddenly looking at 65K and this is before we factor in tax. An agent will typically take 10 percent which further eats away at your nest egg. Suddenly the princely sum the AMPTP are touting is not looking nearly so princely.

Even if you were to say that the average writer works 64% of the time, then you come to a sum of $84,224, less agents fees – $75,800, less tax (let’s be generous and tax them 33%) and you arrive at almost exactly $50,000 – and remember I’ve been using conservative figures.

Are the AMPTP being deceitful? I’ll leave that for you to conclude. They’re definitely not giving us the entire picture, that’s a certainty.

As software testers, we’re taught to look for multiple explanations for problems. The map is not the territory. How often has your first conclusion turned out to be incorrect. If you’re anything like me, the answer is very.

I don’t think examining stats is very different in this regard. You need to look closely and think critically, whether or not there’s a neat little summary next to the numbers that tell you what you’re supposd to think. What the numbers don’t say may be just as important as what they do.

What contextual information may be missing? Can you drill further into the numbers and look more closely? Is there a heavy skew and a long tail hidden by a mean average? What does that mean?

Abstracting a little more, you can look at who has put the statistics together and why they might have chosen to present it the way they did. Do they have a particular bias or motive that may make them want to present statistics in a particular light? Someone with a KPI bonus for keeping bugs low might present a set of figures very differently than someone with a bonus based on the number of bugs found.

I am not at all surprised at the number of war stories one hears about statistics being misused and abused. It’s too easy to accept numbers at face value when the numbers look as good as you want them to, or present a slam-dunk answer to an argument.

I am going to do my best however, to make a point of being the guy who, when presented with stats, does dig deeper and shakes things to see what falls out. It might be a bit more effort, but it might also become a lot more interesting, not to mention valuable.

Writing for the screen has many similarities with software development. It is a highly collaborative affair, and one that requires patience, skill, clear communication and quite possibly a penchant for the masochistic.

A screenwriter has only 120 pages in which to tell their story. It sounds like a lot, but when you can write only what can be seen or heard, it rapidly becomes very challenging. Every word must drive the story forward.

The story has to be one that works on film. If the story depends on internal states (what people are thinking and feeling), it may be something that is better suited to a novel. If it’s dialogue-heavy, you might have a stage play on your hands. Not every story lends itself to being on film.

A writer of spec scripts (scripts that are unsolicited) is, whether they know it or not, writing for at least four audiences. Firstly the production company’s readers.

Readers are paid a pittance to wade through massive piles of screenplays that (literally) tens of thousands of other writers submit to Hollywood every year. They’re the ones who sift the gold from the shit (and 99.9% is shit). They’re hoping that the next 120 pages that they pick up is going to be the nugget they can plonk on a producer’s desk and say ‘we have to make this’, and of course they’re generally disappointed. Poor bastards.

As a screenwriter, you have to grab their attention from the first sentence – the first word if you can, then hold it. Keep them wanting to turn the pages even if it’s the 30′th script they’ve read that day and their eyes are red raw. A spec script has to be that good.

After that, the script has to grab the imagination of a director. If you take a look at a novice screenplay, it’s generally full of camera direction and references to music and such. This is a no-no for writing on spec.

It is the director’s job to call the shots, not the writers. Okay, so a spec script with this sort of direction will be binned by a reader before it ever gets to the director, but the point is, screenplay writing is collaborative and you need to know what other people’s jobs are, and let them do it. That doesn’t mean you can’t capture their mind’s eye and suggest implicitly what the right shot might be.

Let’s say for instance you have an action movie where you have a hostage strapped to an operating table about to be operated on, and your next scene is your protagonist tending his wounds after a battle. If the last sentence of your operating theatre scene ends with the hostage being anesthetised, and the first sentence of your protagonist scene is him having a bullet wound stitched shut, you’re not explicitly telling the director to superimpose the needles for the scene transition, but the inference is reasonably clear.

You’re not telling the director how to do his job, but there’s a suggestion there if he wants to use it.

The screenwriter needs to write for the actors as well. If you don’t have characters that test the range of an actor, that challenges them, they’re less likely to want the part. You need to know how to build tension and create conflict and show them the opportunity to display their acting chops.

The novice writer probably starts out with the movie-going audience in mind and of course they’re important too. You need to have a story that works on screen, that grips the interest and imagination of the viewer, holds it for 2 hours and leaves them feeling that the time they spent was worthwhile.
As a software tester reporting bugs, your role is not so terribly different (although hopefully on a smaller scale in terms of length). You also have several audiences and several relationships to manage.

You need to report your findings clearly and concisely with enough detail to adequately convey the bug and the environment and context surrounding it. Make it easy for the person reading your report. If there is some heavy lifting you can do for them, do it.

Is your bug worthy of reporting? Relate the problem to risk. Why is the bug worth fixing? What happens if we ship without it being fixed? Who benefits from it being fixed (or who is it detrimental to if not). Create a compelling case for the resolution of your bug.

Don’t tell a programmer how to do their job. If you have theories about the cause, or suspicions about a more serious underlying issue, then note it down, but preceding it with ‘you need to fix’ or ‘I would have written it like this…’, or ‘the whole thing needs rearchitecting’ is unlikely to win you many friends.

Like a screenwriter, once you submit your bug, it is out of your hands. You want to send it into the world with the best possible chance of success. A screenwriter wants their play to entertain (and also come back with a large cheque attached), and build their reputation as someone who produces quality work. You want your bug to come back resolved and build the same kind of reputation.

Understand who your audience is, what they are looking for, and make a point of providing it to them.

Cem Kaner has an excellent document on his site about bug advocacy. Well worth the read.

For any budding screenwriters in the audience, if you haven’t already devoured the wordplayer.com columns written by Ted Elliot and Terry Rossio, then your next eight hours are in this link.

Another non-software testing / non kendo post, but for what it is worth, I want to lend my support to some people that deserve it.

If you watch t.v. or see movies, you probably know there’s a strike on at the moment. I have a few friends who are participating. Your favourite television series might be delayed a good while because of it, but if you’re blaming those overpaid, lazy writers, then your ire is misdirected. What these people are asking for is not unreasonable (more detail here).

The AMTPT would have you believe that they’re the ones being hard done by; that because writers are paid for paid downloads and online pay-per-view, that not paying them for streaming video online is not ripping them off. They’d have you believe that the average working writer is taking home over $200K a year, based on some sums they did on numbers from the WGAw.

This ain’t necessarily so. I am led to understand that this is a more representative explanation of how screenwriters are paid. It looks to me like the AMPTP is massaging the facts in order to put a very particular spin on events. I’ll admit, my viewpoint is not unbiased. I want my friends to be better off.

I’m tempted to draw parallels between this and the recording industry where artists are beginning to break away from the draconian Establishment and distribute on their own terms. Unfortunately for the screenwriters their relationship with the prod co’s is a symbiotic one, as there are many more moving parts involved in putting a movie together. The AMPTP seems a little hazy on the difference between symbiotic and parasitic.

I do hope for their sake, but more particularly that of the people on the picket line that they work it out soon.

It’s easy to tell yourself that you’re training hard when in actual fact you’re slacking off. I find myself doing it far too often for my liking. If in the kendojo I’m fighting beginners, I might fend off attacks in order to get them to try and work out why they are unsuccessful. Nothing necessarily wrong with that, but if that’s all I do, then I’m slacking. More effective for the both of us would be if I tried to fight at a level slightly above theirs and encourage them to rise to that standard.

If I’m not really trying, I notice myself falling into bad habits. I let my feet move move lazily, I block without trying to counter, if the first strike fails, I may not immediately make a second or third effort (all of these rob you of the ability to take advantage of opportunities) – these things are physical manifestations of mental laziness. When I see others being lazy, I take them to task for it. When I find myself doing it, it annoys me. It makes me feel like a hypocrite.

If I don’t put in the effort, then I don’t learn anything, but possibly worse is that my training partner isn’t learning anything, and if you think they don’t pick up on the fact that you’re not putting in 100%, think again. I don’t want to be the person that teaches others that a half-hearted effort is okay. Moreover, by doing this, you are saying ‘you have nothing to teach me’.

You can learn from anyone. This has been proven to me time and again, both in the software testing field and in kendo. Insights can come from the most unlikely sources. Think about the questions people ask (before you rattle off a rote answer). Observe what they do and ask them why.

It’s not easy to alway make the extra effort, but it is something you can train yourself to do. Like anything, there’s that initial force of will required while your brain rewires itself to a new standard, but the more you do it, the more you’re able to do it. Doing it consistently in practise means it becomes second nature when it counts.

Practise doesn’t make perfect, perfect practise makes perfect. Don’t know who coined that one, but they were right.

There are always things you can find to work on. If you find yourself with the luxury of time, or your domain knowledge outstrips the challenge at hand, look for ways to challenge yourself. What is it you are trying to achieve? What can you do to make that achievement something that helps you to grow also?

Not necessarily easy questions to answer. The answers you come up with may not be easy to implement either, but if you can identify something challenging in what would otherwise be routine, then surely it’s worth it.

Forgive me if I’m being overly abstract. I shall try for something more practical in my next entry.