// ############# // # Generate event sequence covers for t=3, as defined in: // # D.R. Kuhn, J.M. Higdon, J.F. Lawrence, R.N. Kacker and Y. Lei, // # Combinatorial Methods for Event Sequence Testing, First International // # Workshop on Combinatorial Testing, IEEE Fifth International Conference on Software, // # Testing, Verification and Validation (ICST 2012), Montreal, Canada, Apr 17-21, 2012, pp. 601-609. // # // # Compiles w/ gcc: gcc -o newseq3 newseq3.c // # Usage: ./newseq3 (for exeuctable named newseq) #include #include #include #include #define MAXT 10000 #define NTRIALS 100 int N; // number of events to generate sequences for int NSEQ; // number of sequences = N(N-1)(N-2) int reversal; // toggle for whether to generate new tests by reversing just created one int ***chk; //int chk[N][N][N]; int **test; // int test[MAXT][N]; int **seq; // int seq[NSEQ][3] int **tmptest; // int test[MAXT][N]; int i,j,k,m,n,q; int nt=0, cnt=0; int fnd; int tp; int all_covered=0; int bestidx, bestcov; int i1, j1, k1; //======================================================================================== int tmpused(ti, digit, len) int ti; // index into test array int digit; // digit to check int len; // length of test to check { int i,j; for (i=0; i \n"); return 1; } N = atoi(argv[1]); NSEQ = N*(N-1)*(N-2); // allocate space for check array chk = (int ***)malloc(sizeof(int **) * N); for (i=0; i 5? 1 : 0); reversal=0; tmptest = (int **)malloc(sizeof(int *) * MAXT ); for (i=0; i=0; i--) { for (j=N-1; j>=0; j--) { for (k=N-1; k>=0; k--) { if (i != j && i != k && j != k) {seq[m][0]=i; seq[m][1]=j; seq[m][2]=k; m++; chk[i][j][k] = 0;} }}} } //============================================== // init tests with all 2-seq for (i=0; i bestcov) {bestcov=cnt; bestidx=m; } } // printf(" best %d bidx %d \n", bestcov,bestidx); for (i=0; i