Unit test Generation method in Parasoft

sunboysunboy Posts: 4

hello every one..
it is my question...is 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.
tnx

Comments

  • MirekMirek Posts: 136 ✭✭✭

    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?

  • sunboysunboy 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 :
    maxposfloat,minposfloat,maxnegfloat,minnegfloat,0.0f,1.0f,-1.0f,maxint,minint
    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

Sign In or Register to comment.