Saturday, 7 February 2015

Testing the Waters

I just realised that I hit a milestone with my last post - 601 posts (although that's only on the Wordpress blog, as that includes my migrated Windows Live Spaces posts). Congrats to me! :D

-----------------------------------

In a software development team, I feel like there is always going to be a battle between developers and testers. Quick background for non-software people: Developers are the people who write the code, and testers are the ones who do all the testing to make sure it does what it's supposed to do, and doesn't blow up the world when someone uses it in a way that it's not supposed to be used. Developers sometimes view testers as annoying gatekeepers who aren't skilled enough to actually make things, which is why they're testing them. Testers sometimes see developers as crazy cowboys (cowpeople?) who think that everything they build is perfect and never has any bugs. OK, maybe I exaggerated a little.

One of my fellow developers at work (not on my team) often expresses his frustration with testers. They have a bunch of tests that are set up to run automatically, all the tester has to do is press a button to start the tests, and then check the output at the end. (Please ignore my condescending sounding tone, I am just paraphrasing how it was described to me.) Whenever something out of the ordinary happens, the tester will just stop everything, and say, "Developer, it's broken!"

The developer then has to stop whatever he is doing and take a look at what's wrong. Most of the time, there's an error because the tester forgot to perform a step during the installation or something like that, which the developer will fix and the tester can resume pushing the button. The developer gets really frustrated because the tester makes no effort to troubleshoot the issue at all. Not just that, but they also make no effort to add more automated tests, they end up telling the developer what they want the test to do, and the developer has to script them up himself. He really wants to replace them with a small shell script.

Thankfully, the testers that I work with are far more self-sufficient, and have enough domain knowledge to troubleshoot most problems. In fact, I often find myself asking them about esoteric parts of our system. However, one area they seem quite afraid of is automation. Ideally, you would rather have automated tests than manual tests, because they're faster to run and less prone to human error. You can do things like trigger them to run every night when nobody is around, so you find new problems early. I do understand the fear some testers have with regards to automation, since you are pretty much scripting away their job, but I think the counter-argument is that automation frees them up to write new test cases for all the new stuff that's being built, rather than running test case #109 yet again, to make sure the developers haven't broken existing functionality.

Unfortunately for them, there has been a big push for automation from our new manager, as it is a little crazy that regression testing (making sure existing stuff still works as it should after new stuff has been added) takes around 3 weeks. Automation can require a lot of scripting, especially when the tool you have is not entirely suited to what you want to do. However, the testers seem to view scripting, or coding of any kind, as the domain of developers and they seem to want to offload a lot of it onto me. "Anna, I need a script that does this, can you help me out please?" The first couple of times, I just wrote the script, send it to them, and explained how it worked. But I found that they didn't really care about how it worked, and so when they needed a script that was almost identical to one I'd already written, except with a minor change, instead of making the change themselves, they'd ask me for a new script.

I turned to my favourite tester, Darkpast, and asked him what I should do. He said that the next time they asked me to write a script, instead of writing it for them, I should offer to sit with them while they made the changes to the script.

"But it could take them hours to write one of these scripts, but it only takes me a few minutes!" I complained.

"That's OK. For every hour you spend with them now," Darkpast, replied, sagely, "you will be saving yourself many hours in the future."

Deep down, I knew he was right, so the next time I was asked to write another script, I used his suggestion. It was an incredibly frustrating experience. I don't think I did paired programming correctly, as I found myself pointing out how to do things, rather than letting him figure it out for himself. It was also a bit of a weird dynamic, as he is probably 10 years older than me, gets paid far more than I do, and has many years more experience. I tried my best not to treat him like a child. It took us close to an hour, but we got the script written. I vowed to strangle Darkpast the next time I saw him.

A few hours later, the tester called me over again. I honestly don't think I'm made to be a teacher, as I was mentally bracing myself for having to go through and show him how to make a minor tweak to the script we had just written. I was trying to be a good person, honestly, but I was stressed from trying to work out how to solve a problem I had encountered, grumpy from lack of sleep, and the long list of outstanding wedding tasks was looming in the back of my mind, along with the sadly falling value of the Australian dollar.

I walked over to his desk, and he had a big smile on his face.

"Hey Anna, I made a few changes to the script for these other things I wanted to test, could you take a look over them with me to make sure my logic is correct?"

It took so much strength not to jump up and down with happiness. IT WAS WORKING! He had picked up enough from what we talked about to make his own changes. He was writing his own test scripts! I looked over his code, and it all looked good to me. I even ran him through how to do some simple tests to make sure it was working, and he picked that up really quickly. Since that moment, I haven't once had to write another script for him. I had to explain some of the in-built library classes that aren't immediately obvious, but all of the rest, he has been working out through trial and error.

I feel so proud of him right now. Oh, and I definitely owe Darkpast some gingerbread. I hope he likes gingerbread...

No comments: