?? r2outset.c
字號:
/*====================================================================*/
/* UNIT : @(#)r2outset.c 2.4 - 08/04/99 */
/*====================================================================*/
/* PURPOSE: Writes an output report showing, for each component, */
/* which of the sets defined in M. Scully, "Augmenting */
/* Program Understanding Strategies with Test Case */
/* Based Methods", it belongs in. */
/* The computation compares the With and Tot counts for */
/* each component to the overall number of cases With */
/* and Tot in the r2anl.lst file. (Note: "with" refers */
/* to test cases that exhibit the feature being sought */
/* while "tot" is the total number of cases */
/* The set membership rules are that a component is in: */
/* ICOMPS (abrev. IC) if With >0 */
/* IICOMPS (II) if With = CasesWith */
/* CCOMPS (CC) if Tot = CasesTot */
/* RCOMPS (RC) if With = CasesWith and Tot < casesTot */
/* SHARED (SH) if With = CasesWith and Tot < casesTot */
/* and With < Tot */
/* UCOMPS (UC) if With = Tot */
/* */
/* USED BY: main() */
/* */
/* HISTORY: */
/* VER DATE AUTHOR DESCRIPTION */
/* 5 Nov 93 N. Wilde Created unit. */
/* 1.01 30 Mar 97 L. Landry Added btree interface */
/* 2.2 31 Jan 98 W. Hall Changed a format descriptor to clean */
/* up a compiler warning issue. */
/* 2.30 18 Apr 98 A. Conwell TISK30 changes */
/*--------------------------------------------------------------------*/
/*==[ INTERFACE ]=====================================================*/
#include "r2.h"
#include "r2outset.h"
#include <stdio.h>
/*==[ PRIVATE IMPLEMENTATION ]========================================*/
#include <string.h>
/*==[ PUBLIC IMPLEMENTATION ]=========================================*/
/*--------------------------------------------------------------------*/
/* FUNCTION ReadTestData */
/*--------------------------------------------------------------------*/
extern void OutputSets(
COMPLIST *cl, /* Final component list */
int casesWith, /* Cnt. cases that exhibit feature*/
int casesTot, /* Cnt. test cases total */
Tree *ptree /* Binary tree with source file*/
)
{
COMPELEM *elem; /* Component node */
COMPNODE *node;
if (2 == gTALK)
printf( "R2Analyz: casesWith = %i; casesTot= %i\n", casesWith, casesTot );
/* Iterate over the entire list */
node=get_first_node(cl);
/* Traverse the entire list, printing the sets each comp is in */
do
{
elem=(COMPELEM *)node->key;
printf("%s %05u %c ", SeekOut(elem->Index, ptree), elem->Line, elem->Cval);
if ('S' == elem->Cval) printf("%10li ", elem->Sval);
if (elem->With > 0) printf("#IC# ");
if (elem->With == casesWith) printf("#II# ");
if (elem->Tot == casesTot) printf("#CC# ");
if ((elem->With == casesWith)&&(elem->Tot < casesTot)) printf("#RC# ");
if ( (elem->With == casesWith)
&&(elem->Tot < casesTot)
&&(elem->With < elem->Tot)) printf("#SH# ");
if (elem->With == elem->Tot) printf("#UC# ");
printf("\n");
node=get_successor(node);
} while (node->key!=NULL);
} /* OutputSets() */
/*====================================================================*/
/* EOF : r2outset.c */
/*====================================================================*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -