Showing posts with label Web n Software. Show all posts
Showing posts with label Web n Software. Show all posts

Friday, February 8, 2013

Unit Testing tips for developers

Whose responsibility is it to test the code you write?
I get this question in my mind so frequently these days. Having been part of various projects, I got a chance to interact with many senior developers. Without commenting on their knowledge level, all of them had one thing in common – they did not know how to or did not want to test the code they write.

Is it too difficult to perform basic unit testing? No, it is not. People simply verify the happy path testing and release their code for testing team. They forget to include some small but crucial negative scenario, which if encountered can generate high priority defects. Then follows the meetings and several mails from managers and clients as to why code failed in Production.
So, I just thought of putting down some scenarios that should also be verified before releasing the code, especially if your code might be accessed in different browsers.

1.  Testing input fields on the form
a.  What happens when only spaces or value with leading & trailing spaces are entered – to check if you need to code the trim() logic.

b.  What happens when special symbols having special meanings for browsers are entered? Example: hash (#), apostrophe ('), ampersend (&) etc. – These become even more crucial, when these input values are used as querystring and sent through the URL. Some Browsers like Firefox will consider their special meanings and break the URL flow.

c.  When user enters the value with caps lock ON? – Sometimes, the values entered are correct, but only because their case is different than what you have coded, your logic fails.

d.  Input fields having regular expression validation like Email, must also be tested for above combinations, although these are relatively safer and less prone to bad input values.

2. Testing navigation related scenarios
If your form allows user to select some values and then navigate away and return, it becomes important that your code retains the user-selected values on return. For example: You have an online shopping website and user has selected to view items in descending order of price, from a particular city and in a given price range. When user moves from one page to other, you need to retain those preferences.

3.  Database and Screen field length Testing
Most fields on an input form are mapped to a database column. In many projects with large teams, these are coded by different individuals. Chances of a mismatch in coded values are more. Thus each field should be validated for its maxlength (maximum allowed character limit).
Now, do you think these should not be part of Unit level testing and it should be a developer’s responsibility to validate at least such scenarios instead of waiting for a Testing resource, who may have more than one project to handle, to identify such flaws in your coding.

Friday, July 8, 2011

The world famous 'Like' button

People went crazy with the introduction of facebook like button. Its plugin was being used on most websites and users all over the world continued clicking it and are still at it. I am not against it, duh!...honestly, I use it too. But, I cannot forget that You tube had the rating system much before it. Moreover, it still is ahead of facebook, since it allows us to both like and dislike a video. So, I was about to credit them for it.
But what's this? Another article says that there were others who thought about these thumbs up and thumbs down icons much before YouTube or Facebook. Yeah! even I had no idea about that...those sites were Stumble upon and Urban dictionary.
Anyways, that is not why I started writing this today. What I wanted to say is (although it has been said before), that I dont like the Google's +1 icon. Firstly, it doesn't come even close to the like button. Secondly, it some how doesn't have a familiar appeal...haan, if google gives it a companion -1 icon, then maybe I will use those links, but right now...nah! They dont lure me. Its just like the unwanted preview icon (magnifying glass) at the end of each search result...clobbering the google results page. Someone make them as an add-on instead of forcing these new icons on users. By doing this, google is slowly following into Microsoft's path who change everything in their subsequent product releases leaving the users lost.

Gmail: New look

Official Gmail Blog: A preview of Gmail’s new look

Although being a google product fan and permanent user, I am not really looking forward for the newer and cleaner Gmail. I liked it and was more comfortable using it when it was newly introduced. It was very stable before facebook and twitter came into picture and google guys started making quick enhancements to keep people on their site.
Now, it is getting clobbered day by day with all the new features. Maybe there are people out there who like change but moi is just not one of 'em. Oh, I really hope they dont change it too much just to be in the competition. Its not even a competition, all the social networking sites are the new thing now, they may fade away in the coming years. But people will still need a fast working mail system. That is where Gmail stands out. And, it should be maintained that way.

Saturday, April 9, 2011

Encounter with Gmail Attachment pop up

Have you ever sent an important mail when you forgot to attach the document and then resent the mail again with attachment? Sounds familiar right!!!
Gmail has this excellent feature where, once the user clicks on the send button, the system will verify your mail for wordings like 'I am attaching...' or 'I have attached...' or 'Please find attachment...' etc. and check if you have actually attached any document or not. If not, it gives you a pop up (see image), warning you that you are about to send a mail without attachment. Now that's what I call an intelligent system.

Gmail 'No-attachment' pop up
Although it is not a new feature from Google. It has been there since 2008, but I had several recent encounters where I would have been doomed and appeared unprofessional if I had sent those job applications without my profile. But thanks to google team, it saved my day once again.
So go ahead, use Gmail without any fear of being forgetful of attachments. :)

Saturday, December 18, 2010

YouTube Video Editor is a boon for amateurs

YouTube's Editor tool is a saviour for amateurs like me in video editing field. It surely has a long way to go. I am going to support it for a long time and I'll tell you why...read on!!!

Recently I got a chance to visit a National Park with my family and we had many videos made on handycam. Now both me and my dad agreed that these videos cannot be uploaded or shared with the family without editing else the fun will go due to all the pauses and breaks between the various animal sights. So, I began googling for various video editing softwares (both free and licensed) that could serve my purpose without degrading the quality of the videos.I ended up spending about 2-3 hours on the net.

Now, I know some people will say that windows movie maker is readily available, so why waste time. But I have another problem. I am still struck with Windows Vista Home edition. For day-to-day work, it is fine with all its bugs, but it just made my life tougher that day. When I tried to start a video in Windows Movie Maker, only audio came without any video. So, I again searched and found that many people faced this problem and the issue was that DirectX codecs were not installed. So, I downloaded the K-Lite codecs and ran the install. THAT'S IT!!! MY WINDOWS CRASHED :(
Thankfully, I tried the System Restore feature that day before going for formatting my system and that saved my day.

But after all this, we had given up the idea of editing and uploading our family videos. Then after 3 weeks, I was going through one of my earlier YouTube uploads and I thought of trimming that video. So, just searched YouTube help and support for editing videos already on youTube and I found links to YouTube Remixer, an older tool for editing videos, which has now been withdrawn. It was then that I discovered the YouTube Editor feature.

Finally, today I was able to upload my first edited video on YouTube. For a first timer and especially after all that I had gone through, this was nothing less than a victory. And so, I am going to celebrate it. But before that, I genuinely want to thank all the developers of the YouTube Editor software. God bless you guys!!!

(P.S. Have a look at my video here)