# Trường Đại học Sư phạm Kỹ thuật TP.

HCM
Khoa CNTT
Bộ môn Công nghệ phần mềm
-----------------------

ĐÁP ÁN MÔN: KIỂM THỬ PHẦN MỀM
MÃ MÔN HỌC: 1279250
Đề số 01. Đáp án có 05 trang
-----------------------

Câu 1
a. 46 simple-paths.
14 prime-paths:
1.[0,1,3,5,6]
4.[0,2,3,5,6]
7.[0,2,3,0]
10.[1,3,0,2]
13.[2,3,0,2]

2.[0,1,3,4,6]
5.[0,2,3,6]
8.[0,1,3,0]
11.[3,0,1,3]
14. [2,3,0,1]

3.[0,2,3,4,6]
6.[1,3,0,1]
9.[0,1,3,6]
12.[3,0,2,3]

b. 4 test paths are needed for Edge Coverage
[0,2,3,4,6]
[0,2,3,5,6]
[0,1,3,6]
[0,2,3,0,2,3,6]
c. Sinh viên có thể đưa ra nhiều bộ test khác nhau miễn là thỏa điều kiện bao phủ
Test Paths
Test Requirements that are toured by test paths directly
[0,1,3,5,6]

[0,1,3,5,6]

[0,1,3,4,6]

[0,1,3,4,6]

[0,2,3,4,6]

[0,2,3,4,6]

[0,2,3,5,6]

[0,2,3,5,6]

[0,1,3,0,1,3,6] [1,3,0,1], [0,1,3,0], [0,1,3,6], [3,0,1,3]
[0,2,3,0,2,3,6] [0,2,3,6], [0,2,3,0], [3,0,2,3], [2,3,0,2]
[0,1,3,0,2,3,6] [0,2,3,6], [0,1,3,0], [1,3,0,2], [3,0,2,3]
[0,2,3,0,1,3,6] [0,2,3,0], [0,1,3,6], [3,0,1,3], [2,3,0,1]
Test Paths

Test Requirements that are toured by test paths with sidetrips

[0,1,3,5,6]

None

[0,1,3,4,6]

None

[0,2,3,4,6]

None

[0,2,3,5,6]

None

[0,1,3,0,1,3,6] [0,1,3,6]
[0,2,3,0,2,3,6] [0,2,3,6]
[0,1,3,0,2,3,6] [0,1,3,6]
[0,2,3,0,1,3,6] [0,2,3,6]

Số hiệu: BM1/QT-KCNTT-RĐTV/00

Trang 1/5

Câu 2
(a)
Variable

DU Paths
[0,1] [0,2] [0,1,3,4]
[0,1,3,5] [0,2,3,4] [0,2,3,5]
[1,3] [1,6] [1,3,6]
[1,3,5,6] [1,3,4,6]

x
y
(c)
Variable
x
y
(d)

All Def Coverage
[0,1,6]
[0,1,3,6]

Variable
x
y
(e)
Variable

All Use Coverage
[0,1,6] [0,2,3,6]
[0,1,3,4,6] [0,1,3,5,6]
[0,1,3,6]
[0,1,6]
All DU Path Coverage

[0,1,6] [0,2,3,6]
[0,1,3,4,6] [0,1,3,5,6]
[0,2,3,4,6] [0,2,3,5,6]
[0,1,3,6] [0,1,6]
[0,1,3,5,6] [0,1,3,4,6]

x
y

Câu 3:

 Remove node 10 by applying step 4

Số hiệu: BM1/QT-KCNTT-RĐTV/00

Trang 2/5

 Remove node 9 by applying step4

 Remove node 7 by steps 4:

 Remove node 8 by steps 4

Removal of node 8 above led to a pair of parallel links between nodes 4 and 5. combine them
to create a path expression for an equivalent link whose path expression is c+gkh; that is

Removing node 4 leads to a loop term. The graph has now been replaced with the following
equivalent simpler graph:

 Continue the process by applying the loop-removal step as follows:

Số hiệu: BM1/QT-KCNTT-RĐTV/00

Trang 3/5

 Removing node 5 produces:

 Remove the loop at node 6 to yield:

 Remove node 3 to yield:

 Removing the loop and then node 6 result in the following expression:

a(bgjf)*b(c+gkh)d((ilhd)*imf(bjgf)*b(c+gkh)d)*(ilhd)*e

Câu 4:

Row#
1
2
3
4
5
6
7
8

a
T
T
T
T

Truth Table:
P
b
c
T
T

T

T
T

Pa
T

Số hiệu: BM1/QT-KCNTT-RĐTV/00

T

T
T
T

Pc

T

T
T
T

Pb

T
T
T

T

T
T
T
T

T
T

Trang 4/5

The following result for GACC is based on the truth table on the right:
Major Clause
Set of possible tests
(2,6), (2,8), (4,6), (4,8)
a
(1,3), (1,7), (5,3), (5,7)
b
(3,4), (3,6), (5,4), (5,6)
c
The following result for CACC is based on the truth table on the right:
Major Clause
Set of possible tests
(2,6), (2,8), (4,6), (4,8)
a
(1,3), (1,7), (5,3), (5,7)
b
(3,4), (5,6)
c
The following result for RACC is based on the truth table on the right:
Major Clause
Set of possible tests
(2,6), (4,8)
a
(1,3), (5,7)
b
(3,4), (5,6)
c
The following result for GICC is based on the truth table on the right:
Major Clause
Set of possible tests
P = T: (1,5)
P = F: (3,7)
a
P = T: (2,4)
P = F: (6,8)
b
P = T: (1,2)
P = F: (7,8)
c
The following result for RICC is based on the truth table on the right:
Major Clause
Set of possible tests
P = T: (1,5)
P = F: (3,7)
a
P = T: (2,4)
P = F: (6,8)
b
P = T: (1,2)
P = F: (7,8)
c

Câu 5
a) Có (V-----VPPPPPPPP)
b) NON (VVP & V->N & P->ON)
c) V->VP->VNPO->VNONO |V->VP->VPP->VNONO
--------HẾT--------

Số hiệu: BM1/QT-KCNTT-RĐTV/00

Trang 5/5