US Software Capstone Design Project

GNAT - Graphical Network Analysis Tool

Detailed Test Plan

 

 

Design Team:

Matt Ericson

John Kobinski

Matt Petro

Rob Waltz

 

 

Client:

Rich Ames, US Software

 

 

 

 

v1.0

February 27, 1998

Last revision: 2/27/98

TABLE OF CONTENTS 

EXECUTIVE SUMMARY *

UNIT LEVEL TESTS *

Gnat *

Statistics Module *

Display Module *

Snoop *

ParsePacket *

Checksum *

PassPacket *

RetransPacket *

Packet List *

ZeroWindow, Retrans *

Connection List *

Find Connection *

Connection List *

INTEGRATION & SYSTEM LEVEL TESTS *

Black Box Test Plan *

 

 

EXECUTIVE SUMMARY

 

This document covers the test plan for ensuring the correct functioning of the GNAT software. Included in this plan are analyses of both white box and black box testing. For white box testing, plans for invocation, branch, loop and condition coverage testing for all major functional units are presented. For black box testing, equivalence partitioning and boundary analysis for all input data is discusses. Additionally, the data necessary to perform all tests is presented.

 

All code listed in this document is pseudocode, not actual Java. This facilitates an understanding of the algorithms without requiring the reader to understand the nuances of the Java language. Also, the structures and objects referred to in this document are fully described in the GNAT design document. This can be found on the GNAT World Wide Web site at http://www.cse.nau.edu/~synthesis/Path_to_Synthesis/EGR486/CSE/97-Projects/ussoftware/index.html.

 

UNIT LEVEL TESTS

Gnat

  1. White Box Test Plan
    1. Constructor
      1. Pseudocode
      2. 1. Create main window and menus

         

      3. Flow Diagram
      4.  

         

      5. Branch coverage plan
      6. This plan is trivial, as there is no branching in the constructor. To test the GUI, the software will be started and the appearance of the window and menus will be verified.

      7. Branch coverage test data
      8. None.

      9. Loop coverage plan
      10. Trivial. See branch coverage.

      11. Loop coverage test data
      12. None.

      13. Condition coverage plan
      14. Trivial. See branch coverage.

      15. Condition coverage test data

      None.

       

    2. Event Handler – makes the appropriate function call when a menu item is selected
      1. Pseudocode
      2. 1. if (menucommand = Open)

        2. verifySnoopfile(Snoopfile)

        3. Snoop(Snoopfile)

        4. else if (menucommand = Close)

        5. close Snoop file

        6. else if (menucommand = Exit)

        7. terminate program

        8. else if (menucommand = About)

        9. display About box

        10. else if (menucommand = Retransmissions)

        11. display retransmissions statistics

        12. else if (menucommand = Checksums)

        13. display checksums statistics

        14. else if (menucommand = General)

        15. display general statistics

        16. else if (menucommand = Sequence vs. time)

        17. display sequence vs. time graph

        18. end if

         

        Note: This pseudocode will be within an event handler function. This function will be called to handle any action which involves a menu command (ie: any item in a menu is selected). Thus, this code will function as though it is within a while loop which executes one iteration only when the user performs some action.

         

      3. Flow diagram
      4.  


         

         

         

         

         

         

         


         

        Cyclomatic complexity = number of regions = 8

         

      5. Branch coverage plan
      6. Path1: 1,2,3,18

        Path 2: 4,5,18

        Path 3: 8,9,18

        Path 4: 10,11,18

        Path 5: 12,13,18

        Path 6: 14,15,18

        Path 7: 16,17,18

        Path 8: 6,7

         

      7. Branch coverage test data
      8. The branch coverage data takes the form of a series of use cases, since the input in this case is a series of user actions. The following cases will be executed in the order in which they are listed.

        Case 1: User chooses to open a valid Snoop file

        Case 2: User chooses to close the Snoop file

        Case 3: User chooses to view the About box

        Case 4: User chooses to view retransmission statistics

        Case 5: User chooses to view checksum statistics

        Case 6: User chooses to view general statistics

        Case 7: User chooses to view the sequence vs. time graph

        Case 8: User chooses to exit the software

         

      9. Loop coverage plan
      10. Since there are no maximum values for the loops which will be taken through this section of code (ie: the user can choose any of the menu commands as many times as he or she would like), testing an upper bound on the loops is impossible. Therefore, the loops will be tested similarly to the branch coverage. Each branch through the code will be taken once, to verify that the loop operates correctly (ie: once the user has chosen a menu command and the command has finished, the software returns to its previous state of waiting for more input). Also, each branch will be executed twice in a row in order to verify that all functionality is repeatable.

      11. Loop coverage test data
      12. Test 1: Same as branch coverage.

        Test 2: Same as branch coverage, but each branch will be executed two times in a row.

      13. Condition coverage plan
      14. Since the conditions in this section of code are very simple, the condition testing degenerates into branch testing. Thus, the branch coverage tests will be enough to verify that the conditional operators in the code are correct.

      15. Condition coverage test data

      Same as branch coverage

       

    3. VerifySnoopfile(Snoopfile)
      1. Pseudocode
      2. 1. open Snoop file

        2. if (idpattern != "snoop")

        3. return badsnoopfile

        4. if (versionnumber != 2)

        5. return badsnoopfile

        6. if (datalinktype != 0) &&

        7. (datalinktype != 4)

        8. return badsnoopfile

        9. return goodsnoopfile

         

      3. Flow Diagram
      4.  

         

         

         

         

         


         


         

         


         

         

        Cyclomatic complexity = number of areas = 5

        Path 1: 1,2,3

        Path 2: 1,2,4,5

        Path 3: 1,2,4,6,7,8

        Path 4: 1,2,4,6,7,9

        Path 5: 1,2,4,6,9

         

      5. Branch Coverage Plan
      6. Path 1: Snoop file with bad identification pattern

        Path 2: Snoop file with incorrect version number

        Path 3: Snoop file with incorrect datalink type

        Path 4: Good Snoop file with datalink of 0

        Path 5: Good Snoop file with datalink of 4

         

      7. Loop Coverage Plan
      8. There are no loops in this section of code.

         

      9. Condition coverage plan

