Monday, October 10, 2011

An idea for generating test data (3)

I told the progress making the tool was 10% but it is wrong and it is not easy.

I got some tips. I describe the tip for labeled for statement.

We can write the for statement with label and the example is following:

for1: for(int i = 0; i < 10; i++) {
  for2: for(int j = 0; j < 5; j++) {
    int k = getValue(i, j);
    if (k == 1)
      continue for1;
    else if (k == 2)
      break for1;
  }
}


But the labeled for statement is not allowed in C#. So we need to write it :

for (int i = 0; i < 10; i++) {
  for (int j = 0; j < 5; j++) {
    int k = getValue(i, j);
    if (k == 1)
      goto continue_for_for1;
    else if (k == 2)
      goto break_for_for1;
  }
continue_for_for1:
}
break_for_for1:

Tuesday, October 4, 2011

An idea for generating test data (2)

I decided to use Irony to make the tool for converting Java sources to C# sources.

It is difficult for me to use ANTLR because I cannot understand building Java AST by using ANTLR.
And I can understand building Java AST by using Irony.

I am making the tool and the progress is about 10% toward completion.