Sie sind auf Seite 1von 30

Black

Box
Testing
?
...a software testing techniques in which
functionality of the software under test (SUT)
is tested without looking at the internal code structure,
implementation details and
knowledge of internal paths of the software.
Black box testing is...
This type of testing is based entirely on
the software requirements and specifications.


...on inputs and output
of the software system
without bothering about
internal knowledge
of the software program
FOCUS
STEPS
Initially requirements and specifications
of the system are examined
Tester chooses valid inputs (positive test scenario),
also some invalid inputs (negative test scenario)
Tester determines expected outputs
for all those inputs
Software tester constructs test cases
with the selected inputs
The test cases are executed
Software tester compares the actual outputs
with the expected outputs
Defects if any are fixed and re-tested
TYPES...
Functional Testing
Black Box Testing
Non-Functional
Testing
Test Case
...a set of test inputs, execution conditions, and expected results
developed for a particular objective,
such as to exercise a particular program path or
to verify compliance with a specific requirement
Test case is...


CASE
TEST
USE
from
Actors and Use cases
in an ATM Machine
This Use Case begins with the ATM in the Ready State.
1. Initiate Withdraw - Customer inserts bank card in the card reader on the ATM machine
2. Verify Bank Card - The ATM reads the account code from the magnetic strip on the bank card and checks if it is an
acceptable bank card.
3. Enter PIN - The ATM asks for the customer's PIN code (4 digits)
4. Verify account code and PIN - The account code and PIN are verified to determine if the account is valid and if the PIN
entered is the correct PIN for the account. For this flow, the account is a valid account and the PIN is the correct PIN
associated with this account.
5. ATM Options - The ATM displays the different alternatives available at this ATM. In this flow, the bank customer always
selects "Cash Withdraw."
6. Enter Amount - The ATM the amount to withdraw. For this flow the customer selects a pre-set amount ($10, $20, $50,
or $100).
7. Authorization - The ATM initiates the verification process with the Banking System by sending the Card ID, PIN, Amount,
and Account information as a transaction. For this flow, the Banking System is online and replies with the authorization to
complete the cash withdrawal successfully and updates the account balance accordingly.
8. Dispense - The Money is dispensed.
9. Return Card - The Bank Card is returned.
10. Receipt - The receipt is printed and dispensed. The ATM also updates the internal log accordingly.
Use Case ends with the ATM in the Ready State.
Basic Flow
Alternate Flow 1 - Not a
valid Card
In Basic Flow Step 2 - Verify Bank Card, if the card is not valid, it is ejected with an appropriate message.
Alternate Flow 2 - ATM
out of Money
At Basic Flow Step 5 - ATM Options, if the ATM is out of money, the "Cash Withdraw" option will not be available.
Alternate Flow 3 -
Insufficient funds in ATM
At Basic Flow Step 6 - Enter Amount, if the ATM contains insufficient funds to dispense the requested amount, an
appropriate message will be displayed, and rejoins the basic flow at Step 6 - Enter Amount.
At Basic Flow Step 4 - Verify Account and PIN, the customer has three tries to enter the correct PIN.
If an incorrect PIN is entered, the ATM displays the appropriate message and if there are still tries remaining, this flow
rejoins Basic Flow at Step 3 - Enter PIN.
If, on the final try the entered PIN number is incorrect, the card is retained, ATM returns to Ready State, and this use case
terminates.
Alternate Flow 5 - No
Account
At Basic Flow Step 4 - Verify Account and PIN, if the Banking system returns a code indicating the account could not be
found or is not an account which allows withdrawals, the ATM displays the appropriate message and rejoins the Basic Flow
at Step 9 - Return Card.
Alternate Flow 6 -
Insufficient Funds in
Account
At Basic Flow Step 7 - Authorization, the Banking system returns a code indicating the account balance is less than the
amount entered in Basic Flow Step 6 - Enter Amount, the ATM displays the appropriate message and rejoins the Basic Flow
at Step 6 - Enter Amount.
Alternate Flow 7 - Daily
maximum withdrawal
amount reached
At Basic Flow Step 6 - Authorization, the Banking system returns a code indicating that, including this request for
withdrawal, the customer has or will have exceeded the maximum amount allowed in a 24 hour period, the ATM displays the
appropriate message and rejoins the Basic Flow at Step 6 - Enter Amount.
Alternate Flow 4 -
Incorrect PIN
Alternate Flow...
CW1. Scenario 1 - Successful Cash Withdraw V V V V V Successful cash withdrawal.
CW2. Scenario 2 - ATM out of Money V V V V I Cash Withdraw option
unavailable, end of use case
CW3. Scenario 3 - Insufficient funds in ATM V V V V I Warning message, return to
Basic Flow Step 6 - Enter
Amount
V Warning message, return to
Basic Flow Step 4, Enter PIN
CW6. Scenario 4 - Incorrect PIN (= 0 tries left) I V n/a V V Warning message, card
retained, end of use case
CW5. Scenario 4 - Incorrect PIN (= 1 try left) I V n/a V
Expected Result
CW4. Scenario 4 - Incorrect PIN (> 1 left) I V n/a V V Warning message, return to
Basic Flow Step 4, Enter PIN
Amount Entered
(or chosen)
TC ID# Scenario / Condition PIN Account #
Amount in
Account
Amount in ATM
CW1. Scenario 1 - Successful Cash Withdraw 4987 809 - 498 50 500 2,000 Successful cash withdrawal. Account
balance updated to 450.00
CW2. Scenario 2 - ATM out of Money 4987 809 - 498 100 500 0 Cash Withdraw option unavailable,
end of use case
CW3. Scenario 3 - Insufficient funds in ATM 4987 809 - 498 100 500 70 Warning message, return to Basic
Flow Step 6 - Enter Amount
2,000 Warning message, return to Basic
Flow Step 4, Enter PIN
CW6. Scenario 4 - Incorrect PIN (= 0 tries left) 4978 809 - 498 n/a 500 2,000 Warning message, card retained,
end of use case
CW5. Scenario 4 - Incorrect PIN (= 1 try left) 4978 809 - 498 n/a 500
Expected Result
CW4. Scenario 4 - Incorrect PIN (> 1 left) 4978 809 - 498 n/a 500 2,000 Warning message, return to Basic
Flow Step 4, Enter PIN
Amount
Entered
(or chosen)
TC
ID#
Scenario / Condition PIN
Account
#
Amount in
Account
Amount in
ATM
Matrix Data Element
Actual Data Values
Strategi pengujian yang hanya fokus kepada
faktor fungsionalitas dan spesifikasi perangkat
lunak.
Testing dilakukan bukan pada awal proses
pengujian, tapi pada beberapa tahap
berikutnya
14
Pengujian dirancang untuk menjawab beberapa
pertanyaan sebagai berikut:
1. Bagaimana validitas fungsionalnya diuji?
2. Bagaimana perilaku sistem dan performansi diuji?
3. Jenis input seperti apa yang akan menghasilkan kasus uji yang baik ?
4. Apakah sistem secara khusus sensitif terhadap nilai input tertentu ?
5. Bagaimana batasan-batasan kelas data diisolasi?
6. Berapa rasio data dan jumlah data yang dapat ditoleransi oleh sistem?
7. Apa akibat yang akan timbul dari kombinasi spesifik data pada operasi
sistem?

