Test Vector

9.1.2 Test Vector

A test vector , also called test data, is an instance of the input to a program. It is a certain configuration of the values of all the input variables. Values of individual input variables chosen in the preceding sections must be combined to obtain a test

vector. If a program has n input variables var 1 , var 2 , . . . , var n which can take on k 1 ,k 2 , . . ., k n special values, respectively, then there are k 1 ×k 2 ×···×k n possible combinations of test data.

Example: We show the number of special values of different input variables of the FSB module of Figure 9.1 in Table 9.1. Variable MODE takes on values from a discrete set of size 2 and both the values from the discrete set are con- sidered. Variables CLOCK and MODE take on values from one interval each and three special values for each of them are considered. Therefore, one can generate

2 × 3 × 3 = 18 test vectors from Table 9.1. Some programs accept a large number of input variables. Tax filing software

systems are examples of such programs. Consider all possible combinations of

a few special values of a large number of input variables is a challenging task. If a program has n input variables, each of which can take on k special values, then there are k n possible combinations of test vectors. We know that k is a small number, but n may be large. We have more than one million test vectors even for k = 3 and n = 20. Therefore, there is a need to identify a method for reducing the number of test vectors obtained by considering all possible combinations of all the sets of special values of input variables.

Howden suggested that there is no need of combining values of all input variables to design a test vector if the variables are not functionally related . To reduce the number of input combinations, Howden suggested [3, 4] that we pro- duce all possible combinations of special values of variables falling in the same functionally related subset. In this way, the total number of combinations of special values of the input variables is reduced. It is difficult to give a formal definition

TABLE 9.1 Number of Special Values of Inputs to FBS Module of Figure 9.1 Number of Special

Variable Values (k) Special Values MODE

2 {23, 79} CLOCK

3 {0x0000000, 0x000FF00, 0xFFFFFFF} ADDRESS

3 {0xFFFFF0000000, 0xFFFFF00FFF00, 0xFFFFFFFFFFFF}

9.1 FUNCTIONAL TESTING CONCEPTS OF HOWDEN

231 Functionally

related variables

Functionally related variables

(a)

(b)

Figure 9.3 Functionally related variables.

of the idea of functionally related variables, but it is easy to identify them. Let us consider the following examples:

• Variables appearing in the same assignment statement are functionally related.

• Variables appearing in the same branch predicate—the condition part of an if statement, for example—are functionally related.

Example: The program P in Figure 9.3a has five input variables such that x 1 ,...,x 4 take on three special values and x 5 is a Boolean variable. The total number of combinations of the special values of the five input variables is

3 4 × 2 = 162. Let us assume that program P has an internal structure as shown in Figure 9.3b, where variables x 1 and x 2 are functionally related and variables x 3 and x 4 are functionally related. Function f 1 uses the input variables x 1 and x 2 . Similarly, function f 2 uses the input variables x 3 and x 4 . Input variable x 5 is used to decide whether the output of f 1 or the output of f 2 will be the output of P. We consider 3 2 = 9 different combination of x 1 and x 2 as input to f 1 , 9 different combinations of x 3 and x 4 as input to f 2 , and two different values of x 5 to the decision box d in P . We need 36 [(9 + 9) × 2] combinations of the five input variables x 1 ,...,x 5 , which is much smaller than 162.

Dokumen yang terkait

ANALISIS DANA PIHAK KETIGA PADA PERBANKAN SYARIAH DI INDONESIA PERIODE TRIWULAN I 2002 – TRIWULAN IV 2007

40 502 17

ANALISIS KEMAMPUAN SISWA SMP DALAM MENYELESAIKAN SOAL PISA KONTEN SHAPE AND SPACE BERDASARKAN MODEL RASCH

69 778 11

Analisis Komparasi Internet Financial Local Government Reporting Pada Website Resmi Kabupaten dan Kota di Jawa Timur The Comparison Analysis of Internet Financial Local Government Reporting on Official Website of Regency and City in East Java

19 819 7

STUDI PENJADWALAN DAN RENCANA ANGGARAN BIAYA (RAB) PADA PROYEK PEMBANGUNAN PUSAT PERDAGANGAN CIREBON RAYA (PPCR) CIREBON – JAWA BARAT

34 235 1

PENGARUH PENGGUNAAN BLACKBERRY MESSENGER TERHADAP PERUBAHAN PERILAKU MAHASISWA DALAM INTERAKSI SOSIAL (Studi Pada Mahasiswa Jurusan Ilmu Komunikasi Angkatan 2008 Universitas Muhammadiyah Malang)

127 505 26

AN ANALYSIS OF DESCRIPTIVE TEXT WRITING COMPOSED BY THE HIGH AND THE LOW ACHIEVERS OF THE EIGHTH GRADE STUDENTS OF SMPN SUKORAMBI JEMBER

11 83 16

AN ANALYSIS OF LANGUAGE CONTENT IN THE SYLLABUS FOR ESP COURSE USING ESP APPROACH THE SECRETARY AND MANAGEMENT PROGRAM BUSINESS TRAINING CENTER (BTC) JEMBER IN ACADEMIC YEAR OF 2000 2001

3 95 76

A DISCOURSE ANALYSIS ON “SPA: REGAIN BALANCE OF YOUR INNER AND OUTER BEAUTY” IN THE JAKARTA POST ON 4 MARCH 2011

9 161 13

Improving the Eighth Year Students' Tense Achievement and Active Participation by Giving Positive Reinforcement at SMPN 1 Silo in the 2013/2014 Academic Year

7 202 3

THE INTEGRATION BETWEEN INDONESIA AND WORLD RICE MARKET

1 88 12