Skip to main content

Leveraging functional test cases to perform Unit Tests

Ever since I have worked with quality process improvement I have heard a lot of excuses for not doing unit testing as it is wonderfully articulated in this article Excuses for not doing unit tests. Subsequently I have found that we are spending almost 50% of our total project effort on testing and defect fixing and the reason for this is because there is not enough unit testing done. So this got me wondering as to how we can change the process so that we can have more efficient unit testing done so that the defect fixing and testing effort comes down.

As per the process after having the requirements defined we give off the same requirements specification to the development team (for design and development) and to the independent testing team (for developing the functional test cases). The functional test cases are developed using this template. Once the development team completes the design document it is used as an input to enhance the functional test cases to cover all the test cases that might have got missed by looking at only the requirements. Usually half way through the development cycle the testers have completed the functional test cases and are ready for the testing to begin.

If a defect is found by the testing team there is a high cost involved in fixing it (in terms of effort) for the following reasons
  • Time taken by tester to identify the defect and log it
  • Time taken by the development lead to analyse the defect and assign it to the developer
  • Time taken by the developer to fix the defect and change the status in the defect tracking tool
  • Time taken by the tester to retest the defect and close it

Given the high cost I was wondering why shouldn't the first round of testing be done by the developer themselves on the code that they developed. This may take a bit of extra time for the development team but the cost of finding a defect and fixing it is lower. The costs involved here are

  • Time taken by the developer to understand and execute the test case
  • Time taken by the developer to fix the defect

The following are the advantages that I see in this process

  1. The time taken to identify defects and fix them comes down drastically since we are removing a whole loop involving the tester. Yes the development time goes up marginally but the benefits if 90% of the defects that were slipping through are identified and resolved at the development stage itself then it well give us good overall time lines.
  2. The development team can identify if there are any test cases that are not right or that are for functionality that is not being developed. This will reduce the number of rejected defects. Rejected defects take the same amount of time as a simple defects since the only thing missing in that cycle is the development effort.
  3. The development team will become more aware of the testing that is going to happen and will automatically lift the quality of the code that is written by them.
  4. It formalizes the unit testing. The developer can use the functional test cases as a guide to do their unit testing.
  5. The cost of fixing the defect as soon as the code is developed is a lot less expensive than fixing the defect at a later date as the code is still fresh in the developers mind.

Comments

Popular posts from this blog

Online Encumbrance Certificate in Andhra Pradesh

You can get an encumbrance certificate online in AP now. In order to get it you have to perform the following steps. Go to the website http://igrs.ap.gov.in/ Click on Citizen Services -> encumbrance -> Search Click on Yes in the screen that appears Fill in the entries that appear in the search screen. You will have to get quite a few details in so it will help to have a copy of the registration document available with you. Once you finish entering all the details click on Submit. It will then go to a new page with the list of items that matched the search displayed. Click on the check box of the list of encumbrance certificates that are needed and click on submit. This will open a new popup window with the encumbrance certificate. You can then print this certificate. What is this useful for Anyone buying new property can go and verify the current owners of the property that is shown on this certificate in the column Name of PartiesExecutant(EX)&Claimants(CL) with the copy of

Cricket Grounds in Hyderabad

This is a repost of the article I published on the 10th of Jan, 2008 as I have added a new ground - Lahari Resorts. View Larger Map In this post I will try and update the list of cricket grounds that i know in Hyderabad. The grounds that I have listed till now are MCH Play ground, Ameerpet Francis (Do not have the contact number but go to the ground and ask for him). The charges are Rs. 1100 for the ground. They do not charge for anything more. You get the ground from 9:00 AM to 4:00PM. The ground is small. Welfare Center, Sanath Nagar Dhanraj Babu (+91 9394556356). The charges are Rs. 1100 for the ground. They charge you an additional Rs. 500 for the mat and Rs. 100 for cleaning and drawing lines and stuff. They are supposed to give you the ground from 9:00 AM to 4:00PM but what they do is that they pocket extra money from another team wanting to play and give the ground out to them for the remainder of the day assuming that you won't play for the whole day. So what happened th

Problogger guest post

Today my guest post appeared on problogger.net . I wrote about 9 Tips to Start Blogging Successfully . Let me give you a bit of a background about where this article originated from. I have been blogging for close to 3 years now but I have been doing it seriously only for the last 2 months. I then analysed what were the things that I should have done in order to have become a successful blogger based on what I have noticed on the ones that have become successful. The final analysis of my study is what I put into that article and it is what I am trying to implement since the last 2 months. Reading the comments it was exhilarating to notice that some of the readers actually thought Darren was writing the post :-). It was also nice to notice that many readers agreed with my analysis and that strengthened my belief that what I have written if followed will work. How did I get to do a guest post on problogger.net ? A little more than a week ago Darren invited bloggers to do guest pos