Thread: c code for software testing-linux

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    15

    c code for software testing-linux

    i got an assignment regarding testing, i have to write a c code and compile in
    linux. the question is as found at:
    CS 206 Programming Assignment: Effectiveness of Different Coverage Criteria in Exposing Faults via Testing

    please suggest, i have no idea to start

  2. #2
    Registered User
    Join Date
    Nov 2011
    Posts
    15

    software testing of a 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.
    tcas.c:73:0x8048470:0
    tcas.c:75:0x8048480:0
    and so on...
    ii) the second text file contains all the statements executed by the test case 0(stmt.txt).e.g.
    tcas.c:49
    tcas.c:50
    tcas.c:51
    .
    .
    .
    iii) the third text file contains all the functions executed by the test case 0(func.txt).e.g.
    Own_Below_Threat
    Non_Crossing_Biased_Descend
    initialize
    main
    .
    .
    .
    .
    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.
    (tcas.c:51, tcas.c:58)
    (tcas.c:54, tcas.c:158)
    .
    .
    .

    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Software Testing, references & bibliography
    By Mario F. in forum Tech Board
    Replies: 5
    Last Post: 08-23-2009, 09:51 PM
  2. Software performance and benchmark testing
    By cjschw in forum C++ Programming
    Replies: 1
    Last Post: 03-17-2004, 02:24 PM
  3. Software Testing Techniques -by Boris Beizer
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-06-2002, 08:12 AM
  4. Question about Software Testing
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 04-08-2002, 09:47 AM
  5. Software Testing to Programming
    By stratovarius519 in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 02-23-2002, 01:05 PM

Tags for this Thread