• Tidak ada hasil yang ditemukan

white box testing

N/A
N/A
Protected

Academic year: 2017

Membagikan "white box testing"

Copied!
24
0
0

Teks penuh

(1)

Testing dan

Implementasi Sistem

(2)

White Box Testing

Dikenal juga dengan nama glass box, structural, clear

box dan open box testing. Merupakan teknik testing

perangkat lunak yang harus mengetahui secara detail

tetang perangkat lunak yang akan di uji.

Untuk pengujian yang lengkap maka suatu perangkat

lunak harus diuji dengan white box dan black box

(3)

White Box Testing

Dengan Menggunakan white box testing, software engineer da[at

medesain suatu test cases yang dapat digunakan untu :

1. Menguji setiap jalur independent

2. Menguji keputusan logic (true atau falsa )

3. Menguji Loops dan batasannya

(4)

White Box dan

(5)

White Box Testing

White Box Testing menggunakan 3 macam tahapam testing

1.

Unit Testing

2.

Integration testing

(6)

White Box Testing

Mendesain Test Case, Setiap membuat module/unit maka test

case harus dilakukan : Test Awal yang dapat dilakukan adalah

Analisa Code Coverage : Basic block coverage,

Decision coverage,

Condition coverage, Branch coverage, Loop coverage

1. Basis path testing

Digunakan untuk melakukan pengujian bahwa

(7)

Basis Path Testing

Statement

Decision

Path coverage

?

(8)
(9)

White Box Testing

Independent Path pada gambar di atas:

1. 1-2-7-8 (property owned, pay rent)

2. 1-2-7-9 (property owned, no money for rent)

3. 1-2-3-4-5-6 (buy house)

4. 1-2-3 (don't want to buy)

5. 1-2-3-4 (want to buy, don't have enough money)

Cyclomatic Complecity : Suatu ukuran untuk menghitung kekomplekan suatu

kode sumber :

CC = Jumlah edges – jumlah node + 1

atau

(10)
(11)

White Box Testing

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

top = mid - 1; }

} }

(12)

White Box Testing

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

top = mid - 1; }

} }

return keyPosition; }

(13)

White Box Testing

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

top = mid - 1; }

} }

return keyPosition; }

1

1

2

(14)

White Box Testing

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

top = mid - 1; }

} }

return keyPosition; }

1

1

2

2

10

10

F

(15)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

top = mid - 1; }

} }

return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

(16)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(17)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(18)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(19)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(20)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(21)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(22)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(23)

White Box Testing

3

public static int binarySearch( int key, int[] sequence ) { int bottom = 0;

int top = sequence.length - 1; int mid = 0;

int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { mid = ( top + bottom ) / 2;

if( sequence[ mid ] == key ) { keyPosition = mid;

} else {

if( sequence[ mid ] < key ) { bottom = mid + 1;

} else {

(24)

Test Case

• Work out the number of distinct paths.

Cyclomatic Complexity

CC = noEdges – noNodes + 2

CC = 13 – 10 + 2 = 5

• List the distinct paths.

1, 2, 10

1, 2, 3, 10

1, 2, 3, 4, 5, 9, 2… (loop again?)

1, 2, 3, 4, 6, 7, 9, 2… (loop again?)

1, 2, 3, 4, 6, 8, 9, 2… (loop again?)

Referensi

Garis besar

Dokumen terkait

Sedangkan jurnal Sali Setiatin membahas tentang pengaruh kelengkapan pengisian catatan perkembangan pasien terintegrasi (CPPT) rawat inap terhadap penilaian standar 13.3 manajemen

Sedangkan al-T{abari&gt; dalam tafsirnya mengemukakan bahwa, berkaitan dengan qira&gt;’ah ganda pada lafadz ‚la&gt;mastum‛ beliau memilih sikap untuk mentarjih

Sedangkan manfaat yang diperoleh selama evaluasi pada perusahaan adalah perusahaan dapat mengurangi dan memperbaiki permasalahan atau kelemahan yang ada serta dapat meningkatkan

Untuk kelompok perlakuan MRP dengan Kinesiotaping didapatkan nilai p sebesar 0,996 (p&gt;0.05) sehingga dapat dikatakan bahwa tidak ditemukan perbedaan yang

JAKARTA adalah Ibukota Indonesia yang masih memiliki tingkat kriminalitas tinggi, termasuk pencurian air (illegal settlement). Ma- syarakat golongan marjinal yang tinggal

Sistem sudah bisa melakukan pengukuran tangki bensin dengan sensor ultrasonik dan kecepatan kendaraan dengan sensor inframerah yang memberikan nilai - nilai yang

26 Dan kepada imam Abyatar raja berkata: &#34;Pergilah ke Anatot, ke tanah milikmu, sebab engkau patut dihukum mati, tetapi pada hari ini aku tidak akan membunuh engkau, oleh

Hasil yang diperoleh dari pengajuan hipotesis menunjukkan bahwa tidak terdapat hubungan yang signifikan antara prokrastinasi dan pola asuh orang tua terhadap prestasi