0% found this document useful (0 votes)
20 views4 pages

软件白盒测试的方法与实践

This paper discusses the methods, tools, and practices of software white-box testing, focusing on techniques such as static analysis, coverage testing, and runtime error checking. It includes various metrics and frameworks for evaluating software maintainability and testability. The document also references specific tools and standards relevant to software testing.

Uploaded by

asd675088
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

软件白盒测试的方法与实践

This paper discusses the methods, tools, and practices of software white-box testing, focusing on techniques such as static analysis, coverage testing, and runtime error checking. It includes various metrics and frameworks for evaluating software maintainability and testability. The document also references specific tools and standards relevant to software testing.

Uploaded by

asd675088
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

26 12 2000 12

Vol.26 12 Computer Engineering December 2000

1000 3428(2000)12 0087 04 A TP311.5

32 200233

The Methods and Practice of Software White-box Testing


FENG Liang YAN Shaoqing
(The 32nd Electronic Reaearch Institute of Information Industry Ministry Shanghai 200233)
Abstract This paper introduces the methods,tools and practice of software white-box testing, including software static analysis, coverage testing
and runtime error checking.
Key words White-box testing; Static analysis; Measurements for maintainability; Coverage testing Runtime error checking

Halstead
n1 N1
C/C++ n2 N2 4
1
Halstead n n=n1+n2
N N=N1+N2
V V* L
CASE I D LAMB
CASE CASE
LOGISCOPE n1 N1 n2 N2 4
1.1 V=N*Log2n (N1+N2)*Log2(n1+n2)
ISO/IEC 9126
AVGS
AVGS =(N1+N2)/STMT VOCF ,
VOCF=(N1+N2)/(n1+n2)

1
3

5 n1 4
N1 n2
N2 STMT
4 Halstead STMT

STateMents McCabe
Halstead McCabe G V(G)

87
V(G)=E-n+2
E G n G
V(G)

"Switch Case"
function_STABILITY 4
CASE LOGISCOPE V(G)
NBCALLING RETU
V(G)
DRCT_CALLS
PARA function_TESTABILITY
V(G)=E-n+2+AEn+AEx 4 DRCT_
AEn AEx CALLS LEVL PATH
V(G) PARA function_ANALYZABILITY
C 4 VG
void STMT AVGS
{ COMF function_
while ( 1) CHANGEABILITY 4
{
GOTO GOTO VOCF
n statement(s);
LVAR PARA
if ( 2)
4
return;
}
function_
}
V(G) MAINTAINABILITY = function_
1 ANALYZABILITY +function_CHANGEABILITY +function_
STABILITY +function_TESTABILITY
E=8
n=8
AEn=0
AEx=1
if V(G)=8-8+2+0+1=3

1.2
while CASE
1 V G
V(G)

GOTO

2 if (x=y) {...} *=, /=, -= C


C++

LVAR
1.3
LCOBc
VERILOG
LOGISCOPE ISO/IEC9126

LOGISCOPE
GA_CYCLE C
++ GH_
URI
3 LOGISCOPE

LOGISCOPE RuleChecker

88
A B C
2 (Block1)
if 1 then
(Block2)
/ Else
(Block3)
End if D E
if 2 then
(Block4)
2.1 Else
End if
(Block5)

Block3 Block4
B
3 1 D
Instruction Blocks,IB
Decision-to-Decision Paths,DDP A
/ (Modified Condition/Decision
Coverage,MCDC) C E
Block1 DDP 2
Block2 Block5
2 DDP
Procedure-to-Procedure Paths,PPP
1 IB
1
IB
A B C

T T F T
2 DDP
F T F F
Decision-to-Decision Paths DDP

T F
if, while,
DDP B C
if, while, DDP B
DDP 100% F
2 A AND(B OR C) MCDC
DDP 100%
DDP 2
2 DDP A B C
3 MCDC Tc1 T T F T
/ "
Tc2 T F T T
- " RTCA/DO-178B
A " Tc3 T F F F
" Tc4 F T F F
RTCA/DO-178B MCDC
A MCDC
MCDC T F
1 Tc1 Tc4
A Tc1 Tc3
2 (AND,OR, ) B Tc2 Tc3
C MCDC
A AND(B OR C) MCDC

MCDC AND 3
OR Tc1 Tc2
C A AND(B OR C) A Tc3 Tc4
B Tc2 Tc3

89
C NuMega TrueCoverage PureCoverage
3
A B C
Tc1 F F T F 3
Tc2 T F T T

Tc3 T F F F
Tc4 T T F T C/C++ Windows
4 PPP API
(Procedure-to-Procedure paths) OLE

PPP C++
............
2.2 char * s;
s=new char[1000];
5 DDP s= asdfgh........ ;
4 4 ............
4
DDP
1 2 3 4 5 " " s=new char [
DDP DDP
1000]; " " 1000
T1 60% 20%
s="asdfgh............"; " "
T2 40% 20%
1000
T3 40% 20%

T4 40% 0%

T1+T2+T3+T4 100%

4 T4 DDP 40% s="asdfgh............"; strcpy(s,"asdfgh ............ );


DDP T1
4
5 DDP
3.1
T4
1
4 5 100% Purify for WinNT/Sun Solaris
NuMega BoundsChecker for Win95/98/NT/2000 NuMega
2
Pure Java Delphi VB C++
3 Builder
4
T1 T3 T2 CASE
3
3 T1 T2 T3
DDP CASE

MCDC CASE
1 Pressman R S.Software Engineering: A Practitioner's Approach
2.3 (Fourth Edition).McGraw-Hill, 1997
LOGISCOPE NuMega TrueCoverage 2 , . . : , 1997
PureCoverage 3 LOGISCOPE 3 . . : ,1999

IB DDP MCDC PPP 4 . . : ,


MCDC 1999
MCDC

90

You might also like