![]() ![]() If we run the application, the output will be "Positive Number".Īdd a reference to UtilityLibrary.dll to it and write the below piece of code using Īctual = objUtilities.CheckPositiveNegativeNumber(inputValue) If (objUtilities.CheckPositiveNegativeNumber(n) = 1) Utilities objUtilities = new Utilities() ![]() Next open a Console Application, add a reference to UtilityLibrary.dll to it and add the below piece of code using System Public int CheckPositiveNegativeNumber(int number) / Purpose: Check if a number is positive or negative. / Function: CheckPositiveNegativeNumber Name it as UtilityLibrary and add a class by the name Utilities.cs and add the below code to it. Rather, it is a metric for functional testing.Ĭase Study: Check if a number is positive or negativeįire up Visual Studio and create a Class Library project. It is not a replacement for through testing since it does not cover all the use cases.It never tells us if the code is well written. ![]() It also provides information about which lines of code have been executed and how long it took to execute them. It also provides valuable information to the developer(s) as if the code block is partially, completely or not at all tested which on the other hand helps them to include more test cases to solidify the various boundaries under measure.By knowing how many lines of code of a certain code block are touched, we can judge how well the code/function is tested. By analyzing the result of the code coverage of the Test Methods, we can figure out how much code has been tested for the specified test method. It is a verification metric of determining how many lines of code in a given binary are measured when we run test cases against it. N.B.~ The Analyze Code Coverage is avaliable under Visual Studio Ultimate and Visual Studio Premium What is Code Coverage? Code coverage is an important asset for a project development.It brings stability in the function of the code block under measure and make the code block stable.The more stability in the blocks of code, the more stability will come in the modules/use cases and henceforth a well balanced unit test cases can be written with less bugs and finally a stable version of the software/modules can be released in the production with least Mean Time To Failure(MTTF) which on the other hand ensures better project/product quality.In this article, we will look into various aspects of Code Coverage in Visual Studio Premium 2013 with a case study.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |