"I'm only a tester, so I've never done TDD before!"
"Why should I care about readability, this is only test code?"
I often hear phrases along these lines from testers, and it makes me very sad. Not just the fact that this mentality often results in hard to maintain and brittle test code, but it also blocks testers from developing their skills.
Definition of the word: programmer
"One who writes computer programs."
Before continuing on with my rant, I'd like to make one thing clear:
Test automation code is a piece of software that tests the functional correctness of another software. Therefore, you, me and everyone involved in maintaining that automation code is - by definition - a programmer. We might be specialised in test frameworks, tools, browsers, requirement formats, but we are still programmers.
Without admitting that, we will never feel entitled to think about all the fancy stuff "developers" do. We won't feel the need to learn design patterns, and will not be striving for decoupling, readability and clean code. Why should we? We're only testers. We will constantly feel inferior to the guys actually "writing software".
There is however another legacy that we (as programmers of test code) need to fight. Unfortunately most programmers by title, perceive test folk as less capable. But I believe it is due to what I've been writing about above, and the only way we can change that perception is to man up, admit that we're programmers and learn the craft, to prove them wrong.
It starts by admitting it to yourself, and it feels damn good!
So what are you waiting for?