15
Menganalisis kebutuhan dan spesifikasi dari
perangkat lunak.
Pemilihan jenis input yang memungkinkan
menghasilkan output benar serta jenis input
yang memungkinkan output salah pada
perangkat lunak yang sedang diuji.
Menentukan output untuk suatu jenis input.
16
Pengujian dilakukan dengan input-input yang
telah benar-benar diseleksi.
Melakukan pengujian.
Pembandingan output yang dihasilkan dengan
output yang diharapkan.
Menentukan fungsionalitas yang seharusnya
ada pada perangkat lunak yang sedang diuji.
17
Black Box Testing dapat dilakukan pada setiap
level pembangunan sistem
18
Keunggulan
Dapat memilih subset test yang secara efektif dan
efisien dapat menemukan cacat.
Dapat membantu memaksimalkan testing
investment.
Kelemahan
Terdapat kemungkinan masih ada beberapa jalur
eksekusi yang belum pernah diuji oleh tester
19
Equivalence Class Testing
Teknik yang digunakan untuk mengurangi jumlah test case
yang ada pada saat pengujian. Kebanyakan tester
menggunakan teknik yang simpel ini meskipun secara
formal tester tersebut tidak mengetahui mengenai metode
desain formal dalam pengujian perangkat lunak.
Kasus uji yang didesain untuk Equivalence class testing
berdasarkan pada evaluasi dari ekuivalensi jenis/class untuk
kondisi input.
Class-class yang ekuivalen merepresentasikan sekumpulan
keadaan valid dan invalid untuk kondisi input. Biasanya
kondisi input dapat berupa spesifikasi nilai numerik, kisaran
nilai, kumpulan nilai yang berhubungan atau kondisi
boolean.

Langkah-langkah
Equivalence Class Testing

Identifikasi kelas-kelas yang ekuivalen
(equivalence class).
Buat test case untuk tiap-tiap equivalence class.
Jika memungkinkan buat test case tambahan yang
acak yang memungkinkan ditemukannya cacat
pada perangkat lunak.
Continuous
equivalence classes
Contoh nilai untuk pendapatan/ salary yang disyaratkan
untuk melakukan pembelian rumah secara kredit:
Discrete
equivalence classes
Contoh nilai untuk jumlah kemilikan rumah yang disyaratkan
untuk melakukan pembelian rumah secara kredit:
Single selection
equivalence classes
Contoh nilai untuk kategori pengajuan yang disyaratkan
untuk melakukan pembelian rumah secara kredit:
Multiple selection
equivalence class
Contoh nilai untuk jenis rumah yang disyaratkan untuk
melakukan pembelian rumah secara kredit:
Boundary Value Testing
Boundary value testing fokus kepada suatu
batasan nilai dimana kemungkinan terdapat cacat
yang tersembunyi.
BVT mengarahkan pada pemilihan kasus uji yang
melatih nilai-nilai batas. BVT merupakan desain
teknik kasus uji yang melengkapi Equivalence
class testing. Dari pada memfokuskan hanya pada
kondisi input, BVA juga menghasilkan kasus uji
dari domain output.
Langkah-langkah
Boundary Value Testing
Identifikasi kelas-kelas yang ekuivalen
(equivalence class).
Identifikasi batasan untuk tiap equivalence class.
Buat test case untuk tiap batasan suatu nilai
dengan memilih titik pada batasan, satu titik pada
nilai bawah batasan dan satu titik pada nilai atas
batasan.
Boundary values for a continuous
range of inputs
Tes data input untuk batas bawah adalah {$999, $1,000, $1,001} dan
untuk batas atas {$83,332, $83,333, $83,334}.
Contoh untuk nilai pendapatan/ salary:
Boundary values for a discrete range
of inputs.
Tes data input untuk batas bawah adalah {0, 1, 2} dan untuk batas atas {4,
5, 6}.
Contoh nilai untuk jumlah tempat tinggal (dwellings) yang dimiliki oleh
seseorang:
Contoh Kombinasi Pengujian
Sangat penting untuk menginputkan nilai
kombinasi secara besamaan, misalkan:

Das könnte Ihnen auch gefallen