• Tidak ada hasil yang ditemukan

Testing dan Implementasi Sistem Lukman Hakim dan Suwanto R

N/A
N/A
Protected

Academic year: 2021

Membagikan "Testing dan Implementasi Sistem Lukman Hakim dan Suwanto R"

Copied!
23
0
0

Teks penuh

(1)

Testing dan

Implementasi Sistem

Lukman Hakim dan Suwanto R

(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

testing

(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 Black

Box testing

(5)

White Box Testing

White Box Testing menggunakan 3 macam tahapam testing

1.

Unit Testing

2.

Integration testing

3.

Regression 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 semua

jalur independent terlewati semua. Paling tidak suatu

jalur minimal harus terlewati sekali.

(7)
(8)

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

(9)
(10)

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; }

(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; } } } return keyPosition; }

1

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; }

1

1

2

2

(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

2

10

10

F

F

(14)

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

F

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

F

F

4

T

4

T

5

T

5

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 { top = mid - 1; } } } return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

F

F

4

T

4

T

5

T

5

T

6

F

6

F

(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 { top = mid - 1; } } } return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

F

F

4

T

4

T

5

T

5

T

6

F

6

F

9

9

(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 { top = mid - 1; } } } return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

F

F

4

T

4

T

5

T

5

T

6

F

6

F

7

T

9

7

T

9

(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 { top = mid - 1; } } } return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

F

F

4

T

4

T

5

T

5

T

6

F

6

F

7

T

8

F

9

7

T

8

F

9

(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 { top = mid - 1; } } } return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

F

F

4

T

4

T

5

T

5

T

6

F

6

F

7

T

8

F

9

7

T

8

F

9

(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 { top = mid - 1; } } } return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

F

F

4

T

4

T

5

T

5

T

6

F

6

F

7

T

8

F

9

7

T

8

F

9

(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 { top = mid - 1; } } } return keyPosition; }

1

1

2

2

10

10

F

F

3

T

T

F

F

4

T

4

T

5

T

5

T

6

F

6

F

7

T

8

F

9

7

T

8

F

9

(23)

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?)

• Figure out the conditions that cause

execution of these paths.

Referensi

Dokumen terkait

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

Daripada setiap obyek bergerak secara individu atau dengan menggunakan pilihan menu align untuk mengatur obyek pada slide, Anda dapat mengelompokkan beberapa obyek

Even though this article aim to address the social and religious issue of organ transplant, the author would also like to mention the importance of addressing the emotional issues

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

Keragaman morfologi daun in vitro haploid, diploid dan triploid yang diregenerasikan dari jaringan endosperma jeruk Siam Simadu pada media tanpa penambahan ZPT dan

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

3.5 bersih buah bebas dari kotoran dan benda asing lainnya 3.6 bebas dari hama dan penyakit buah tidak terkontaminasi hama dan penyakit dan atau mengalami kerusakan yang