Covered by branch coverage

 

  1. Black Box Test Plan
    1. Equivalence Partitioning
      1. There is essentially no equivalence partitioning to be done in this module, as the input is user actions. Thus, the white box test plan will uncover any errors in the GUI and black box testing is trivial.
    2. Boundary Value Analysis
      1. Just like equivalence partitioning, BVA is trivial for this section of code. Since the input set is just the user’s menu selections, there are really no boundaries to test. Thus, BVA is unnecessary.

 

Statistics Module

  1. White Box Test Plan
    1. Unit 1 – Retransmission Statistics
      1. Pseudocode
  1. 1. total = retransList.total;

2. percent = total / packetList.total;

3. packet = retransList.packetlist;

4. winarray = new int[total];

5. i = 0

6. while( packet.next){

7. avWinSize = winarray[i] = packet.next.windowSize;

8. avPacketSize=packarray[i++]=packet.next.packetSize;

9. packet = packet.next;}

10. avWinSize /= total;

11. avPacketSize /= total;

12. new DisplayRetrans( total, percent, avWinsize,

13. avPacketSize, winarray[], packarray[],

14. retransList.packetList, retransList.connectionList);

 

      1. Flow Diagram
      2.  

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        Cyclomatic Complexity = V(G) = E – N + 2 = 4 – 4 + 2 = 2

        Path1: 1,2,3,4,5,6,10,11,12

        Path2: 1,2,3,4,5,6,7,8,9,6,10,11,12

         

      3. Branch Coverage Plan
      4. Path1 1 Empty Retransmission List : retransList.total = 0

        Path2 1 Retransmission List with one packet: retransList.total = 1

         

      5. Loop Coverage Plan
      6. Loop 20 times = Retransmission list with 20 packets

        Loop MAX-1 times = Retransmission list with 19999 packets

        Loop MAX time = Retransmission list with 20000 packets

        Loop MAX+1 time = Retransmission list with 20001 packets

         

      7. Condition Coverage Plan

Covered in Branching

 

    1. Unit 2 – Checksums
      1. Pseudocode
      2. 1. total = checksumList.total

        2. percent = total / packetList.total

        3. new DisplayChecksums( total, percent,

        checksumList.packetList,

        checksumList.connectionList)

      3. Flow Diagram
      4.  

         

         

        Cyclomatic Complexity = V(G) = E – N + 2 = 1 – 0 + 2 = 1

        Path1: 1,2,3

         

      5. Branching Coverage Plan
      6. Path1 1 Valid ChecksumList

         

      7. Looping Coverage Plan
      8. NO LOOPING

         

      9. Condition Coverage Plan

      NO CONDITIONAL CODE

       

    2. Unit 3 - ZeroWindows
      1. Pseudocode
    1. 1. total = zerowindowList.total
    2. 2. percent = total / packetList.total
    3. 3. new DisplayZerowindows( total, percent,
    4. zerowindowList.packetList,
    5. zerowindowList.connectionList)

 

      1. Flow Diagram
      2.  

         

         

        Cyclomatic Complexity = V(G) = E – N + 2 = 1 – 0 + 2 = 1

        Path1: 1,2,3

         

      3. Branch Coverage Plan
      4. Path1 1 Valid ZeroWindow List

         

      5. Loop Coverage Plan
      6. NO LOOPING

         

      7. Conditional Coverage Plan

