Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Unit test Generation method in Parasoft

sunboy Posts: 4

hello every one..
it is my unit test generation in parasoft based on decision path in function or not , only based on Input value of function? in the other word i want to know parasoft in unit testing consider the decision path and condition statements and generate test case or not only Input argument are important to generate test case.
Please answer if anyone Know.


  • Mirek
    Mirek Posts: 141 admin

    Hello @sunboy,

    The automatic test cases generation is based on:

    • input parameters
    • global variables accessed by the function
    • Heuristics for evaluating results of conditions (in decision points)

    We do not guarantee complete statement, path or mcdc coverage with auto-generated test cases.

    What's your intended use of automatic test case generation?

  • sunboy
    sunboy Posts: 4

    tanks for your answer.
    i have other question.when parasoft generate test for input argument.what is
    the procedure of generate values to test argument.for example consider func foo1()

    int foo1(int x)

    if (x < 10)
    return 1;
    else if (x >10 and x < 20 )
    return 2;
    else if ( x > 20 )
    return 3;
    else return 0;


    for test x values that may be generate is :
    0,1,-1,9,10,11,19,20,21,max int,min int
    this number shows that parasoft understand desicion condition and select approprate number to test boundry value.
    now , if we have foo2():

    int foo1(float f)

    if (f < 2.75)
    return -1;
    else if (f >2.75 and f < 6.75 )
    return 0;
    else if ( f > 10.25 )
    return 1;
    else return -2;

    in this example the values that generate by parasoft is :
    we expect that values like 2.8,2.6,6.74,6.73,10.24,10.26,and so on generate.
    please explain that parasoft can generate this range of value for float and so on variables ?
    tanks a lot