software testing for c code in linux
description of the program:
1. first i have to input a folder A by giving full filepath. this folder contains a benchmark program tcas.c, a text file universe.txt
which contains 1500 lines, each line is a test case giving 12 arguments to the benchmark program, which are used to test the conditions,
statements, functions and definition- use pairs e.g.test 0:
1258 1 0 897 174 7253 1 629 500 0 0 1.
the folder A also contains a coverage folder which has 1500 folders each describing the coverage for each test as follows:
folder A/coverage/test0/sss.txt. sss are actually four text files whose description is as follows:
i) the first text file contains all the conditions executed by the test case 0(cond.txt).e.g.
and so on...
ii) the second text file contains all the statements executed by the test case 0(stmt.txt).e.g.
iii) the third text file contains all the functions executed by the test case 0(func.txt).e.g.
iv) the fourth text file contains all the definition use pairs executed by the test case 0(defu.txt).e.g.
(tcas.c:49, tcas.c:54)// here a variable defined at 49 and used at 54.
2. in this way coverage has 1500 test cases ranging from test0.....test1500, and each testn folder contains above four text files.
Now the requirement of the code:
i have to write a code in c language which opens the folder A and picks a testn e.g. test0. for test zero it picks stmt.txt.
i.e. i am preparing a test suite for Statement coverage for program tcas.
then read all test cases and its covegare information from coverage/test$$/STMT.txt
Now each test case is not covering all the lines.So i have to pick few test cases such that union of that gives entire coverage. Now that is my 1 test suite out of 4.
i will proceed with the others in the same manner.
i want to ask that how can i write a c- language code to read statement text file in every test case and compare all 1500 statement text files such that union of a few cover all
the statements in the benchmark program tcas.c.