NO CONDITIONAL CODE

 

    1. Unit 4 – General Statistics
      1. Pseudocode

1. if ( packetList.size < 2 )

2. quit();

3. packet = packetList.packetList;

4. startTime = packet.next.timestamp;

5. while( packet.next ){

6. bytes += packet.next.packetSize;

    1. 7. packet = packet.next;}
    2. 8. endtime = packet.timeStamp;
    3. 9. traffic = bytes / (endtime – startTime);
    4. 10. throughput = (bytes – (stats.retrans.avpacksize *
    5. retransList.total ) / (endtime – startTime);

11. new DisplayGeneral( traffic, throughput );

 

      1. Flow Diagram
      2.  

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        Cyclomatic Complexity = V(G) = E – N + 2 = 8 – 7 + 2 + EXIT = 3

        Path1: 1,2

        Path2: 1,3,4,5,8,9,10,11 (Path 2 will never be taken because of condition in Path 1, if there are less than 2 packets, EXIT, if more, the loop will execute at least once)

        Path3: 1,2,3,4,5,6,7,5,8,9,10,11

         

      3. Branching Coverage Plan
      4. Path1 1 Valid packet list with less than 2 packets

        Path3 1 Packet List with 2 packets

         

      5. Looping Coverage Plan
      6. Loop 20 times = Packet list with 20 packets

        Loop MAX-1 times = Packet list with 19999 packets

        Loop MAX time = Packet list with 20000 packets

        Loop MAX+1 time = Packet list with 20001 packets

         

      7. Condition Coverage Plan

Covered in Branching

 

    1. Unit 5 – Burstiness
      1. Pseudocode
      2. 1. packet = packetList.next

        2. while(packet.next){

        3. starttime = packet.next.timestamp

        4. if( !packet.next.next)

        5. break;

        6. endtime = packet.next.next.timestamp

        7. bytes = packet.next.packsize

        8. burstiarray[i] = bytes / (endtime – starttime)

        9. bytearray[i] = bytes}

        10. condense (burstiarray[], bytearray[])

        11. new DisplayHist( burstiarray, bytearray, i )

         

      3. Flow Diagram
      4.  

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        Cyclomatic complexity: V(G) = E – N + 2 = 8 – 7 + 2 = 3

        Path 1: 1,2,3,10

        Path 2: 1,2,3,4,5,4,10

        Path 3: 1,2,3,4,6,7,8,9,4,10

         

      5. Branching Coverage Plan
      6. Path 1 Empty Packet List

        Path 2 Packet List with 1 packet

        Path 3 Packet List with 2 packets

         

      7. Looping Coverage Plan
      8. Loop 20 times: Packet List with 21 packets

        Loop MAX-1 times: Packet List with 19999 packets

        Loop MAX times: Packet List with 20000 packets

        Loop MAX+1 times: Packet List with 20001 packets

         

      9. Condition Coverage Plan

      Covered in Branching

       

    2. Unit 6 – Sequence vs. Time
      1. Pseudocode
      2. 1. packet = packetList.packetList

        2. while( packet.next ){

        3. timearray[i] = packet.timestamp

        4. sequencearray[i] = packet.sequence

        5. packet = packet.next}

        6. new DisplaySeqVTime( timearray[], sequencearray[], i )

         

      3. Flow Diagram
      4.  

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        Cyclomatic Complexity = V(G) = E – N + 2 = 4 – 4 + 2 = 2

        Path 1: 1,2,6

        Path 2: 1,2,3,4,5,2,6

         

      5. Branching Coverage Plan
      6. Path 1 Empty Packet List

        Path 2 Packet List with 1 packet

         

      7. Looping Coverage Plan
      8. Loop 20 times: Packet List with 20 packets

        Loop MAX-1 times: Packet List with 19999 packets

        Loop MAX times: Packet List with 20000 packets

        Loop MAX+1 times: Packet List with 20001 packets

         

      9. Condition Coverage Plan

Covered in Branching

 

  1. Black Box Test Plan

This module will not be black box tested because it’s components do not interact. The units are grouped together because of their similarity, and not because they form a cohesive, co-dependent section of code. There are no internal function calls, so invocation testing won’t be performed either.

 

Display Module

  1. White Box Test Plan
    1. Unit 1 – Display PieChart
    1. Pseudocode
    2. 1. for(int i = 0; i < size; i++){

      2. newTheta += 3.6 * pieces[i].intValue();

      3. switch(i%4){

      4. case 0: g.setColor(Color.red);break

      5. case 1: g.setColor(Color.yellow);break

      6. case 2: g.setColor(Color.blue);break

      7. case 3: g.setColor(Color.green);break}

      8. g.fillArc(startx,starty,width,width,

      9. (int)theta,(int)newTheta)

      10. theta = newTheta}

      11. show

       

    3. Flow Diagram
    4.  

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

      Cyclomatic Complexity = V(G) = E – N + 2 = 13 – 10 + 2 = 5

      Path1: 1,2,3,10

      Path2: 1,2,3,4,8,9,3,10

      Path3: 1,2,3,4,8,9,3,5,8,9,3,10

      Path4: 1,2,3,4,8,9,3,5,8,9,3,6,8,9,3,10

      Path5: 1,2,3,7,8,9,3,5,8,9,3,6,8,9,3,7,8,9,3,10

       

    5. Branching Coverage Plan
    6. Path1: Function call with size = 0;

      Path2: Function call with size = 1, and input array with 1 valid cell

      Path3: Function call with size = 2, and input array with 2 valid cells

      Path4: Function call with size = 3, and input array with 3 valid cells

      Path5: Function call with size = 4, and input array with 4 valid cells

       

    7. Looping Coverage Plan
    8. Loop 20 times: function call with size = 20, and input array with 20 valid cells

      Loop MAX-1 times: function call with size = 359, and input array with 359 valid cells

      Loop MAX times: function call with size = 360, and input array with 360 valid cells

      Loop MAX+1 times: function call with size = 361, and input array with 361 valid cells

       

    9. Condition Coverage Plan

Covered in Branching

 

    1. Unit 2 – Display Histogram / BarGraph
    1. Pseudocode
    2. 1. xpix = window.sizex() * .9

      2. ypix = window.sizey() * .9

      3. xslope = MAX(xval[]) * 1.2 / xpix

      4. yslope = ypix / size

      5. window.changeOrigin((window.sizex() – xpix) / 2,

      6. (window.sizey() – ypix) / 2)

      7. yoffset = 0

      8. while(i++ < size){

      9. drawRectangle(0,xslope*xval[i],

      10. yoffset,yslope,color)

      11. yoffset += yslope}

      12. show

       

    3. Flow Diagram
    4.  

       

       

       

       

       

       

       

       

       

       

       

       

       

      Cyclomatic Complexity = V(G) = E – N + 2 = 4 – 4 + 2 = 2

      Path1: 1,2,3,4,5,6,7,10

      Path2: 1,2,3,4,5,6,7,8,9,7,10

       

    5. Branching Coverage Plan
    6. Path1 input size = 0

      Path2 input size = 1, and input xval and yval with one valid cell

       

    7. Looping Coverage Plan
    8. Looping 20 times: input size = 20, input xval and yval with 20 valid cells

      Looping MAX-1 times: input size = 19999, input xval and yval with 19999 valid cells

      Looping MAX times: input size = 20000, input xval and yval with 20000 valid cells

      Looping MAX+1 times: input size = 20001, input xval and yval with 20001 valid cells

       

    9. Conditional Coverage Plan

Covered in Branching

 

 

    1. Unit 3 – Display Sequence vs. Time
      1. Pseudocode
      2. 1. xpix = window.sizex() * .9

        2. ypix = window.sizey() * .9

        3. xslope = MAX(xval[]) / xpix

        4. yslope = ypix / size

        5. window.changeOrigin((window.sizex() * size – xpix)/2,

        6. (window.sizey() – pixy)/2)

        7. xoffset = 0

        8. yoffset = 0

        9. while(i++ < size){

        10. draw.Line(xoffset,yoffset,xval[i]/xslope,yoffset)

        11. xoffset += xval[i] / xslope;

        12. yoffset += yslope}

        13. show

         

      3. Flow Diagram
      4.  

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        Cyclomatic Complexity = V(G) = E – N + 2 = 4 – 4 + 2 = 2

        Path1: 1,2,3,4,5,6,7,8,12

        Path2: 1,2,3,4,5,6,7,8,8,9,10,11,9,12

         

      5. Branching Coverage Plan
      6. Path1 input size = 0

        Path2 input size = 1, input arrays xval and yval have 1 valid cell

         

      7. Looping Coverage Plan
      8. Loop 20 times: input size = 20, xval and yval have 20 valid cells

        Loop MAX-1 times: input size = 19999, xval and yval have 19999 valid cells

        Loop MAX times: input size = 20000, xval and yval have 20000 valid cells

        Loop MAX+1 times: input size = 20001, xval and yval have 20001 valid cells

         

      9. Condition Coverage Plan

Covered in Branching

 

  1. Black Box Test Plan

This module will not be black box tested because it’s components do not interact. The units are grouped together because of their similarity, and not because they form a cohesive, co-dependent section of code. There are no internal function calls, so invocation testing won’t be performed either.

 

Snoop

  1. White Box Test Plan
    1. Main unit
      1. Pseudocode
      2. 1. while(offset = ParsePacket(snoopfile, parent,

        2. ipoffset);){

        3. RetransPacket(connectionList);

        4. Checksum(ipoffset, offset);

        5. PassPacket();}

        6. exit

         

      3. Flow diagram
      4.  

        Cyclomatic Complexity = V(G) = 5 – 5 + 2 = 2

        Path1: 1,2,3,4,1,5

        Path2: 1,5

         

      5. Branching Coverage Plan
      6. Path1 A valid snoopfile with at least 1 packet

        Path2 A valid snoopfile with 0 packets

         

      7. Looping Coverage Plan
      8. Loop 20 times = Snoop2 file with 20 Packets

        Loop MAX –1 times = Snoop2 file with 19,999 packets

        Loop MAX times = Snoop2 file with 20,000 packets

        Loop MAX + 1 times = Snoop2 file with 20,001 packets

         

      9. Conditional Coverage Plan

A Snoop2 file with many packets

A Snoop2 file with 0 packets

 

  1. Black Box Test Plan

The data to be used to test the snoop function will come from packets with known values. One packet will contain a packet with an odd number of bytes to test the checksum function. One snoop file will have no packets in it. Another will have 19,999 packets, one with 20,000, and on with 20,001 packets to test the control structures within snoop. One snoop file will be larger than 1.44MBytes to test the checksum and parsepacket functions. One snoop file will have a single packet within it that is larger than 1.44MBytes which will represent a worst case scenario for large packet size, according to the specifications. These test plans can only be implemented if we had a tool to generate packets with the known values. Since we don’t know of any tools to generate packets, these test plans are based the use of such a tool.

 

 

 

ParsePacket

  1. White Box Test Plan
    1. Main Unit
      1. Pseudocode
      2. 1. if(ipoffset == 0);

        2. file_seek(snoopfile, snoop_header_size,

        3. Cur_Position, forward);

        4. size_of_packet = read(snoopfile, 4_Bytes);

        5. ipoffset = ipoffset + size_of_packet;

        6. for( size_of_packet > 0; size_of_packet =

        7. size_of_packet +1;) {

        8. addtolist(PacketList, read(snoopfile,1_Byte); }

        9. return(ipoffset);

         

      3. Flow Diagram
      4. Cyclomatic Complexity = V(G) = 8 – 7 + 2 = 3

        Path1: 1,3,4,5,7

        Path2: 1,2,3,4,5,7

        Path3: 1,2,3,4,5,6,5,7

         

      5. Branch Coverage Plan
      6. Path1 Not the first packet and a packet size of 0

        Path2 The first packet, and a packet size of 0

        Path3 Not the first packet and a packet size greater than 0

        Path4 The first packet, and a packet size greater than 0

         

      7. Loop Coverage Plan
      8. Loop 20 times = Snoop2 file with 20 Packets

        Loop MAX –1 times = Snoop2 file with 19,999 packets

        Loop MAX times = Snoop2 file with 20,000 packets

        Loop MAX + 1 times = Snoop2 file with 20,001 packets

         

      9. Conditional Coverage Plan

    A Snoop2 file with many packets

    A Snoop2 file with 0 packets

     

  2. Black Box Test Plan

This module will not be black box tested because it’s components do not interact. The units are grouped together because of their similarity, and not because they form a cohesive, co-dependent section of code. There are no internal function calls, so invocation testing won’t be performed either.

 

Checksum

  1. White Box Test Plan
    1. Main Unit
      1. Pseudocode
      2. 1. register long sum;

        2. count = ipoffset;

        3. while( count > 1 ){

        4. sum = sum + * (unsigned short) addr++;

        5. count = count - 2;}

        6. if( count > 0 )

        7. sum = sum + * (unsigned char *) addr;

        8. appendPacket( ~sum, cList);

      3. Flow Diagram
      4. Cyclomatic Complexity = V(G) = 6 – 8 + 2 = 0

        Path 1: 12,3,4,5,3,4,5,6,7,8

         

      5. Branch Coverage Plan
      6. Path1 A packet larger than 0, with an odd number of bytes

         

      7. Loop Coverage Plan
      8. No Loop = ipoffset < 0, if no packets are available

        Loop MAX –1 times = Packet 1 byte smaller than 1.44 MBytes

        Loop MAX times = Packet the size of a floppy disk

        Loop Max +1 times = Packet the size of 1.44MBytes + 1 Byte

         

      9. Condition Coverage Plan

    No packets

    1 small packet (< 2kBytes )

    Many small packets

    1 Large packet (1.44 MBytes)

    1 Extra Large packet (1.44 Mbytes + 1 Byte)

     

  2. Black Box Test Plan

This module will not be black box tested because its components do not interact. The units are grouped together because of their similarity, and not because they form a cohesive, co-dependent section of code. There are no internal function calls, so invocation testing won’t be performed either.

 

PassPacket

  1. White Box Test Plan
    1. Main Unit
      1. Pseudocode
      2. 1. addtolist(ZeroPacketList, zList);

        2. addtolist(PacketList, pList);

        3. addtolist(ConnectionList, cList);

        Note: The addtolist() function represents built in functionality within Java.

         

      3. Flow Diagram
      4.  

        Cyclomatic complexity = V(G) = 2 –3 +2 = 1

        Path1: 1,2,3

         

      5. Branch Coverage Plan
      6. Path1 Any packets are valid data

         

      7. Loop Coverage Plan
      8. No looping occurs within the function

         

      9. Condition Coverage Plan

    No conditional tests

     

  2. Black Box Test Plan

This module will not be black box tested because it’s components do not interact. The units are grouped together because of their similarity, and not because they form a cohesive, co-dependent section of code. There are no internal function calls, so invocation testing won’t be performed either.

 

RetransPacket

  1. White Box Test Plan
    1. Main Unit
      1. Pseudocode
      2. 1. Packet retrans = ConnectionList.findSequence(packet);

        2. if(retrans != null) {

        3. retrans.retransmission = true;

        4. return;

         

      3. Flow Diagram
      4.  

         



         

        Cyclomatic complexity = V(G) = 4 – 4 +2 = 2

        Path1: 1,2,3,4

        Path2: 1,2,4

         

      5. Branch Coverage Plan
      6. Path1 Any packets are valid data

         

      7. Loop Coverage Plan
      8. retrans = null;

        retrans != null;

         

      9. Condition Coverage Plan

    See Loop Coverage Plan

     

  2. Black Box Test Plan

This module will not be black box tested because it’s components do not interact. The units are grouped together because of their similarity, and not because they form a cohesive, co-dependent section of code. There are no internal function calls, so invocation testing won’t be performed either.

 

Packet List

  1. White Box Test Plan
    1. Constructor
      1. Pseudocode
      2. 1. first = last = null;

        2. num_of_packets = 0;

         

         

         

         

         

         

         

         

      3. Flow Diagram
      4. Cyclomatic complexity = V(G) = E –N + 2 = 1 – 2 +2 = 1

         

      5. Branch Coverage Plan
      6. Path 1: 1,2

        Path 1: 1,2 no input

         

      7. Looping
      8. Path 1: 1,2

        Path 1: 1,2 no input

         

      9. Condition

      Path 1: 1,2

      Path 1: 1,2 no input

      This is only a constructor and will require no data only to be called

       

    2. Append (packet NewPacket)
      1. Pseudocode
      2. 1. last.next = NewPacket;

        2. last = last.next;

        3. num_of_packets = 0;

         

      3. Flow Diagram
      4. Cyclomatic complexity = V(G) = E –N + 2 = 2 – 3 + 2 = 1

        Path 1: 1,2,3

        Path 1: 1,2,3 Valid Packet

      5. Branch Coverage Plan
      6. Path 1: Valid Packet

      7. Loop Coverage Plan
      8. NO LOOPING

      9. Condition Coverage Plan

      NO CONDITIONAL CODE

       

      Note: This append will only require a valid packet

       

    3. Find_packet(int number)
      1. Pseudocode
      2. 1. Packet temp = first;

        2. if (number > num_of_packets)

        3. return null

        4. for (int i = 0; i < val; i++){

        5. temp = temp.next }

        6. return (temp)

         

      3. Flow Diagram
      4.  

        Cyclomatic complexity = V(G) = E –N + 2 = 7 – 6 + 2 = 3

        Path 1: 1,2,3,6

        Path 2: 1,2,4,6

        Path 3: 1,2,4,5,4,6

         

      5. Branch Coverage Plan
      6. Path 1: The number sent in is larger then the total number of packets

        Path 2: Will never be taken because of Path 1

        Path 3: The number sent in is less that the total number of packets

         

      7. Loop Coverage Plan
      8. Loop 20 times = Packet list with 20+ packets and send in a value of 20

        Loop MAX-1 times = Packet list with 19999+ packets and send in value of 1999

        Loop MAX time = Packet list with 20000+ packets and send in a value of 20000

        Loop MAX+1 time = Packet list with 20001+ packets and send in a value 20001

         

      9. Condition Coverage Plan

Covered in branching

 

ZeroWindow, Retrans

  1. White Box Test Plan
    1. Constructor
      1. Pseudocode
      2. 1. first = last = null;

        2. num_of_packets = 0;

         

      3. Flow Diagram
      4. Cyclomatic complexity = V(G) = E –N + 2 = 1 – 2 +2 = 1

        Path 1: 1,2

        Path 1: 1,2 no input

         

      5. Branch Coverage Plan
      6. Path 1: 1,2

        Path 1: 1,2 no input

         

      7. Loop Coverage Plan
      8. Path 1: 1,2

        Path 1: 1,2 no input

         

      9. Condition Coverage Plan

      Path 1: 1,2

      Path 1: 1,2 no input

       

      Note: This is only a constructor and will require no data only to be called.

       

       

    2. Append (packet NewPacket)
      1. Pseudocode
      2. 1. if (NewPacket.PacketRef.Window == 0){

        2. last.next = NewPacket;

        3. last = last.next;

        4. num_of_packets = 0;

         

      3. Flow Diagram
      4.  

        Cyclomatic complexity = V(G) = E –N + 2 = 4 – 5 + 2 = 1

        Path 1: 1,2,3,4

        Path 2: 1,5

         

      5. Branching
      6. Path 1: Valid Packet

        Path 2: The window size or retransmissions is checked

         

      7. Looping
      8. NO LOOPING

         

      9. Condition

      Path 1: Has a Zero window

      Path 2: Does not have a zero window

       

      Note: This append will require a valid packet that has zero window or is a retransmission.

       

    3. Find_packet(int number)
      1. Pseudocode
      2. 1. Packet temp = first;

        2. if (number > num_of_packets)

        3. return null

        4. for (int I = 0; I < val; I++){

        5. temp = temp.next }

        6. return (temp)

         

         

      3. Flow Diagram
      4.  

        Cyclomatic complexity = V(G) = E –N + 2 = 7 – 6 + 2 = 3

        Path 1: 1,2,3,6

        Path 2: 1,2,4,6

        Path 3: 1,2,4,5,4,6

         

      5. Branch Coverage Plan
      6. Path 1: The number sent in is larger then the total number of packets

        Path 2: Will never be taken because of Path 1

        Path 3: The number sent in is less that the total number of packets

         

      7. Loop Coverage Plan
      8. Loop 20 times = Packet list with 20+ packets and send in a value of 20

        Loop MAX-1 times = Packet list with 19999+ packets and send in value of 1999

        Loop MAX time = Packet list with 20000+ packets and send in a value of 20000

        Loop MAX+1 time = Packet list with 20001+ packets and send in a value 20001

         

      9. Condition

Covered in branching

 

Connection List

  1. White Box Test Plan
    1. Constructor
      1. Pseudocode
      2. 1. first = last = null;

        2. num_of_packets = 0;

         

      3. Flow Diagram
      4.  

        Cyclomatic complexity = V(G) = E –N + 2 = 1 – 2 +2 = 1

        Path 1: 1,2

         

      5. Branch Coverage Plan
      6. Path 1: 1,2 no input

         

      7. Loop Coverage Plan
      8. Path 1: 1,2 no input

         

      9. Condition Coverage Plan

      Path 1: 1,2 no input

       

      Note: This is only a constructor and will require no data only to be called.

       

    2. Append (packet NewPacket)
      1. Pseudocode
      2. 1. if (NewPacket.PacketRef.Port == this.Port){

        2. last.next = NewPacket;

        3. last = last.next;

        4. num_of_packets = 0;

         

      3. Flow Diagram
      4.  

        Cyclomatic complexity = V(G) = E –N + 2 = 4 – 5 + 2 = 1

        Path 1: 1,2,3,4

        Path 2: 1,5

         

      5. Branch Coverage Plan
      6. Path 1: Valid Packet

        Path 2: The window size or retransmissions is checked

         

      7. Loop Coverage Plan
      8. NO LOOPING

         

      9. Condition

Path 1: Has a Zero window

Path 2: Does not have a zero window

 

Note: This append will require a valid packet that has zero window or is a retransmission.

 

Find Connection

  1. White Box Test Plan
    1. Main Unit
      1. Pseudocode
      2. 1. ConnectionLists temp = first;

        2. for(int i = 0; (I < num_of_connections) && (temp !=

        null); ++i){

        3. if ((temp.Port == Port)

        4. break

        5. else

        6. temp = temp.next}

        7. return temp

         

      3. Flow Diagram
      4.  

         

        Cyclomatic complexity = V(G) = E – N + 2 = 8 – 7 + 2 = 3

        Path 1: 1,2,7

        Path 2: 1,2,3,4,7

        Path 3: 1,2,3,5,6,3,7

         

      5. Branch Coverage Plan
      6. Path 1: Valid data

        Path 2: invalid data

        Path 3: 1,2 Valid data

        3 packet does not match

        5,6,3,7 Valid data

         

      7. Loop Coverage Plan
      8. Loop 20 times = Packet list with 20+ packets and send in a value of 20

        Loop MAX-1 times = Packet list with 19999+ packets and send in value of 1999

        Loop MAX time = Packet list with 20000+ packets and send in a value of 20000

        Loop MAX+1 time = Packet list with 20001+ packets and send in a value 20001

         

      9. Condition Coverage Plan

Covered in branching

 

Connection List

  1. White Box Test Plan
    1. FindSeq
      1. Pseudocode
      2. 1. ConnectionPacketList temp1 = first; C_Packet temp;

        2. for(int i = 0 ; i < num_of_connections; i ++){

        3. if (sequ.connection != first.connection)

        4. temp1 = temp1.next}

        5. if (temp1 == null)

        6. return null

        7. temp = temp1.first

        8. for( int i = 0; i < temp.num_of_connectionpackets;

        9. ++i ){

        10. if (temp.sequence != sequ.sequence )

        11. temp = temp.next}

        12. return temp

         

      3. Flow Graph
      4.  

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

         

        Cyclomatic complexity = V(G) = E – N +2 = 14 – 11 + 2 + exit = 7

        Path1: 1,2,5,6

        Path2: 1,2,3,4,2,5,6

        Path3: 1,2,3,4,2,5,7,8,9,10,8,11

        Path4: 1,2,3,2,5,7,8,9,10,8,11

        Path5: 1,2,3,4,2,5,7,8,9,8,11

        Path6: 1,2,5,7,8,11

        Path7: 1,2,3,2,5,7,8,11

         

      5. Branch Coverage Plan
      6. Path1: Needs a empty connection list

        Path2: A connection list that is not empty and does not contain the packet sent in

        Path3: A connection list that is not empty and contains the packet

        Path4: The first connection in the connection list is the packet we are looking for

        Path5: The first packet in the connection is the connection list is what we are looking for

        Path6: This event can never happen

        Path7: The Packet is in the first connection and is the first packet in the list

         

      7. Loop Coverage Plan
      8. Value = 20 A list of 20 connections and each connection has 20 packets

        MAX –1 A list of 19999 connections and each connection had 19999 packets

        MAX A list of 20000 connections and each connection had 20000 packets

        MAX + 1 A list of 20001 connections and each connection had 20001 packets

         

      9. Condition

This is covered in branch coverage.

 

INTEGRATION & SYSTEM LEVEL TESTS

 

Integration 1: 1) Module 1 – Statistics

2) Module 2 – Display

3) Module 3 – Lists

 

Black Box Test Plan

 

The input to this module consists of a packet or list of packets. The output consists of a combination of class fields and arrays. The display module is added to this build so that the class fields and arrays of Statistics can be visually verified.

 

There are two characteristics to the input data packets, the number of packets and the packet contents. The black box testing data sets will be generated by packet generation software. Equivalence partitioning and boundary testing will both be covered by the output of the software. A description of the packet generation software follows the data set description

 

Characteristic : Number of files

 

  1. Boundary Testing Plan
    1. Lower Boundary = 0
    2. Upper Boundary = 20000

     

    Test Cases: 0, 1, 19990, 20000, 20010

    (There is no test case less than 0, so none is included)

     

  2. Equivalence partitioning

Test Range Test Value

 

Characteristic: Packet contents

 

  1. Boundary Testing Plan – The following fields have boundaries
    1. packet.next (NULL – Valid address)
    2. window (0 - >0 )
    3. checksum_flag (true – false)
    4. retrans_flag (true – false)

     

    16 test cases will be generated representing every combination of the 4 values.

     

  2. Equivalence partitioning – The following fields have a range of inputs. Error handling in the class that generates ensures that these fields will have valid data, so there are no legitimate boundaries. Test cases covering every unique combination will be generated by software. Each field will be tested at a low, medium, and high value. For ints these values are 10, 32000, and 60000, respectively. For shorts these values are 10, 12000, and 30000
    1. time_stamp_sec (int)
    2. time_stamp_msec (int)
    3. source_IP (short)
    4. destination_IP (short)
    5. source_TCP_port (short)
    6. destination_TCP_port (short)
    7. sequence_num (int)
    8. ack_num (int)
    9. TCP_checksum (int)
    10. packet_data_size (int)

     

  3. Test Code

The code that develops the required test sets will loop through each of the 10 fields, changing the value from low to medium to high to test each combination possible. The final list will be broken up into pieces that meet the boundary and equivalence partitioning requirements for the number of packets in a list.