Thread: software testing for c code in linux

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

    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.
    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.

  2. #2
    spaghetticode
    Guest
    Starting two threads for one question will usually *decrease* your chance for helpful answers rather than *increase* it.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Indeed - this is closed, the other one merged with the original post.

    c code for software testing-linux
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c code for software testing-linux
    By amnakhan786 in forum Linux Programming
    Replies: 1
    Last Post: 11-10-2011, 01:49 AM
  2. software testing of a c code in linux
    By amnakhan786 in forum Linux Programming
    Replies: 0
    Last Post: 11-10-2011, 01:49 AM
  3. Software performance and benchmark testing
    By cjschw in forum C++ Programming
    Replies: 1
    Last Post: 03-17-2004, 02:24 PM
  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