Testing is a separate skill and that’s why you are frustrated.
I had this thought in me for years, but I never stated it. Last week I was triggered by something a participant in our Junior Rails Developer course said.
I already can say that I do not want to write any tests. It’s so frustrating.
I can certainly understand that feeling. And I know many developers feel that way.
Why are some developers so frustrated with testing?
Because they leveled up coding skill much better than testing skill. Like in an RPG game. Imagine that you play Skyrim and you are so good in Archery, but then you need to fight with a sword. And you say, ahh, it’s so frustrating. It definitely is, if you compare how you are doing in melee combat with your bow skills.
We intuitively understand it when it comes to different programming languages. If you leveled up Ruby then you will be faster and more effective at it than in Java or PHP. Granted, there is certain general computing/programming skill transferable between programming languages with a similar attitude. But knowing the idioms, conventions, IDEs, the ecosystem is valuable and takes time.
We understand it when it comes to different environments that we code for. A native desktop app for Windows, vs browser application, vs mobile iOS application. Frontend vs backend. Or even Spanish vs Chinese language.
So you keep coding features, feeling quite comfortable, then trying to test something (I assume no TDD process) and there comes the frustration. The feeling of being slow, not knowing the terrain. Like walking in a mud or through swamps.
There are two things you can do about it.
Let the rage and frustration take over you so you drop testing as a practice. Because it is too hard, not worth it. Or…
Accept it. Allow yourself to be bad at it for some time. Just like you were bad at coding, but you gradually became better. It hurts our pride. I am slow, I am not as good as I perceive myself to be. But that’s a constant feeling when we decide to learn something new in our programming career.
We can be gurus in one aspect, in one technology. And complete juniors in another. The more experience you have, the more you know, the more the knowledge is transferable to other tools. After all, we are reinventing everything every 5 years ;) Patterns become easier to spot, you notice the higher level concepts. But we can still be very weak in details. Or slow. Especially at the beginning when trying a new technology everything hurts and you feel like bleeding. Maybe because you are trying cutting edge technology. Maybe because the programming tools are sharp around the corners in general. And they don’t forgive.
Even installing a fully working environment for a new language can be tiresome and give you the feeling that you are utterly ineffective. And it’s the same with testing.
Because testing is a separate skill.
Think when you started programming. Was it at the university? Maybe a few years earlier? Did you test your programs automatically? Did they enforce that on every program that you wrote at school? Or maybe you’ve already changed your job a few times. Did your team always write tests? Most likely you will find a gap. Often there are years of difference. Years! Like 3 years of coding and 1 year of testing. Or 7 years of coding and 4 years of testing. Or 6 months vs 1 month.
3 vs 1, 7 vs 4. No wonder you are feeling frustrated.
You have 8-hour job (or even less, European style), and you switch between coding and testing during it (you also switch into managing, discussing, talking, prioritizing but that’s a different discussion). It can be a schizophrenic experience. It’s like constantly switching between your left and right hand. I’m good, I’m bad, I’m good, I’m bad, I’m good, I’m bad.
Is it ever going to stop?
It is if you don’t give up on testing. If you keep strengthening your testing muscles. If you keep building infrastructure and architecture around your tests. If you genuinely care about them. Accept that you need to level up a bit more to enjoy it and catch up with your coding skills. I believe, it will be worth it.
P.S. If you want to boost your testing and domain crunching skills give our Hands-on Ruby, TDD, DDD — a simulation of a real project video-course a try.