Welcome to weblogs.com.pk Sign in | Join | Help

Coverage Testing

Today morning I came to know that a service that’s doing its work since long (3+ years) has started giving errors and its not doing what it is suppose to do. Application also performs certain database actions and in one of it, we were having “Transaction cannot start while in firehose mode” error. SQL’s Book online didn’t helped us, but a little effort on Google informed us that the application is trying to start the transaction, when there is already a firehose cursor opened. Firehose cursor is read-only/forward-only cursor that ADODB’s recordset uses when it’s opened for such reading mode.

 

It was quite clear, there are certain parts in the code that were not properly tested, may be the test cases didn’t reached those parts and now due to certain conditions, those parts are being reached.

 

This experience leads us that we should put appropriate efforts while designing tests so that the tests that we use to check the code functionality assure that all parts of the code is reached e.g. our tests should assure that “Some other code” portion is reached in the following example.

 

int Add(int a, int b)

{

            if (b<= (int.MaxValue – a)

                        return a+b;

            else

            {

//Some other code
}

}

 

The theory sounds great, but it has put certain load on our shoulders. Fear not, there are many CASE tools, that can help us here. Try Googling to find the CASE tools that fits our requirements.

Published Wednesday, October 20, 2004 4:25 PM by khurram
Filed under:

Comments

No Comments

New Comments to this post are disabled