Thursday, August 1, 2013

Should developers Unit test his application before giving the build?

Every time you ask this question to a developer "Do you unit test?" The answer would be straight forward "NO! I don't have time for unit testing! why are you hired for" DUH!

We will start with an example.
Developer under the pressure of deadline does not perform Unit testing and would pass the build to QA in the morning. QA starts his testing somewhere around the evening because the QA was busy with some other project work(multitasking you see :D). Now for bad luck (both QA and developer), application crashes on launch. The developer has already logged out for the day(as usual, very early), so there is no way QA could contact him. So he logs a defect and raises it as a critical bug and leaves for the day.

If the developer had installed the build to a device and launched the application he could have saved some trouble and time as he would have fixed the launch crash, thereby not delaying the test report.

What do we take from this example?
1. Developer should have tested the build
2. QA  should have installed the build in the morning just to check if it works.

In this case, the developer takes 90 percent of blame as he should have checked the build before passing it to the QA and rest 10 percent to QA who should have taken responsibility by installing it as soon as the build is given.

So coming to the point, every company should stress developers to do unit testing no matter how difficult the situation would be. I have heard many developers mention that they don't have time to develop and where on earth would they test the application!. Even pass rougher remark like "Its a tester job not mine" But developers need to have a change in this mentality. As a QA  I don't expect developers to test every corner cases but a simple unit test would do. The attitude of a developer should be like "YES! I will do unit testing which would cut off some bugs in defect tracker thereby increasing my credibility" If every developer thinks in this way there wouldn't be any straight forward crashes. I know this will reduce the bug count and work of QA, but at least we can just concentrate on corner cases.

To conclude companies should always allot some person hour to unit testing while estimating effort. Also, developers should always make sure that he/she unit tests the application. So does your developer unit test?