Today was one of the hardest days at my new job (at Sears Israel) since I started working there...
It all started when I arrived very early at work (around 8:00am) because I wanted to get a lot done, but instead I arrived and immediately found out that one of the acceptance tests I wrote (automated UI testing) was failing and breaking the build on our integration server.
So instead of getting straight to my regular tasks, I started looking into the problem which unfortunately, took a big part of my day. I don't want to bore you with details about why the test was failing since there's nothing technically interesting about it, but I do want to share with you what I learned from it.
We write A LOT of tests! Unit tests, integration tests and acceptance tests. We spend a lot of time writing them and a lot of time thinking how we can improve the framework and make the tests even better in the future. I haven't been familiar to this kind of attitude in the past, but from what I see already at Sears, is that this attitude pays off big time in the long run!
Today, I spent a big part of the day "not getting any work done", and not learning anything new about good design, nor better programming techniques... I spent time digging into my code, until I finally found out that the problem had nothing to do with my code. Even though, I still think this is a good lesson to learn from. During the whole time spent debugging, all I could think about was putting an 'Ignore' attribute above my test, committing, and finally getting back to my regular work, but this would just be cheating and beating the point all together. Doing this would've been taking all the countless hours spent writing these tests in the company and saying they don't matter and just throwing them away. If we don't care enough to maintain these tests like they should be, then we are eventually throwing them away, along with all the time spent on them...
Today, if I start working on a project, even just for myself at home, just something for fun, I can't imagine doing that without writing the proper tests to go along with it. This is becoming an integral part of coding for me...
All in all, I went home today with a good feeling. I know that the tests work, the code is of good quality and I did my part to keep that true now, and in the future. This feeling is rewarding and pays forward to the "hard day" feeling I had while confronting the problem I just wrote about...
No comments:
Post a Comment