Sunday, February 14, 2010

why not test code after writing it?

This week has been spent on fixing bugs that other people introduced. Some of them have been very very difficult to find while some of them were just plain stupid. An example of a stupid bug is that just after tourny gets over, the winners get double of their win amount. Another example was that even if a player plays a play money tourny, his real chips (real money) account would be overwritten by play chips. These bugs are stupid bugs and result of lazy people, coders who just finish their coding and don't test it properly. This is not unique to this company here. I have run into this again and again, in all the companies that i have worked with. The main reason behind this sloppy work is the pressure that management applies on team to get the work done within some time window. But i still feel that this tantamounts to not getting the job done at all. I have pretty harsh opinions on this subject :-)
An example of a very very hard bug will be the one that Datta faced when testing with an id kentuckykid. When he was playing the tourny, suddenly his moves started getting dropped by the server while all the other messages were getting across fine. I went thru logs again and again to find that particular issue. He had logged in form one client, and then logged out, started out another client and was playing in the tourny w/o any issues or hassles. Suddenly at the time of table merge, he started facing this issue. I found that before he started facing these issues, he had tried logging in from the first client and had got the message that id was already logged in. And here, I found the issue. Exactly at this point, the previous presence was being marked as unauthenticated. The person who coded that had never bothered to test it. And left this mess. I spent 3 hours to find that bug and fixed it in 1 minute.
Well, the tourny is going great on Rounders. On 15th, we will have one final testing here to be personally tested by boss. So then from Monday, we start implementing 3 patti :-)

No comments: