Disusun Oleh :
Devi Fajra Wati 3411171112
Angga Fantiya Hermawan 3411171142
Heri Fredianto 3411171162
Christine Chlyw N 3411171164
DSE – C
JURUSAN INFORMATIKA
FAKULTAS SAINS DAN INFORMATIKA
UNIVERSITAS JENDERAL ACHMAD YANI
2020
DAFTAR ISI
Pembuatan Test Case (Unit Testing White Box) .......................................................................3
A. FUNGSI LOGIN .............................................................................................................3
Source Code “loginControl.php” ........................................................................................3
1. Control Flow Graph .....................................................................................................4
2. Cyclomatic Complexity ...............................................................................................5
3. Independent Path .........................................................................................................5
4. Test Case Path .............................................................................................................5
B. FUNGSI EDIT ................................................................................................................5
Source Code “edit.php” ......................................................................................................5
1. Control Flow Graph .....................................................................................................6
2. Cyclomatic Complexity ...............................................................................................6
3. Independent Path .........................................................................................................6
4. Test Case Path .............................................................................................................6
C. FUNGSI HAPUS ............................................................................................................7
Source Code “hapus.php” ...................................................................................................7
1. Control Flow Graph ........................................................................................................8
2. Cyclomatic Complexity ...............................................................................................8
3. Independent Path .........................................................................................................8
4. Test Case Path .............................................................................................................8
Pembuatan Test Case (Unit Testing White Box)
A. FUNGSI LOGIN
<?php
require_once('Login.php');
10
6
7 8
11
3. Independent Path
Path 1 = 1 – 2 – 3 – 4 – 5 – 9 – 11
Path 2 = 1 – 2 – 3 – 4 – 6 – 7 – 9 – 11
Path 3 = 1 – 2 – 3 – 4 – 6 – 8 – 9 – 11
Path 4= 1 – 2 – 3 – 10 – 9 – 11
B. FUNGSI EDIT
2. Cyclomatic Complexity
V(G) = E-N+2 *Ket : Dimana E=
jumlah Edge
= 5-5+2
N=Jumlah Node
=2
3. Independent Path
Path 1 = 1 – 2 – 3 – 4 – 5
Path 2 = 1 – 2 – 3 – 1 – 2 – 3 – 4 – 5
<?php
if(isset($_GET['id'])){
include('koneksi.php');
$id = $_GET['id'];
$del = mysql_query("DELETE FROM produk WHERE
id='$id'");
if($del){
echo 'Data produk berhasil di hapus! ';
echo '<a href="index.php">Kembali</a>';
}else{
echo 'Gagal menghapus data! ';
echo '<a href="index.php">Kembali</a>';
}
}
}
?>
1. Control Flow Graph
2. Cyclomatic Complexity
V(G) = E-N+2 *Ket : Dimana E= jumlah Edge
=2
3. Independent Path
Path 1 = 1 – 2 – 3 – 4 – 5
Path 2 = 1 – 2 – 3 – 1 – 2 – 3 – 4 – 5