I am strengthening my Jenkins build process and adding a few more checks.
I just stumbled across Parameter value coverage, which alas only handles C# code.
Is there anything similar for C / C++ ?
Parameter Value Coverage (PVC) is the ability to track coverage of a method based on the common possible values for the parameters accepted by the method.
Current code coverage tools fail to take into consideration the possibility that a value for a parameter is not handled resulting in a bug. However, there may not be any code addressing this value in any way, introducing the possibility of obtaining 100% code coverage or line coverage (LC) without detecting the bug.
If the common values for types, especially primitive types and known types, are documented and methods that use them are required to have a test for each possible parameter value, bugs can be avoided.
The following is a table of parameter value requirements for an int or System.Int32 and string or System.String. A unit test should exist for each of the possible values in order to have 100% PVC.
A positive integer
A negative integer
int.MaxValue or 2,147,483,647
int.MinValue or -2,147,483,648
A null string
An empty string, String.Empty, or “”
One or more spaces ” “
One or more tabs ” “
A new line or Environment.NewLine
A valid string.
An invalid or junk string
Unicode characters such as Chinese