• 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

Dari analisa yang telah dilakukan, dapat disimpulkan bahwa pada block vector yang sama, semakin besar code book yang digunakan untuk kompresi maka kualitas

Metode yang akan digunakan dalam pengujian adalah white box dengan teknik unit test, pengujian perangkat lunak dilakukan dengan cek pada modul untuk dapat meneliti dan

Coverage.py is a third-party Python module, which works with test suites and cases written with the unittest module, and reports their code coverage. Coverage.py can be

Berdasarkan proses testing yang telah dilakukan yang dimulai dari perencanaan testing yaitu penentuan FMEA dan pembuatan test case, hingga pelaksaan testing yang

Halaman Utama Dari tabel test case berdasarkan jalur independen yang didapat melalui hasil perhitungan Cyclomatic Complexity dengan melakukan tiga pengujian didapatkan hasil keduanya

Pada pengujian manual, peneliti akan membuat tabel test case terlebih dahulu untuk menentukan fungsionalitas yang ingin diuji, setelah itu peneliti langsung mencoba menjalankan

After getting code coverage, we give this information with the test case execution results to statement score generator which uses 40 different MBFL techniques to calculate the sequence

The testing method adapts conventional code-based unit testing techniques to test member functions of a given class.. In order to apply the notion of coverage provided by conventional