I am working on code clone detection. For this purpose I made program dependency graphs of C code using a tool named frama-c. Now I have to extract features/metrics from these program dependency graphs for further processing. Is frama-c can extract metrics from program dependency graph? If not, is there any other tool that can extract features/metrics from program dependency graph. My operating system is windows 10 . Please help me in this issue ??

From the following type of piece of Code I made program dependency graph.

void sumProd1A(int n) {
    double sum = 0.0; //C1
    double prod = 1.0;
    int i;
    for (i = 1; i <= n; i++)
        sum = sum + i;
        prod = prod * i;
        foo2(sum, prod);
void main()
    printf("\nsumProd1A_Cordy: %lf ");

The following type of Program dependency graph of above code is generated by using frama-c

enter image description here

From This Program dependency graph I want to extract semantic features/metrics. For example metrics/features given below

  • number of Assignments that come after Declarations
  • the number of Declarations coming after Control (e.g. i < count,for, while, if, switch etc.)
  • the numbers of times nested iterations occur
  • the numbers of times nested selections occur,

    and so on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.