Module: JAVA
Title: Buttleslugs
March 2016
Student Name: Hussein Ahmed Hussein
Student ID: A2035
Contents
Testing Data: ..............................................................................................................................................................3
White Box Testing:......................................................................................................................................................3
Test1: ..................................................................................................................................................................3
Test 2: .................................................................................................................................................................4
Black Box Testing: ...................................................................................................................................................5
UML Diagram: .............................................................................................................................................................7
References: .............................................................................................................................................................8
Testing Data:
White Box Testing:
Test1:
In this test, once the player shots the empty cell, immediately the computer shots, and the player cannot shots
till the computer fails to shoot the right cell.
Test 2:
This Exception handling method is to check when the slugs is shaped properly and made up of five segments,
and also to check whether this is slug is valid to be placed at the grid or not.
Black Box Testing:
Exception Handling for the player when they starts shooting without placing their slugs
Test Purpose of test Test Values Expected Results Actual Results Pass/F
# ail
1 Computer plays till Computer shot Computer plays Computer plays pass
shots empty cell cell with slugs again again
Computer shots Computer wait for Computer wait
an empty cell player to play for player to
play
2 Placing the slugs Slugs overlap Slugs disappear and Slugs disappear pass
Into grade Slugs out of grid goes back to the panel. and goes back to
the panel.
3 If player shots Shots at enemy grid Error Message: Error Message: pass
before placing the before placing the "You did not place your "You did not place
slugs slugs slugs" your slugs"
4 When player or Eliminate the five Winning window appears Winning window Pass
computer shots all slugs Showing the results appears
the slugs Showing the results
5 Player pressed Press Takes the player to Takes the Pass
Menu buttons New Game window game player to
Button Shows game window game
How to play instructions Shows game
button Exit the game instructions
Exit button Exit the game
6 Player pressed Press Takes the player Takes the pass
game buttons Main Menu button back to the main player back to
Restart button menu the main menu
Quit button Restart the game Restart the
Exit the game game
Exit the game
For this testing, there are two separate objectives: testing to find functional errors in the code (which is
known as "White box testing"), and testing the finished program and predict what the user can do (which is
known as "Black box testing"). White box testing will likely take place throughout the functionality of the
game, as well as to make sure the game is playable. This will allow us to make sure that each piece of code
is working properly before continuing and integrating. However; whit box testing will be exclusively after the
program is functionally finished, whit box testing is to work out any problems with the flow of the game and
how the user will interact with it, and make the game as fun as it can be for the users.
UML Diagram:
References:
Stack Overflow (Multiple buttons and multiple listeners doing various operations Java Swing).
([Link]
operations-java-swing). [Accessed 4 Dec 2015].
YouTube (Java Applets Multiple Buttons [HD 1080p]) (2012).
([Link] [Accessed 15 Dec 2015].
Princeton (Battleship). ([Link]
[Accessed 13 Jan 2016].
Progressive [Link] (Java Tutorial for beginners).
([Link]
[Accessed 13 Jan 2016].