6 Design documentation

advertisement
Version: 16. June 2005 (29.3.2005).
Project
AMIRAL BATTI
User
: KISS Game Co.
Project leader : Askin Erdem Gundogdu
Status of documents
[*] 1. User requirements
[*] 2. Project plan
[*] 3. System specifications
[*] 4. Test cases
[*] 5. Testing report
[*] 6. Design documentation
[*] 7. User manual
[*] 8. Source code
[*] 9. Executable code
[*] 10.Description of files
Start date: 29.3.2005
Finish date: 15.6.2005
Name and surname
Askin Erdem Gundogdu
Position
Tester
Erkan Ercan
Coder
This part is filled by the project verifier
Submitted to:
E-mail adress
erdosh2002@yaho
o.com
erkanercan@gazi.e
du.tr
Comment
1 CUSTOMER REQUIREMENTS
Document
User
Location of the document
Responsible person
User Requirements, Version 1.0, 29.3.2005
KISS Game Co.
Amiral Batti.doc
Director firm KISS Game Co., Mirko Zver
Sirs;
Our company has decided to raise a market share in the field of consumer software. Our
slogan is that simple things are the best. For this reason we decided to enter a market with this simple
game.
We wish to get a PC software that will enable two persons to play a war game. The program
should enable the communication with the opponent. Each player should see the playing and the
shooting desk on the screen and the result of shooting. When the game is over, the result is written
and players can play a new game.
Additional Requirements: Program should run on PC. An average PC should be sufficient. The
game is played by two players. The program must have less errors as posible and must be very userfriendly. The computer response must be immediately. Program should be developed according to
standard cV&Vs. The size of program is less than 2000 LOC. Deadline for the product and
documentation is 15/06/2005. Penalties are to be taken for the late deliverance.
Manager of KISS Game Co.
Mirko Zver
2 PROJECT PLAN
2.1 IDENTIFICATION OF DOCUMENT, CONNECTION WITH OTHER DOCUMENTS
Document:Project plan
Version 1
Date 29.3.2005
Location Folder Amiral Batti.doc is in the folder “documentation”
Person in charge
E. Gundogdu
Reference to other documents
Internal standard cV&Vs
User requirements
2.2 SHORT DESCRIPTION OF PROBLEM
Firm KISS Game Co. (further known as user) has given us their requests and this project is
based on them.
User needs a program which is a game (further known as Amiral Batti) that will be played by
two players through the internet.
Additionally each player should see the playing and the shooting desk on the screen and the
result of shooting. When the game is over, the result is written.
2.2.1
Global goals
The game should increase the market share of customer software.
It must be cheaper and easy of use according to the similar games in the market.
2.2.2
Restrictions (operating system, hardware, standards...)
1) Program works in some Windows operating systems on DOS based.
2) Program should fit cV&Vs standards.
2.2.3
Project deadline, total costs
1) 15.6.2005
2) Complete program will cost 400000 SIT.
2.2.4
Functions
Basic functions system has to implement, do global goals are fulfilled
1) Program must be able to communicate with the other players on the internet.
2) Program should display all shot points and current state and results.
3) Program must be enable to help to the player on every step of the game.
4) Program should display the results at the end of the game.
2.2.5
Important characteristics
1) Program request minimum a 533Mhz processor, 64MB ram, 16MB graphic card 10 MB
free disk space and an internet connection.
2) Program should cancel all wrong actions and continue the game.
2.2.6
Versioning: V x.y DDMMYYYY
x means main label (big changes), y means small changes, DDMMLLL : date.
2.3 QUALITY CONTROL (TEST PLAN)
2.3.1
Verifying objects
D1
User Requirements
D2
Project Plan
D3
System specifications
D4
Test Cases
D5
Testing reports
D6
Design documentation
D7
D8
D9
D10
User manual
Source code
Executable code
Complete products
Glede na izbran model razvoja obstajajo delni in končni produkti, ki jih je potrebno na koncu
vsake faze preveriti (glej tabelo Pregled po produktih in aktivnostih). Kompleten terminski plan je
podan v 7. točki tega dokumenta. Končni produkt predstavljajo dokumenti D1-D10.
2.3.2
Methods used for testing
All methods are declared in special table “Product and Activity Review”. Extra Explanations:
A) Common review of sub-documents (products D1 to D7, D10 ), which are not programs
Checker will personally check the document and will warn the responsible person
about all warnings and errors. In checking there will be none special checking report
unless in case of many mistakes or errors.
Preverjala se bo:

popolnost

konsistentnost s predhodnimi dokumenti

skladnost dokumenta s standardom CVVS-2/2000.
B) Prototype evaluation
Source code will be checked for style rules defined by CVVS standard. Test
samples will be prepared for evaluation. They will be further defined by Test cases
document. Evaluation is done by tester. Short internal memo will be prepared after
evaluation.
C) Final product testing
Preverjanje izvorne kode:
 S splošnim pregledom bomo preverili skladnost kodiranja gleda na standard
cV&Vs.
Preverjanje izvršljivega programa:
 Na podlagi tega dokumenta (Plan projekta) bo izdelan dokument z naslovom
Testni primeri. Med testiranjem se bo vodil osebni zapisnik preverjevalca (uporabi
se lahko vnaprej pripravljen formular). Pogoj za začetek testiranja je, da tipični
testni vzorec ne sme povzročiti resne hibe.
Uporabljene bodo naslednje strategije (podroben opis je v prilogi tega
dokumenta):
a)
b)
c)
d)
e)
2.3.3
2.3.4
prisotnost zahtev (Z)
prepovedane vrednosti – za preverjanje robustnosti (R)
enakovredni razredi- samo za polinom (E)
ugibanje napak oziroma nepravilnosti (U)
strukturno testiranje stavkov (S)
Failure criterion function
Calculated results must be accurate to 7th decimal.
Terminal criterion function
Testing is finished, when following condition is true: (pg1 AND pg2) OR pg3.
pg1.
pg2.
pg3.
All requirements from system specifications document are tested.
Every source code function is run at least once.
Period of time intended for testing has been used.
2.4 NALOGE IN REZULTIRAJOČI DOKUMENTI (IZBIRA RAZVOJNEGA MODELA )
Izbrali smo razvojni model določen s standardom CVVS 2/2000.
NA RO ČNIK O V E
ZA HTE V E
P L A NIRA NJE
P RO JE K TA
A NA L IZA
IZV E DL JIV O S TI
PLAN
P RO JE K TA
A NA L IZA
ZA HTE V
S IS TE MS K E
S P E CIFIK A CIJE
(O S NUTE K )
NA ČRTO V A NJE
IN RA ZV O J
P RO TO TIP A
S IS TE MS K E
S P E CIFIK A CIJE
NA ČRTO V A NJE
IN RA ZV O J
K O MP L E TNE G A
P RO DUK TA
E V A L V A CIJA
P RO TO TIP A
IZV O RNA
K O DA
UP O RA B NIŠ K I
P RIRO ČNIK
(O S NUTE K )
V&V
V&V
V&V
UP O RA B A IN
V ZDRŽE V A NJE
DO K UME NTA CIJA
S TRUK TURNE G A
NA ČRTO V A NJA
RE ZUL TA TI
E V A L V A CIJE
P RO TO TIP
P RE V ZE M
S P RE ME NJE N/
P O P RA V L JE N
P RO G RA M
P RO G RA MS K I
P RO DUK T
P RIP A DA JO ČA
DO K UME NTA CIJA
V&V
O DP RA V L JA NJE
NE US TRE ZNO S TI
IN A ŽURIRA NJE
DO K UME NTO V
V&V
V&V
TE S TIRA NJE
TE S TNI
P RIME RI
INTE RNI
S TA NDA RDI
P O RO ČIL O
O P RE V E RJA NJU
NA ČRTO V A NJE
TE S TNIH
P RIME RO V
P O RO ČIL O O
NE US TRE ZNO S TIH
V&V
Me jn ik o b ka te re m se izve d e fo rma ln i p re g le d
Slika 1 - Izbran model razvoja programske opreme (iz vsake faze se lahko vrnemo na predhodne faze - zaradi preglednosti ni narisano)
6
Overview of products and activities
D1
D2
D3
Product
Planned
complexity1
Actual
complexity1
Person in charge
V&V method
User requirements
Project plan
System
specification
Prototype
1 page
8 pages
8 pages
2 pages
5 pages
5 pages
E. Gundogdu
E. Gundogdu
E. Gundogdu +
naročnik
E. Ercan
General inspection
General inspection
General inspection
550 LOC
D4
Test cases
20 test cases
9 test cases
E. Gundogdu
testing+ General
inspection
General inspection
D5
Test report
10 pages
3 pages
E. Gundogdu
splošni pregled
D6
5 pages
6 pages
E. Ercan
General inspection
D7
D8
Design
documentation
User manual
Source code
3 pages
2000LOC
583 LOC
E. Ercan
E. Ercan
General inspection
General inspection
D9
Executable code
150KB
148 KB
E. Ercan
testing
D10
Complete project
All of them
testing+ General
inspection
7
Person in
charge of
V&V
Communication
method V&V
Opomba
Verbal
verbal
E.
Gundogdu
E.
Gundogdu
E.
Gundogdu
E.
Gundogdu
Internal report
Verbal
Verbal
Verbal
E.
Gundogdu
E.
Gundogdu
Naročnik
Verbal
Verbal
written
Test report
Terms and costs
ACTIVITY
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
Actual term Planned Planned Actual Actual costs
staff
costs
staff
complex.1
complex.
Planning
28.3.2005 10.4.2005
9
90000
8
80000
Design
6.4.2005
15.5.2005
6
60000
6
60000
Coding Prototype
12.4.2005 30.5.2005
9
90000
5
50000
Prototype Evaulation
21.4.2005
3.6.2005
9
90000
5
50000
Implementation of complete 6.5.2005
6.6.2005
6
60000
6
60000
program
Test case design
30.4.2005
6.6.2005
6
60000
5
50000
Testing and correcting
12.5.2005
107
70000
15.6.2005
9
90000
Finishing the complete
21.5.2005
15.6.2005
6
60000
8
80000
documentation
Code rewiev
27.5.2005 14.6.2005
3
30000
2
20000
Finishing
Total force - Cost
Planned
term
30.5.2005
15.6.2005
3
30000
5
50000
66
660000
57
570000
Unit force: Man-day
Costs unit force: 10000SIT
1
Specify the unit measure (eg.: unit is hours or costs or staff requirement or combination)
8
Worker
Person in charge
E. Gundogdu
E. Ercan
E. Ercan
E. Gundogdu
E. Ercan
E. Gundogdu
E. Gundogdu
E. Gundogdu
E. Gundogdu
E. Gundogdu
E. Gundogdu
E. Ercan
E. Gundogdu
E. Gundogdu
E. Ercan
E. Gundogdu
User E.
Gundogdu
User + E.
Gundogdu
E. Gundogdu
E. Gundogdu
Summary of all costs and profit value:
planned
150000
210000
240000
60000
660000
340000
1000000
costs – analyzes and planning (A1+A2)
costs – coding and writing documentation (A3+A5+A8)
costs - checking (A4+A6+A7+A9)
costs – other
costs – total
profit
The amount that user will pay
9
planned (%)
22,73
31,82
36,36
9,09
100,00%
34,00%
100%
real
140000
190000
190000
50000
620000
380000
1000000
real (%)
22,58
30,64
30,64
8,06
100%
38%
100%
2.5 RESOURCES
2.5.1
Staff (Who's doing what, staff requirements?)
Oseba
M. Zver
P1
P2
Askin Erdem
Gundogdu
P3
Erkan Ercan
2.5.2
Required programming tools and libraries
tool
Microsoft Visual Studio
Microsoft Word
Winmetr
Devpartner Studio
2.5.3
AKTIVNOST
 acceptance
 supervisioin
 planning
 analysis
 design of test cases
 planning supervision
 planning
 implementation of prototype
 evaluation of prototype
 design and implementation of product
(program)
 bug fixing
 user manual
function
Coding, fixing bugs andanomalies
Mantainging documentation
Complexity metrics
test coverage analysis
Required hardware
tool
Two PC’s
Printer
function
Coding, maintaining documentation, testing…
Printing documentation
2.6 ___ COSTS STRUCTURE
See D2.4.
1
0
Vloga
Customer
Tester
(project lead)
Developer
2.7 _____________________________ TIME SCHEDULE
Time unit is (minutes, days, hours): workdays
1st week: 28th of March
10th week: 29th of May
ACTIVITIES
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
D1
D2
D3
D4
D5
D6
D7
D8
D9
Planning
Design
Coding
Prototype evaluation
Implementation of complete program
Test case design
Testing and correcting
Finishing the complete documentation
Code review
Finishing
DOCUMENTS
User requirements
Project plan
System specifications
Test cases
Testing report
Design documentation
User manual
Source code
Executable code
1
+
2
+
3
+
4
5
+
+
6
*
7
*
8
*
+
+
+
TIME SCALE
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
*
+
+
*
*
*
*
*
+
+
*
*
+
*
+
+
+
+
+
*
+
+
*
*
+
*
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
* *
* *
+ +
*
+
*
+
*
*
+ +
*
+
*
+
*
+
1
+
2
+
3
4
5
6
+
+
+ Planned Time * Real Time
1
1
7
8
*
*
2.8
DICTIONARY
2.9 SUPPLEMENT
2.9.1
Test strategy descriptions
1. Opis strategije: Prisotnost zahtev (Z)
1.
2.
3.
4.
5.
6.
Strategija je uporabna je v vseh primerih, kjer so znane specifikacije oziroma
zahteve, med katerimi ni nobenih relacij. Uporablja se lahko za testiranje kompletenega
programa, ali pa samo komponente
Predpostavka o napaki: določena zahteva ni implementirana. S to strategijo
odkrivamo zahteve, ki niso implementirane. Razen zelo redkih izjem, ne bomo odkrili
napačno implementiranih zahtev in zahtev, ki so po nepotrebnem implementirane.
Testirni model je seznam zahtev.
Pravilo za načrtovanje testnih primerov: Za vsako zahtevo tvori najmanj en
testni primer. Vhodne podatke si poljubno izberi.
Z načrtovanjem testnih primerov lahko začnemo, ko so zahteve postavljene.
Testirna strategija je izčrpana, ko preverimo prisotnost vsake zahteve v seznamu.
2. Opis strategije za preverjanje robustnosti (R)
1.
2.
3.
4.
5.
6.
Strategija je uporabna je v vseh primerih, kjer je zahtevana robustnost in je možno
tvoriti opis vhodne domene.
Predpostavka o nepravilnosti: program ni robusten, čeprav bi moral biti. S to
strategijo ne bomo odkrili nepravilnosti, ki se pojavljajo pri procesiranju veljavnih podatkov.
Testirni model je opis vhodne domene.
Pravilo za načrtovanje testnih primerov: V vhodni domeni in identificiraj
prepovedane razrede. Za vsak prepovedan razred tvori en testni primer.
Z načrtovanjem testnih primerov lahko začnemo, ko je opisana vhodna domena.
Testirna strategija je izčrpana, ko smo pokrili vse neveljavne razrede v vhodni
domeni. Zgornje število testnih primerov je enako številu neveljavnih razredov.
3. Opis strategije: Ekvivalentni razredi polinomov (E)
1.
2.
3.
4.
Strategija je uporabna je v vseh primerih, kjer so znana pravila za opis polinoma.
Predpostavka o nepravilnosti: določen razred se procesira nepravilno.
Testirni model je opis vhodne domene, ki ustreza lastnostim polinoma.
Pravilo za načrtovanje testnih primerov: Identificiraj enakovredne razrede,
glede na skupno lastnost. Uporabi samo veljavne razrede. Za vsak enakovredni razred
tvori en testni primer.
5.
Z načrtovanjem testnih primerov lahko začnemo, ko je opisana vhodna domena.
6.
Testirna strategija je izčrpana, ko smo pokrili vse enakovredne razrede v vhodni
domeni. Zgornje število testnih primerov je enako številu enakovrednih razredov.
4. Opis strategije: ugibanje nepravilnosti (U)
Strategija je splošno uporabna..
Predpostavlja se, da je prisotna določena nepravilnost ali napaka.
Testirni model je seznam potencialnih nepravilnosti oziroma napak.
Pravilo za načrtovanje testnih primerov: Za vsako potencialno napako oziroma
nepravilnost v seznamu tvorimo en testni primer, s katerim preverimo, ali je ta napaka
prisotna.
5.
Z načrtovanjem testnih primerov lahko začnemo, ko je imamo pripravljen seznam.
6.
Testirna strategija je izčrpana, ko smo pokrili celoten seznam. Zgornje število
testnih primerov je enako številu napak oziroma nepravilnosti v seznamu.
1.
2.
3.
4.
5. Opis strategije: strukturno testiranje (S)
1.
Strategija je uporabna predvsem za testiranje komponent. Možno pa jo je uporabiti
tudi za testiranje celotnega programa. Najprej instrumentiran program testiramo s testnimi
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 12
2.
3.
4.
5.
6.
primeri, ki smo jih tvorili na podlagi raznih strategij. Če se pokaže, da določeni deli
programa (stavki) niso bili nikoli uporabljeni, potem uporabimo to strategijo.
Predpostavka o napaki: posledica napake so bo pojavila, ko se bo uporabil
določen del programske kode.
Testirni model je graf programa.
Pravilo za načrtovanje testnih primerov: Ugotovimo, kateri del programske
kode še ni bil uporabljen in nato z analizo programa določimo zahtevane vhodne podatke,
ki bodo pokrili nepokriti segment.
Z načrtovanjem testnih primerov lahko začnemo, ko dobimo podatke o pokritosti
stavkov, ki je bila dosežena s predhodnimi testnimi strategijami.
Testirna strategija je izčrpana, ko smo pokrili vse programske stavke.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 13
3 SYSTEM SPECIFICATIONS
3.1 DOCUMENT IDENTIFICATION, CONNECTIONS WITH OTHER DOCUMENTS
Document:Project plan
Version 1
Date 28.3.2005
Location Folder Amiral Batti.doc is in the folder “documentation”
Person in charge
E. Gundogdu
Reference to other documents
Internal standard cV&Vs
User requirements
3.2 SUMMARY
User has on 28.3.2005 given us user requirements that we will use to write system
specification.
They wanted from our company to get a PC software that will enable two persons to play a war
game. The program should enable the communication with the opponent. Each player should see the
playing and the shooting desk on the screen and the result of shooting. When the game is over, the
result is written.
3.3 REQUIREMENTS
Critical requirements are marked with exclamation mark.
3.3.1
Correctnes and functionality
See chapter 2.5 and 2.6.
3.3.2
Reliability
While two players are playing the game, any other person can not join the game. The game
uses just one port, so the other ports are closed for playing. None of the players can not display the
monitor of the opponent. User required no errors and that can not be verified. We will test our software
according to standard cV&Vs.
3.3.3
Testability
Our software will have a test mode. In this mode, administrator of the sofware can test any
parts of the software. For doing this, administrator has to use a special command (-t).
3.3.4
Portability
Portability is not required. Our program will run on a typical windows pc with internet
connection.
3.3.5
Usability
The player doesn't need to have any additional information for playing this game. All the
informations how to play the game are given in the help menu.
User required very user-friendly product. It can not be verified but these specifications are
presented to the user:The software will have a 'Help' menu. At any point of the game, player can use
this menu. By using this menu, player can learn the rules of the games, the control buttons, some
infomations about the game (Producer, version, producing date). Additionally the screens of the game
and the menus are very 'easy to understand'.
3.3.6
Safety
(No requirements)
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 14
3.3.7
Maintanability
Program has to have more than one module.
3.3.8
Performance
The performance of the program depends on the internet connection and configurations of the
computers. But the game performance is enough to satisfy the players with average computers. (With
a 500Mhz's computers, a shooting takes approximately 5 seconds)
3.4 RESTRICTIONS AND OTHER REQUIREMENTS
1) Program should run on standard PC with internet.
2) Test mode should be implemented. To run in the test mode parameter –t has to be
added:
connection.exe -t
Switch –t starts program in test mode.
3.5 DESCRIPTION OF SYSTEM
3.5.1
Typical use cases
TUC1_1: Typical gameplay
1. Player 1 starts game
2. Player 2 starts game
3. Player 1 starts listening mode
4. Player 2 connects to player 1's computer by entering he computer's IP
5. Both players place their ships
6. Players enter moves (shots) in turns until all entire fleet of one of them is sunk
7. Players quit game
TUC1_2: Connection problems
1. Player 1 starts game (listening mode)
2. Player 2 starts game (listening mode)
3. After a timeout error message is displayed and both players are back to main menu
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 15
3.5.2
Message sequence chart
Player 2
Player 1
A1 (SHOOT)
MISS or HIT
H8 (RESPONSE SHOOT)
MISS or HIT
.
.
.
.
3.6 DESCRIPTION OF DATA AND TERMINATORS
3.6.1
Data dictionary
data name
Connection choose
priority
IP address
Attribute
type
Number
Computer name
PLACE_SHIPS
Column+row
SHOOT_COORDINATE
column + row
MISS
HIT
SUNK
»MISS«
»HIT«
»SUNK«
533582056
interval
Integers
and dots
String
Character
+ integer
Character
+ integer
String
string
String
Tiskano: dd/03/yyyy 14:09
Verzija:36
comment
1
123.4.5.6
localhost
A1
A1
str. 16
3.6.2
Terminator description
Name
comment
Player 1
This is first player (his program) – the player who connected.
Player 2
Second player – player who waited for connection
3.7 DETAILED DESCRIPTION OF ALL FUNCTIONS AND OTHER REQUIREMENTS
PROGRAM HAS TO PROVIDE
Kritične so označene s klicajem.
F1. Connecting to other player
F2. Placing ships
F3. Make shots
F4. Respoding to shots
F5. Drawing board
F6. On-line help
F7. Checking input values
F8. Displaying version at progam start
Z1. Test mode of operation
Z2. Program should respond in less than second
3.8 USER INTERFACE
These are release mode screens. In test mode the screens are numbered…
The look
Screen #1
Remarks
Welcome to Battleship v1.0
Connection menu. User has
to choose who should start
the game. And user must
make an entry for connection.
User is informed what to
place in the game
You will place;
1 Aircraft Carrier(5 fields)
2 battleship(4 fields for each)
3 destroyers(3 fields for each)
4 frigates(2 fields for each)
For playing game you will connect to an another player.
Press 1 to connect, Press 2 to wait for a connection: 1
Screen #2
Computer name or IP to connect to: 123.4.5.678
Connection with 123.4.5.678 has been established.
User chose 1 and typed his
opponent's IP address and
connected to each other.
User has to enter the ship
coordinates.
Please enter your Aircraft Carrier's coordinates.
*......... 1
*......... 2
*......... 3
*......... 4
*......... 5
.......... 6
.......... 7
.......... 8
.......... 9
.......... 10
ABCDEFGHIJ
Enter location of topmost leftmost part of Aircraft Carrier:a1
Enter orientation of Aircraft Carrier: (h-horizontal. vvertical): h
Screen #3
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 17
*.****.... 1
*......... 2
*......... 3
*......... 4
*......... 5
.......... 6
.......... 7
.......... 8
.......... 9
.......... 10
ABCDEFGHIJ
Enter location of topmost leftmost part of Battleship: c1
Enter orientation of Aircraft Carrier: (h-horizontal. vvertical): h
User enters coordinates in
screen #2 and asks to place
the ships in horizontal or
vertical. User should select h
or v. Program prints out the
ship placed table. This
process continues until all
ships are placed. Note that
there must be one blank line
whit two ships. Otherwise
program wants to put a new
coordinate.
Screen #3
Number of tons left: 0
Okey! Your ships were put smoothly
Now you ready to shoot
*.****.**.
.......... 1
*.........
.......... 2
*..*...**.
.......... 3
*..*......
.......... 4
*..*...**.
.......... 5
..........
.......... 6
*.*....**.
.......... 7
*.*.......
.......... 8
*.*.......
.......... 9
*...***...
.......... 10
ABCDEFGHIJ
ABCDEFGHIJ
Move #1
Please shoot to a point your rival's board (You will shoot like
entering your ships) a1
After completing coordinate
entries, program asks for
shooting.
Screen #3
Your shot hit a ship
*.****.**.
+......... 1
*.........
.......... 2
*..*...**.
.......... 3
*..*......
.......... 4
*..*...**.
.......... 5
..........
.......... 6
*.*....**.
.......... 7
*.*.......
.......... 8
*.*.......
.......... 9
*...***...
.......... 10
ABCDEFGHIJ
ABCDEFGHIJ
Waiting for opponents shot…
If user shoots a ship, program
shows it on the table and
marks the coordinate with the
sign <+>. And user has to
wait opponents shot.
Screen #3
Ship was hit.
*.**+*.**.
+......... 1
*.........
.......... 2
*..*...**.
.......... 3
*..*......
.......... 4
*..*...**.
.......... 5
..........
.......... 6
*.*....**.
.......... 7
*.*.......
.......... 8
*.*.......
.......... 9
*...***...
.......... 10
ABCDEFGHIJ
ABCDEFGHIJ
Move #2
Please shoot to a point your rival's board (You will shoot like
entering your ships) g4
If the opponent hits user's
ship, it shows on the table
with the sign <+>. The user
has to enter a new
coordinate for shooting.
Screen #3
Your shot missed.
*.****.**.
+......... 1
*.........
....:..... 2
*..*...**.
.......... 3
*..*......
.......... 4
*..*...**.
.......... 5
..........
.......... 6
*.*....**.
.......... 7
*.*.......
.......... 8
*.*.......
.......... 9
*...***...
.......... 10
ABCDEFGHIJ
ABCDEFGHIJ
Waiting for opponent's shot…
533582056
If the user misses the target,
program puts the sign <:>
for missing target on the
table. If the opponent can
not shoot a target the
program doesn't show
anything.
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 18
Program continues until a player's all ships are sunk
Screen #4
+.++++.++.
+......... 1
+..........
..++...... 2
+.....++..
..++...... 3
+..+......
...:+.:... 4
+..+..++..
.+:....... 5
...+......
......:... 6
+.+...++..
....+..... 7
+.+.......
.:+.+..... 8
+.+.......
.......... 9
+....+++..
.......... 10
ABCDEFGHIJ
ABCDEFGHIJ
ship was hit.
Ship was sunk.
2 bad. All your ships have been sunk.
Press any key.
If the player looses the
game, program shows the
result and wants the user to
press any key to finish the
game.
3.9 DESCRIPTION OF FUNCTIOS THAT WILL BE A PART OF PROTOTYPE
3) Program should introduce itself.
4) User should be able to place the ships.
3.10 CRITERIA FOR ACCEPTANCE OF PRODUCT
5) Program should be developed accordind to the cV&Vs standards.(Has to be developed
according to standard…)
6) Program has to be tested until we get our aim that is planned. Some little errors can be
accepted if they don't affect the usability of the product and they are not impotant.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 19
4 TEST CASES
4.1 DOCUMENT IDENTIFICATION
Document: Testni primeri
Version 1
Date 28.3.2005
Location Folder Amiral Batti.doc is in the folder “documentation”
Person in charge
Erdem Gundogdu
References to other documents
Interni standard CVVS 2-2000
Naročnikove zahteve
Plan projekta, V1.0
Sistemske specifikacije V 1.0
Uporabniški priročnik V 1.0
4.2 SUMMARY
This document is based on user requirements, project plan and other documents listed in chapter 3.1.
It defines testing procedure and contains test cases. Results of testing are described in chapter 5.
4.3 TEST COMPONENT IDENTIFICATION
Test cases refer to executable code of Amiral Batti versions 1 and 2.
4.4 GENERAL DESCRIPTION OF TEST CASES
According to selected strategies (see 2.9.1 Test strategy descriptions) we created 9 test cases
described in supplement. Test cases are further described in 4.6 (test matrix), complete test cases are
part of supplement.
4.5 TEST PROCEDURE
In order to perform testing, the program (executable code) must be copied to the arbitrary directory.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 20
4.6 TEST MATRIX
ID
Requirement description
compl
exity1
sev
erit
y2
Factor
of
importance3
Number
of test
cases
T
C
1
T
C
2
T
C
3
T
C
4
T
C
5
F1
Connecting to other
player
3
3
9 (22,5 %)
5
*
*
*
*
*
F2
Placing ships
3
2
6 (15%)
1
F3
Make shots
2
3
6 (15%)
1
*
*
T
C
6
T
C
7
T
C
8
T
C
9
*
*
*
F4
Responding to shots
3
3
9 (22,5%)
1
F5
Drawing board
1
2
2 (5%)
4
F6
On-line help
3
1
3 (7,5%)
1
F7
Checking input values
2
1
2 (5%)
8
*
*
*
*
*
*
*
*
F8
Displaying version at
progam start
1
1
1 (2,5%)
9
*
*
*
*
*
*
*
*
*
Z1
Test mode of operation
1
1
1 (2,5%)
8
Z2
Program should respond
in less than second
1
1
1 (2,5%)
7
*
*
*
*
*
*
*
40 (100%)
45
(100%)
Total
*
*
*
Positive, negative
N
N
P
N
P
N
N
P
P
Test strategy4
U
U
Z
R
Z
M
M
Z
S
Execution priority
1
2
3
1
Complexity: LOC (lines of code), (1 low complexity, 2 medium, 3 high).
Severity level: 3 very critical, 2 critical, 1 insignificant
3 Factor of importance=number of test cases= complexity * criticalness
4 Strategy: presence of user requirements (Z), boundary values (M), equivalent classes (E), roboustness testing (R), error guessing (U), structural testing(S)
2
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 21
4.7 SUPPLEMENT
4.7.1
Input domain description (analysis)1
Location of
data
ID
Data name
Data type/set description
VS: valid set
IS: invalid set
comment
CC
Connection
Choice= one value
Value
<value>
Example:1
IP Address=one
value
Value
<value>
Ship coordinate=
First coordinate
Second coordinate
First coordinate
<First coordinate><second
coordinate>
Example: A1
VS={A..J}
IS={everything outside of VS}
VS={1…10}
IS={everything except outside of
VS}
A
<First coordinate><second
coordinate>
Example: A1
VS={A..J}
IS={everything outside of VS}
VS={1…10}
IS={everything except outside of
VS}
A
Screen #1
VS={1,2}
IS={everything except outside of
VS}
Screen #1
IPA
162.8.7.66
VS={all integer numbers and
dots}
IS={everything except outside of
VS}
Screen #2
SC
Second coordinate
1
Screen #3
SH
Shoot= First
coordinate
Second coordinate
First coordinate
Second coordinate
1
Konstante, ki so odvisne od prevajalnika
MaxReal = 3.4E38, MinReal = -3.4E38
MaxInteger = 2,147,483,647, MinInteger = –2,147,483,648
Navedene vrednosti veljajo na 32-bitnih prevajalnikih.
4.7.2
Output domain description (analysis)2
Location of
ID
Data name
Data type/set description
data
VS: valid set
IS: invalid set
Screen #4
RR
Ship status
<value>
Value
VS={"the ship was hit", "The
ship sunk"}
1
2
comment
Describe (analyse) at least 10 input data.
Describe at least 3 output data.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 22
4.7.3
Description of the Appendix – Test case
Test cases are arranged according to the strategy.
Specification based testing (Purpose: Are all requirements implemented?)
TC1 Is Connection to other player implemented?
TC3 Is Connection to other player implemented?
TC8 if Help Menu is available at every step of the game.
Boundary testing (Purpose: Checking how program performs on boundary value.)
Rouboustness testing strategy (Purpose: Does program properly reject invalid input data?)
TC5 what happens if user enters the datas correctly?
TC4 What happens if user enters invalid IP address?
TC6 What happens if user enters invalid datas for placing ships?
TC7 What happens if the user enters invalid datas for shooting?
TC6 What happens if user enters invalid datas for placing ships?
TC7 What happens if the user enters invalid datas for shooting?
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 23
4.7.3.1 Specification based testing
4.7.3.1.1
TC1 Connection Test- Is Connection to other player implemented?
Test case:
Version:
TC1
Test set:
Author:
V 1.0 10.06.2005
Amiral Batti
Erdem Gundogdu
Initial state
Command Prompt, file TEST1.TXT is empty
Strategy:
error guessing / negative test case
Purpose/bug
assumption
The connection to other computer is not implemented.
Remarks:
The program doesn't connect the other computer. To connect , both users should
choose connection type before entering IP address or computer name.
System
configuration:
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Dependency
on other test
cases:
No dependency
Step
Action / Input Variables
Expected value / action
Remark
1
AmiralBatti.v1\player1\connection.exe -t
Program start. Initial screen (#1) is
displayed.
Parameter –t for testing mode.
2
User 1 enters 1 to connect other player's
computer.
Program wants to enter the opponent's
IP address or computer name.
4
User 1 enters a valid a computer name:
localhost
Waiting for the connection.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
Test report remark
Program crashes. Because, the
opponent didn't choose to connect or
to be connected. See Anomaly 1/1
report
str. 24
4.7.3.1.2
TC2 Connection priority choosing Test
Test case:
Test set:
Version:
Author:
TC2
Initial state
Purpose
( Windows Command Prompt),
System
configuration:
I want to check if the program warns the user when he
enters invalid data for choosing connection priority.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Amiral Batti
Negative test case
Program doesn't warn the user and the program crashes. Program directly shows
the playing board.
Test case 1
Step
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
User 1 enters an invalid number to connect
other player's computer.
AmiralBat
ti.v1\play
er1\conne
ction.exe
-t
3
4
User 2 enters an invalid number to connect
other computer.
5
This is an invalid data. Please enter a
valid data.
4.7.3.1.3
V 1.0 10.06.2005
Erdem Gundogdu
Remark / invalid range
This is an invalid data. Please enter a
valid data.
Test report remark
Program doesn't connect and
shows the playing board
without connecing.
Program doesn't connect and
shows the playing board
without connecing.
TC3 Connection establishing test
Test case:
Test set:
Initial state
Purpose
System
configuration:
Version:
Author:
TC3
( Windows Command Prompt),
I want to check if the program connects properly when
every data is entered correctly.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Positive test case.
Program works properly when every data is entered correctly.
Dependency
on other test
cases:
Test case 1 and 2.
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
AmiralBatti.v1\
player1\conne
ction.exe -t
Program start. Initial screen (#1)
is displayed.
Tiskano: dd/03/yyyy 14:09
Verzija:36
Amiral Batti
Strategy:
Remarks:
Step
533582056
V 1.0 10.06.2005
Erdem Gundogdu
Remark / invalid range
str. 25
Test report remark
2
Enter 1 to connect other player's computer.
1
3
Other user enters 2 to connect other
player's computer.
2
4
User 1 enters a valid computer name.
localhost
Program wants a valid IP address or
computer name.
Program waits for connection.
Program connects to other computer
and wants the user to place the
ships.
4.7.3.2 Robustness testing.
4.7.3.2.1
TC 4 IP address entering test
Test case:
Test set:
Version:
Author:
TC4
Initial state
Purpose
( Windows Command Prompt),
System
configuration:
I want to check what happens if user enters invalid IP
address.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Negative test case
Program crashes and doesn't work.
Dependency
on other test
cases:
Test case 1 and 2.
Step
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
Enter 1 to connect other player's computer.
AmiralBatti.v1\
player1\conne
ction.exe -t
1
3
Other user enters 2 to connect other
player's computer.
2
4
User 1 enters an invalid IP address.
123.4.5.6
4.7.3.2.2
V 1.0 10.06.2005
Erdem Gundogdu
Remark / invalid range
Amiral Batti
Test report remark
Program wants a valid IP address or
computer name.
Program waits for connection.
This is an invalid data. Please enter
a valid data.
Program crashes and it doesn't
work.
TC 5 IP address entering test
Test case:
Test set:
Initial state
Purpose
System
configuration:
533582056
TC5
( Windows Command Prompt),
I want to check what happens if user enters the datas
correctly.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Tiskano: dd/03/yyyy 14:09
Strategy:
Remarks:
Dependency
on other test
cases:
Verzija:36
Version:
V 1.0 10.06.2005
Author:
Erdem Gundogdu
positive test case
Program works properly.
Test case 1 and 2.
str. 26
Amiral Batti
Step
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
Enter 1 to connect other player's computer.
AmiralBatti.v1\
player1\conne
ction.exe -t
1
3
Other user enters 2 to connect other
player's computer.
2
4
User 1 enters a valid IP address.
164.8.7.22
4.7.3.2.3
Remark / invalid range
Program wants a valid IP address or
computer name.
Program waits for connection.
Program connects to other computer
and wants the users to place the
ships.
TC6 Coordinate entering test
Test case:
Test set:
Initial state
Purpose
TC6
( Windows Command Prompt),
System
configuration:
I want to check what happens if user enters invalid
datas for placing ships.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Version:
V 1.0 10.06.2005 Amiral Batti
Author:
Erdem Gundogdu
Negative test case
Program warns the user and wants him to enter valid datas.
Test case 1, 2 and 5.
Step
Action / Input Variables
Value
Expected value / action
1
The users are connected to each other and
in this step users have to place their ships.
First user enters an invalid coordinate for
Frigate.
First
user
enters
another
invalid
coordinate.
K1
Program says it is invalid coordinate.
User has to enter a new valid
coordinate.
A11
3
First
user
coordinate.
enters
another
invalid
a
Program says it is invalid
User has to enter a
coordinate.
Program says it is invalid
User has to enter a
coordinate like e3.
4
First
user
coordinate.
enters
another
invalid
5
Program says it is invalid coordinate.
User has to enter a new valid
coordinate like e3.
5
First
user
coordinate.
enters
another
invalid
$
Program says it is invalid coordinate.
User has to enter a new valid
coordinate like e3.
2
Test report remark
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
Remark / invalid range
coordinate.
new valid
coordinate.
new valid
str. 27
Test report remark
6
First
user
coordinate.
7
5a
Program says it is invalid coordinate.
User has to enter a new valid
coordinate like e3.
First user enters a valid coordinate.
A1
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
8
First user types an invalid data.
f
Program wants the user to enter h or
v.
9
First user types an invalid data.
5
Program wants the user to enter h or
v.
10
First user types an invalid data.
H11
Program wants the user to enter h or
v.
11
First user types an invalid data.
V5
Program wants the user to enter h or
v.
12
First user types a valid data.
h
Program place the ship and wants
the user to shoot.
13
Second user types an invalid data.
A0
Program says it is invalid coordinate.
User has to enter a new valid
coordinate.
14
Second user types a valid data.
A10
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
15
Second user types v.
v
16
Second user types the coordinate again.
j10
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
17
Second user types v.
v
18
Second user types the coordinate again.
j1
19
Second user types v.
h
533582056
enters
another
invalid
Tiskano: dd/03/yyyy 14:09
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Verzija:36
str. 28
20
Second user types the coordinate again.
J5
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
21
Second user types v.
h
22
Second user types the coordinate again.
J1
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
23
Second user types v.
v
Program place the ship and waits for
the opponent's shoot.
TC 7 Shoot entering test
Test case:
Test set:
Initial state
Purpose
System
configuration:
Version:
Author:
TC7
( Windows Command Prompt),
I want to check what happens if the user enters invalid
datas for shooting.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Negative test case
Program warns the user and wants to enter valid data for shooting.
Dependency
on other test
cases:
Test cases 1,2,5 and 6.
Action / Input Variables
Value
1
2
Both users are connected and they placed
their ships. Now they are ready to shoot.
First users ship placed as A1 horizontal
A1 - h
4
Second users ship is placed as B5 vertical.
B5 - v
6
First user types an invalid shoot.
a
Program wants the user to enter a new
valid coordinate like e3.
7
First user types an invalid shoot.
1
Program wants the user to enter a new
valid coordinate like e3.
8
First user types an invalid shoot.
Z2
Program wants the user to enter a new
valid coordinate like e3.
Tiskano: dd/03/yyyy 14:09
Expected value / action
Verzija:36
Amiral Batti
Strategy:
Remarks:
Step
533582056
V 1.0 10.06.2005
Erdem Gundogdu
Remark / invalid range
str. 29
Test report remark
9
First user types an invalid shoot.
A11
Program wants the user to enter a new
valid coordinate like e3.
10
First user types an invalid shoot.
.
Program wants the user to enter a new
valid coordinate like e3.
11
First user types a valid shoot.
a1a
Program accepts the shoot and tells the
user if he shot or not. He misses the
shoot and : appears on the table his
opponent's table of his screen. And user 1
waits for a shoot from the oppponent.
Program tells the second user that, first
user's shoot is missed.
12
First user types an invalid shoot.
k1a
Program wants the user to enter a new
valid coordinate like e3.
13
Second user types a valid shoot
A1
Second user hits a ship and program
reports it to the user by showing + on the
ttable of his screen. Program waits for a
shoot from the opponent.
14
First user types a valid shoot.
B5
Program accepts the shoot and tells the
user if he shot or not. He shoots and +
appears on the table his opponent's table
of his screen. And user 1 waits for a shoot
from the oppponent.
Program tells the second user that, first
user has shot.
15
Second user types a valid shoot
g1
Second user misses the shoot and
program reports it to the user by showing
: on the ttable of his screen. Program
waits for a shoot from the opponent.
16
First user types a valid shoot.
B6
First user hits the ship and the second
user's ship sunks. For the the sunk ship
program puts * where the ship is sunk.
Program says »Congratulations, You won
a game. Press any key.« and the game
finishes.
Program says to second user that »Ship
was hit. Ship was sunk. 2 bad. All your
ships have been sunk. Press any key.«
and the game finishes.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 30
TC8 Reaching Help Menu test
Test case:
Test set:
Initial state
Purpose
System
configuration:
Version:
Author:
TC8
( Windows Command Prompt),
I want to check if Help Menu is available at every step
of the game.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
User 1 enters ? for help.
AmiralBat
ti.v1\play
er1\conne
ction.exe
-t
?
4
User 2 enters ? for help.
?
6
User 1 enters 1.
1
Tiskano: dd/03/yyyy 14:09
Remark / invalid range
Program tells the user what does 1 and 2
mean and how to connect to other
computer. And waits the user to enter 1 or
2.
Program tells the user what does 1 and 2
mean and how to connect to other
computer. And waits the user to enter 1 or
2.
Program waits from the user to type IP
address or computer name.
Verzija:36
Amiral Batti
Positive test case
Help menu is available at every step of the game except at the step before user
start shooting after placing all ships.
Test cases 1, 2, 5, 6 and 7.
Step
533582056
V 1.0 10.06.2005
Erdem Gundogdu
str. 31
Test report remark
7
User 1 enters ? for help.
?
8
User 2 enters ? for help.
?
9
User 1 enters computer name.
Localhost
10
User 1 enters ? for help.
?
Program tells the user how to place the
ships. And waits the user to type a
coordinate.
11
User 2 enters ? for help.
?
Program tells the user how to place the
ships. And waits the user to type a
coordinate.
12
User 1 enters an invalid coordinate.
R2
Program warns the user to enter a valid
coordinate.
13
User 1 enters ? for help.
?
Program tells the user the same help
menu about placing the ships. And waits
the user to type a coordinate.
14
User 1 enters a valid coordinate.
A1
Program wants the user to type v or h for
placing the ship.
15
User 1 enters ? for help.
?
Program tells the user what he should
type to place the ship.
16
User 1 enters h.
H
17
User 2 enters his ship's coordinates.
B1 –H
18
User 1 enters ? for help.
?
Program place the ships and wants the
user to shoot.
Program place the ship and waits for the
opponent's shoot.
Help about the that step of the game.
19
User 2 enters ? for help.
?
Program doesnt respond the user.
Because, he is waiting for the opponent's
shoot. He doesn't need help at this
moment.
20
user 1 makes a shoot.
A1
Program says he missed the shoot. And
waits for the opponent's shoot.
533582056
Tiskano: dd/03/yyyy 14:09
Program tells the user how should the
user write computer's name or IP
address. And waits the user to enter IP
address or computer's name.
Program doesnt respond the user.
Because, he is waiting for the other
computer to connect and he doesn't need
help about the connection.
Program connects the other computer
and wants the user to enter the
coordinate of the ships.
Verzija:36
str. 32
Program doesn't show the help
menu. Because, the coder
didn't write any info or he forgot
calling
this
subroutine.
Program writes on the screen
that »Displaying on-line help
for topic #3«
21
Program wants the second user to make a
shoot. User 2 enters ? for help.
?
22
User 1 enters ? for help.
?
23
User 2 makes a shoot.
A1
Program says he shot a ship. And user 2
waits for the opponent's shot.
24
User 1 makes a shoot.
D1
Program says he missed the shoot. And
waits for the opponent's shoot.
25
User 2 types ? after his opponent's shoot.
?
Program doesn't show the help menu.
Because, the coder didn't write any info or
he forgot calling this subroutine. Program
writes on the screen that »Displaying online help for topic #3«
13
User 2 makes a shoot.
A2
Program says he missed the shoot. And
waits for the opponent's shoot.
14
User 1 makes a shoot.
G6
Program says he missed the shoot. And
waits for the opponent's shoot.
15
User 2 makes a shoot.
B1
User the hits the ship and the ship
sunks. The game finishes. Help menu
is not available anymore.
4.7.3.2.4
Program doesn't show the help menu.
Because, the coder didn't write any info or
he forgot calling this subroutine. Program
writes on the screen that »Displaying online help for topic #3«
Program doesnt respond the user.
Because, he is waiting for the opponent's
shoot. He doesn't need help at this
moment.
TC9 Structural Test
Test case:
Test set:
Initial state
Purpose
TC9
( Windows Command Prompt),
System
configuration:
I want to use all functions that I didn’t use in previous
test cases. I want to cover all codes with this test case.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Version:
V 1.0 10.06.2005
Author:
Erdem Gundogdu
Positive test case
Program works properly.
Test case 1, 2 and 5.
Step
Action / Input Variables
Value
Expected value / action
1
Firts user runs the program and press 1 for
connection.
1
Program wants the user to enter IP
address or computer name.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
Amiral Batti
Remark / invalid range
str. 33
Test report remark
2
Second user runs the program and press 2
for connection.
2
Program waits for connection.
3
First user writes the computer name.
localhost
Program connects to other computer
and wants the user to enter Aircraft
Carrier's coordinates.
4
First user
coordinate.
A1-h
Program place the ship on the table.
5
First user enters Battleship's coordinate.
G1-h
Program place the ship on the table.
6
First user
coordinate.
A3-h
Program place the ship on the table.
7
First user enters first Destroyer's
coordinate.
F3-h
Program place the ship on the table.
8
First user enters second Destroyer's
coordinate.
A5-h
Program place the ship on the table.
9
First user enters third Destroyer's
coordinate.
E5-h
Program place the ship on the table.
10
First user enters first Frigate's coordinate.
A7-h
Program place the ship on the table.
11
First user enters second Frigate's
coordinate.
D7-h
Program place the ship on the table.
12
First user enters third Frigate's coordinate.
G7-h
Program place the ship on the table.
13
First user enters third Frigate's coordinate
A9-h
Program place the ship on the table.
Program wants the user to start
shooting.
14
Second user
coordinate.
Carrier's
A1-v
Program place the ship on the table.
15
Second
user
coordinate.
Battleship's
A7-v
Program place the ship on the table.
16
Second user enters second Battleship's
coordinate.
C1-v
Program place the ship on the table.
17
Second user enters first Destroyer's
coordinate.
C6-v
Program place the ship on the table.
18
Second user enters second Destroyer's
coordinate.
E1-v
Program place the ship on the table.
19
Second user enters third Destroyer's
coordinate.
E5-v
Program place the ship on the table.
20
Second user enters first Frigate's
coordinate.
E9-v
Program place the ship on the table.
533582056
enters
enters
Aircraft
second
enters
Carrier's
Battleship's
Aircraft
enters
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 34
21
Second user enters second Frigate's
coordinate.
G1-v
Program place the ship on the table.
22
Second user enters third Frigate's
coordinate.
G4-v
Program place the ship on the table.
23
Second user enters third Frigate's
coordinate
G7-v
Program place the ship on the table.
Program waits the opponent to
shoot.
24
First user makes a shoot.
A1
User hits the game and waits for
opponents shoot.
25
Second user makes a shoot.
B2
User misses the target and program
wants the user to wait for opponent's
shoot.
26
First user makes a shoot.
J1
User misses the target and program
wants the user to wait for opponent's
shoot.
27
Second user makes a shoot.
B7
User hits the game and waits for
opponents shoot.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 35
4.7.3.3 Boundary testing
4.7.3.3.1
TC1 »Connection Test«
Test case:
Test set:
Version:
Author:
TC1
Initial state
Purpose
( Windows Command Prompt),
System
configuration:
I want to check if program connect the other computer
unless the other user doesn’t choose connection type.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
User 1 enters 1 to connect other player's
computer.
User 1 enters a valid a computer name
AmiralBat
ti.v1\play
er1\conne
ction.exe
-t
1
localhost
Amiral Batti
Negative test case
Program warns the user to wait the other user. Program waits for the user to
choose connection type.
No dependency
Step
4
V 2.0 15.06.2005
Erdem Gundogdu
Remark / invalid range
Test report remark
Program wants to enter the opponent's IP
address or computer name.
Program says »Error connecting (
Connect failed (connect ( )): No error).
Computer name or IP to connect to: »
4.7.3.3.2
TC2 Connection priority choosing Test
Test case:
Test set:
Initial state
Purpose
System
configuration:
Step
( Windows Command Prompt),
I want to check if the program warns the user when he
enters invalid data for choosing connection priority.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Action / Input Variables
533582056
Version:
Author:
TC2
Value
Tiskano: dd/03/yyyy 14:09
Strategy:
Remarks:
Dependency
on other test
cases:
Expected value / action
Verzija:36
V 2.0 15.06.2005
Erdem Gundogdu
Amiral Batti
Negative test case
Program doesn't warn the user and the program crashes. Program directly shows
the playing board. This bug couldn't be fixed.
Test case 1
Remark / invalid range
str. 36
Test report remark
1
In DOS command prompt write the files
name and add –t for testing mode.
2
User 1 enters an invalid number to connect
other player's computer.
4
User 2 enters an invalid number to connect
other computer.
4.7.3.3.3
AmiralBat
ti.v1\play
er1\conne
ction.exe
-t
3
Program start. Initial screen (#1) is
displayed.
5
This is an invalid data. Please enter a
valid data.
This is an invalid data. Please enter a
valid data.
Program doesn't connect and
shows the playing board
without connecing.
Program doesn't connect and
shows the playing board
without connecing.
TC3 Connection establishing test
Test case:
Test set:
Version:
Author:
TC3
Initial state
Purpose
( Windows Command Prompt),
System
configuration:
I want to check if the program connects properly when
every data is entered correctly.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Positive test case.
Program works properly when every data is entered correctly.
Dependency
on other test
cases:
Test case 1 and 2.
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
AmiralBatti.v1\
player1\conne
ction.exe -t
1
Program start. Initial screen (#1)
is displayed.
Enter 1 to connect other player's computer.
3
Other user enters 2 to connect other
player's computer.
2
4
User 1 enters a valid computer name.
localhost
Amiral Batti
Strategy:
Remarks:
Step
2
V 2.0 15.06.2005
Erdem Gundogdu
Remark / invalid range
Test report remark
Program wants a valid IP address or
computer name.
Program waits for connection.
Program connects to other computer
and wants the user to place the
ships.
4.7.3.4 Strategija Ekvivalentni razredi polinomov.
4.7.3.4.1
TC 4 IP address entering test
Test case:
Test set:
533582056
Version:
Author:
TC4
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 37
V 2.0 15.06.2005
Erdem Gundogdu
Amiral Batti
Initial state
Purpose
( Windows Command Prompt),
System
configuration:
I want to check what happens if user enters invalid IP
address.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Negative test case
Program wants the user to enter the IP address or computer name again.
Dependency
on other test
cases:
Test case 1 and 2.
Step
Action / Input Variables
Value
Expected value / action
Remark / invalid range
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
Enter 1 to connect other player's computer.
AmiralBatti.v1\
player1\conne
ction.exe -t
1
3
Other user enters 2 to connect other
player's computer.
2
4
User 1 enters an invalid IP address.
123.4.5.6
Test report remark
Program wants a valid IP address or
computer name.
Program waits for connection.
Program says »Error connecting (
Connect failed (connect ( )): No
error).
Computer name or IP to connect to:
»
4.7.3.4.2
TC 5 IP address entering test
Test case:
Test set:
Initial state
Purpose
TC5
( Windows Command Prompt),
System
configuration:
I want to check what happens if user enters the datas
correctly.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Version:
V 2.0 15.06.2005
Author:
Erdem Gundogdu
positive test case
Program works properly.
Test case 1 and 2.
Step
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
Enter 1 to connect other player's computer.
AmiralBatti.v1\
player1\conne
ction.exe -t
1
3
Other user enters 2 to connect other
player's computer.
533582056
2
Tiskano: dd/03/yyyy 14:09
Remark / invalid range
Program wants a valid IP address or
computer name.
Program waits for connection.
Verzija:36
Amiral Batti
str. 38
Test report remark
4
User 1 enters a valid IP address.
4.7.3.4.3
164.8.7.22
Program connects to other computer
and wants the users to place the
ships.
TC6 Coordinate entering test
Test case:
Test set:
Initial state
Purpose
TC6
( Windows Command Prompt),
System
configuration:
I want to check what happens if user enters invalid
datas for placing ships.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Version:
V 2.0 15.06.2005 Amiral Batti
Author:
Erdem Gundogdu
Negative test case
Program warns the user and wants him to enter valid datas.
Test case 1, 2 and 5.
Step
Action / Input Variables
Value
Expected value / action
1
The users are connected to each other and
in this step users have to place their ships.
First user enters an invalid coordinate for
Frigate.
First
user
enters
another
invalid
coordinate.
K1
Program says it is invalid coordinate.
User has to enter a new valid
coordinate.
A11
3
First
user
coordinate.
enters
another
invalid
a
Program says it is invalid
User has to enter a
coordinate.
Program says it is invalid
User has to enter a
coordinate like e3.
4
First
user
coordinate.
enters
another
invalid
5
Program says it is invalid coordinate.
User has to enter a new valid
coordinate like e3.
5
First
user
coordinate.
enters
another
invalid
$
Program says it is invalid coordinate.
User has to enter a new valid
coordinate like e3.
6
First
user
coordinate.
enters
another
invalid
5a
Program says it is invalid coordinate.
User has to enter a new valid
coordinate like e3.
7
First user enters a valid coordinate.
A1
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
8
First user types an invalid data.
f
Program wants the user to enter h or
v.
9
First user types an invalid data.
5
Program wants the user to enter h or
v.
2
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
Remark / invalid range
coordinate.
new valid
coordinate.
new valid
str. 39
Test report remark
10
First user types an invalid data.
H11
Program wants the user to enter h or
v.
11
First user types an invalid data.
V5
Program wants the user to enter h or
v.
12
First user types a valid data.
h
Program place the ship and wants
the user to shoot.
13
Second user types an invalid data.
A0
Program says it is invalid coordinate.
User has to enter a new valid
coordinate.
14
Second user types a valid data.
A10
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
15
Second user types v.
v
16
Second user types the coordinate again.
j10
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
17
Second user types v.
v
18
Second user types the coordinate again.
j1
19
Second user types v.
h
20
Second user types the coordinate again.
J5
21
Second user types v.
h
22
Second user types the coordinate again.
J1
23
Second user types v.
v
533582056
Tiskano: dd/03/yyyy 14:09
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
Program says, it is not a valid
position for a ship. Program wants
the user to enter the coordinate
again.
Program wants orientation of Frigate.
User has to place the ship horizontal
or vertical. He should type h or v.
Program place the ship and waits for
the opponent's shoot.
Verzija:36
str. 40
TC 7 Shoot entering test
Test case:
Test set:
Initial state
Purpose
System
configuration:
Version:
Author:
TC7
( Windows Command Prompt),
I want to check what happens if the user enters invalid
datas for shooting.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Negative test case
Program warns the user and wants to enter valid data for shooting.
Dependency
on other test
cases:
Test cases 1,2,5 and 6.
Action / Input Variables
Value
1
2
Both users are connected and they placed
their ships. Now they are ready to shoot.
First users ship placed as A1 horizontal
A1 - h
4
Second users ship is placed as B5 vertical.
B5 - v
6
First user types an invalid shoot.
a
Program wants the user to enter a new
valid coordinate like e3.
7
First user types an invalid shoot.
1
Program wants the user to enter a new
valid coordinate like e3.
8
First user types an invalid shoot.
Z2
Program wants the user to enter a new
valid coordinate like e3.
9
First user types an invalid shoot.
A11
Program wants the user to enter a new
valid coordinate like e3.
10
First user types an invalid shoot.
.
Program wants the user to enter a new
valid coordinate like e3.
11
First user types a valid shoot.
a1a
Program accepts the shoot and tells the
user if he shot or not. He misses the
shoot and : appears on the table his
opponent's table of his screen. And user 1
waits for a shoot from the oppponent.
Expected value / action
Remark / invalid range
Program tells the second user that, first
user's shoot is missed.
Tiskano: dd/03/yyyy 14:09
Verzija:36
Amiral Batti
Strategy:
Remarks:
Step
533582056
V 2.0 15.06.2005
Erdem Gundogdu
str. 41
Test report remark
12
First user types an invalid shoot.
k1a
Program wants the user to enter a new
valid coordinate like e3.
13
Second user types a valid shoot
A1
Second user hits a ship and program
reports it to the user by showing + on the
ttable of his screen. Program waits for a
shoot from the opponent.
14
First user types a valid shoot.
B5
Program accepts the shoot and tells the
user if he shot or not. He shoots and +
appears on the table his opponent's table
of his screen. And user 1 waits for a shoot
from the oppponent.
Program tells the second user that, first
user has shot.
15
Second user types a valid shoot
g1
Second user misses the shoot and
program reports it to the user by showing
: on the ttable of his screen. Program
waits for a shoot from the opponent.
16
First user types a valid shoot.
B6
First user hits the ship and the second
user's ship sunks. For the the sunk ship
program puts * where the ship is sunk.
Program says »Congratulations, You won
a game. Press any key.« and the game
finishes.
Program says to second user that »Ship
was hit. Ship was sunk. 2 bad. All your
ships have been sunk. Press any key.«
and the game finishes.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 42
TC8 Reaching Help Menu test
Test case:
Test set:
Initial state
Purpose
System
configuration:
Version:
Author:
TC8
( Windows Command Prompt),
I want to check if Help Menu is available at every step
of the game.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Action / Input Variables
Value
Expected value / action
1
In DOS command prompt write the files
name and add –t for testing mode.
Program start. Initial screen (#1) is
displayed.
2
User 1 enters ? for help.
AmiralBat
ti.v1\play
er1\conne
ction.exe
-t
?
4
User 2 enters ? for help.
?
6
User 1 enters 1.
1
7
User 1 enters ? for help.
?
8
User 2 enters ? for help.
?
9
User 1 enters computer name.
Localhost
10
User 1 enters ? for help.
?
Tiskano: dd/03/yyyy 14:09
Remark / invalid range
Program tells the user what does 1 and 2
mean and how to connect to other
computer. And waits the user to enter 1 or
2.
Program tells the user what does 1 and 2
mean and how to connect to other
computer. And waits the user to enter 1 or
2.
Program waits from the user to type IP
address or computer name.
Program tells the user how should the
user write computer's name or IP
address. And waits the user to enter IP
address or computer's name.
Program doesnt respond the user.
Because, he is waiting for the other
computer to connect and he doesn't need
help about the connection.
Program connects the other computer
and wants the user to enter the
coordinate of the ships.
Program tells the user how to place the
ships. And waits the user to type a
coordinate.
Verzija:36
Amiral Batti
Positive test case
Help menu is available at every step of the game except at the step before user
has to response his opponent's shoot.
Test cases 1, 2, 5, 6 and 7.
Step
533582056
V 2.0 15.06.2005
Erdem Gundogdu
str. 43
Test report remark
11
User 2 enters ? for help.
?
Program tells the user how to place the
ships. And waits the user to type a
coordinate.
12
User 1 enters an invalid coordinate.
R2
Program warns the user to enter a valid
coordinate.
13
User 1 enters ? for help.
?
Program tells the user the same help
menu about placing the ships. And waits
the user to type a coordinate.
14
User 1 enters a valid coordinate.
A1
Program wants the user to type v or h for
placing the ship.
15
User 1 enters ? for help.
?
Help about the that step of the game.
16
User 1 enters h.
H
17
User 2 enters his ship's coordinates.
B1 –H
18
User 1 enters ? for help.
?
19
User 2 enters ? for help.
?
Program place the ships and wants the
user to shoot.
Program place the ship and waits for the
opponent's shoot.
Program shows the help menu and says
how to make shoots.
Program doesnt respond the user.
Because, he is waiting for the opponent's
shoot. He doesn't need help at this
moment.
20
user 1 makes a shoot.
A1
21
Program wants the second user to make a
shoot. User 2 enters ? for help.
?
22
User 1 enters ? for help.
?
Program shows the help menu and says
how to make shoots.
23
User 2 makes a shoot.
A1
Program says he shot a ship. And user 2
waits for the opponent's shot.
24
User 1 makes a shoot.
D1
Program says he missed the shoot. And
waits for the opponent's shoot.
533582056
Tiskano: dd/03/yyyy 14:09
Program doesn't show the help
menu. Because, the coder
didn't write any info or he forgot
calling
this
subroutine.
Program writes on the screen
that »Displaying on-line help
for topic #5«
Program says he missed the shoot. And
waits for the opponent's shoot.
Help about the that step of the game.
Verzija:36
str. 44
Program doesn't show the help
menu. Because, the coder
didn't write any info or he forgot
calling
this
subroutine.
Program writes on the screen
that »Displaying on-line help
for topic #5«
25
User 2 types ? after his opponent's shoot.
?
Program shows the help menu and says
how to make shoots
13
User 2 makes a shoot.
A2
Program says he missed the shoot. And
waits for the opponent's shoot.
14
User 1 makes a shoot.
G6
Program says he missed the shoot. And
waits for the opponent's shoot.
15
User 2 makes a shoot.
B1
User hits the ship and the ship sunks.
The game finishes. Help menu is not
available anymore.
4.7.3.4.4
TC9 Structural Test
Test case:
Test set:
Initial state
Purpose
TC9
( Windows Command Prompt),
System
configuration:
I want to use all functions that I didn’t use in previous
test cases. I want to cover all codes with this test case.
Windows XP with Sp2, 504MB RAM, Intel Celeron 2.4
GHz
Strategy:
Remarks:
Dependency
on other test
cases:
Version:
V 2.0 15.06.2005
Author:
Erdem Gundogdu
Positive test case
Program works properly.
Test case 1, 2 and 5.
Step
Action / Input Variables
Value
Expected value / action
1
Firts user runs the program and press 1 for
connection.
Second user runs the program and press 2
for connection.
1
Program wants the user to enter IP
address or computer name.
Program waits for connection.
3
First user writes the computer name.
localhost
Program connects to other computer
and wants the user to enter Aircraft
Carrier's coordinates.
4
First user
coordinate.
A1-h
Program place the ship on the table.
5
First user enters Battleship's coordinate.
G1-h
Program place the ship on the table.
6
First user
coordinate.
A3-h
Program place the ship on the table.
7
First user enters first Destroyer's
coordinate.
F3-h
Program place the ship on the table.
8
First user enters second Destroyer's
coordinate.
A5-h
Program place the ship on the table.
2
533582056
enters
enters
Aircraft
second
Carrier's
Battleship's
2
Tiskano: dd/03/yyyy 14:09
Verzija:36
Amiral Batti
Remark / invalid range
str. 45
Test report remark
9
First user enters third Destroyer's
coordinate.
E5-h
Program place the ship on the table.
10
First user enters first Frigate's coordinate.
A7-h
Program place the ship on the table.
11
First user enters second Frigate's
coordinate.
D7-h
Program place the ship on the table.
12
First user enters third Frigate's coordinate.
G7-h
Program place the ship on the table.
13
First user enters third Frigate's coordinate
A9-h
Program place the ship on the table.
Program wants the user to start
shooting.
14
Second user
coordinate.
Carrier's
A1-v
Program place the ship on the table.
15
Second
user
coordinate.
Battleship's
A7-v
Program place the ship on the table.
16
Second user enters second Battleship's
coordinate.
C1-v
Program place the ship on the table.
17
Second user enters first Destroyer's
coordinate.
C6-v
Program place the ship on the table.
18
Second user enters second Destroyer's
coordinate.
E1-v
Program place the ship on the table.
19
Second user enters third Destroyer's
coordinate.
E5-v
Program place the ship on the table.
20
Second user enters first Frigate's
coordinate.
E9-v
Program place the ship on the table.
21
Second user enters second Frigate's
coordinate.
G1-v
Program place the ship on the table.
22
Second user enters third Frigate's
coordinate.
G4-v
Program place the ship on the table.
23
Second user enters third Frigate's
coordinate
G7-v
Program place the ship on the table.
Program waits the opponent to
shoot.
24
First user makes a shoot.
A1
User hits the game and waits for
opponents shoot.
25
Second user makes a shoot.
B2
User misses the target and program
wants the user to wait for opponent's
shoot.
26
First user makes a shoot.
J1
User misses the target and program
wants the user to wait for opponent's
shoot.
533582056
enters
Aircraft
enters
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 46
27
Second user makes a shoot.
533582056
B7
Tiskano: dd/03/yyyy 14:09
User hits the game and waits for
opponents shoot.
Verzija:36
str. 47
5 TEST REPORT
5.1 DOCUMENT IDENTIFICATION, REFERENCES TO OTHER DOCUMENTS
Document
Test report
Version
Date
location
1
15.6.2005
File admiralbatti2.doc in folder »AdmralBatti.v2« of project
Person in charge
Askin Erdem Gundogdu
References to other documentation
Internal standard CVVS 2-2000
User requirements
Project plan, V 1.0
System specifications V 1.0
User manual V 1.0
Test cases 2.0
5.2 SUMMARY
Product was tested according to standards CVVS 2-2000 and quality management plan described in
(chapter D2.3). Used test cases are described in the document »Test cases«.
5.3 ACTIVITIES USED AND FINDINGS
All activities planned in project plan were executed:
a.
technical review of the document
b.
source code examination
c.
prototype evaluation
d.
final product testing
5.3.1
General document technical review
All documents were examined. Found anomalies were repaired. All documents meet the standard.
3.2. Prototype evaluation
Prototype was examined with review and testing (single test). Programmers coding style was checked
if it meets the standard. All anomalies were forwarded to programmer.
3.3. Source code examination (version 2.0)
Documentation density is: 2.5 words of comment / line of program code. Winmetr 3.06 was used to
gather this statistics. Printout is included in document appendix. Logical complexity (LC1) was always
less than 20. Source code was checked accoring to cV&Vs standard.
3.4. Final product testing
Testing was done on a PC with Windows XP. Devpartner studio was used for coverage analysis.
Two versions of program were tested: V1.0 and V2.0.
1. test strategies used:
Following test strategies were used for planning test cases
a)
Specification based testing
b)
roboustness testing
c)
error guessing
d)
structural testing
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 48
3. Testing effort:
According to chosen strategies and terminal criteria function 9 test cases were used.
4. Thoroughness:
Planned terminal criteria function: (pg1 AND pg2) OR pg3.
pg1.
every of user requirements hast to be tested at least once
pg2.
Each function in source code should be called at least once.
pg3.
Planned testing time has passed.
Testing was finished, when pg1, and pg3 were fulfilled.
Coverage reached:
Pg1
100% user requirements fulfillment (10 requirements)
Pg2
96% of functions called
Pg3
100%
pg2 was not fulfilled, because function DisplayBoardDebug was temporariliy used during
development and wasn't removed from code. It is not in use anymore, but was left there in
case it is needed again. Function could be tested only with isolated testing of that subroutine –
using special calling function.
5. Findings:
There were 4 incorecctneses found in version 1. 2 were repaired and 2 were given a
status of deficiency.
There were 2 incorecctneses found in version 2. 0 were repaired and 2 were given a
status of deficiency.
Efficiency of debugging (reapiring a code) was checked with regression testing.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 49
5.4 REPORT ON FOUND ANOMALIES
Altogether 6 anomalies (problems) were found. 2 has been repaired, 4 are left for the later release.
List of all anomalies:
Anomaly
ID
Test
case
ID
Version of
code
where
Severity
anomaly
was
discovered
Brief description of the anomaly
Final status of the
anomaly
Remark
1/1
TC1
The program doesn't connect the other computer. To connect ,
both users should choose connection type before entering IP
address or computer name.
2
V1.0
Repaired in v2.0
1/2
TC2
Program doesn't warn the user and the program crashes.
Program directly shows the playing board.
2
V1.0
Known problem
1/3
TC4
Program crashes when user enters invalid IP address.
1
V1.0
Repaired in v2.0
1/4
TC8
Help menu is available at every step of the game except at the
step before user start shooting after placing all ships.
1
V1.0
Known problem
Will be repaired in later release
2/1
TC2
Program doesn't warn the user and the program crashes.
Program directly shows the playing board. This bug couldn't
be fixed.
2
V2.0
Known problem
Will be repaired in later release
2/2
TC8
Help menu is available at every step of the game except at the
step before user has to response his opponent's shoot.
1
V2.0
Known problem
Will be repaired in later release
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 50
See anomaly 2/1 in the version V2.0
5.5
5.5.1
ANNEX
Bug reports (D4.4. is used insted of bug reports)
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 51
5.5.2
Complexity and comment density report
Complexity and comments were measured with Winmetr 3.06. Report follows.
5.5.2.1 Source code version: V1.0
---------------------------------------+-----+------+------+------+------+------+------+------+-----+
vrsta in ime področja
|start|
LOC| LOPC|
EL|
LC1|
LC2|
LC3|
CM1| CM2|
---------------------------------------+-----+------+------+------+------+------+------+------+-----+
*POVZETEK*
|
|
571|
425|
57|
78| 0.184|
102| 1074| 2.53|
\--mod Z:\AdmralBatti.v1\connection.cpp|
|
571|
425|
57|
78| 0.184|
102| 1074| 2.53|
| +--r/m DisplayHelp
|
31|
26|
25|
0|
5|
0.2|
5|
6| 0.24|
| +--r/m ReadString
|
58|
10|
9|
0|
3| 0.333|
3|
8|0.889|
| +--r/m Connect
|
69|
19|
8|
1|
1| 0.125|
1|
112|
14|
| +--r/m WaitForIncomingConnection
|
89|
21|
7|
3|
1| 0.143|
1|
134| 19.1|
| +--r/m CountElements
| 110|
8|
8|
0|
4|
0.5|
4|
0|
0|
| +--r/m ClearBoard
| 119|
6|
6|
0|
3|
0.5|
3|
0|
0|
| +--r/m DisplayBoard
| 126|
15|
15|
0|
6|
0.4|
6|
4|0.267|
| +--r/m DisplayBoards
| 142|
25|
23|
2|
11| 0.478|
11|
8|0.348|
| +--r/m DisplayBoardDebug
| 168|
11|
11|
0|
3| 0.273|
3|
3|0.273|
| +--r/m ShipName
| 180|
15|
14|
0|
5| 0.357|
5|
7| 0.5|
| +--r/m CheckCoordinates
| 196|
5|
4|
0|
1| 0.25|
1|
6| 1.5|
| +--r/m GetElement
| 202|
16|
6|
1|
2| 0.333|
2|
45| 7.5|
| +--r/m SetElement
| 219|
13|
5|
0|
2|
0.4|
2|
36| 7.2|
| +--r/m ThereIsSpaceFor
| 233|
26|
12|
1|
4| 0.333|
4|
125| 10.4|
| +--r/m IsValidPosition
| 260|
16|
12|
0|
1|0.0833|
1|
27| 2.25|
| +--r/m PlaceShipAt
| 277|
17|
12|
1|
4| 0.333|
4|
57| 4.75|
| +--r/m PlaceShip
| 295|
57|
41|
5|
10| 0.244|
10|
113| 2.76|
| +--r/m SendResponse
| 353|
5|
4|
0|
1| 0.25|
1|
7| 1.75|
| +--r/m ReceiveResponse
| 359|
14|
9|
1|
4| 0.444|
4|
22| 2.44|
| +--r/m ReadMove
| 374|
21|
19|
0|
5| 0.263|
5|
59| 3.11|
| +--r/m ProcessShot
| 396|
24|
24|
0|
4| 0.167|
4|
10|0.417|
| +--r/m MarkShot
| 421|
17|
17|
0|
4| 0.235|
4|
1|0.0588|
| +--r/m SendMove
| 439|
8|
6|
0|
1| 0.167|
1|
20| 3.33|
| +--r/m ReceiveMove
| 448|
25|
20|
3|
4|
0.2|
4|
59| 2.95|
| \--r/m main
| 474|
98|
86|
10|
13| 0.151|
13|
142| 1.65|
---------------------------------------+-----+------+------+------+------+------+------+------+-----+
start ... začetna vrstica področja
LOC
... število vseh vrstic v področju
LOPC ... število vrstic programske (ne-prazne, ne-komentarske) kode v področju
EL
... število praznih vrstic v področju
LC1
... logična kompleksnost področja (število osnovnih testnih poti v področju)
LC2
... logična kompleksnost na vrstico programske kode (LC1/LOPC)
LC3
... McCabejeva logična kompleksnost
CM1
... število besed komentarja v področju
CM2
... število besed komentarja na vrstico programske kode (LOPC) za to področje
--Področja:
r/m
... podprogram ali metoda
cls
... razred
mod
... modul
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 52
5.5.2.2 (Poročilo generirano z WinMetr-om v3.0.4) Source code version: V2.0
-----------------------------------------------------------------------------+-----+------+------+------+------+------+------+------+-----+
vrsta in ime področja
|start|
LOC| LOPC|
EL|
LC1|
LC2|
LC3|
CM1| CM2|
-----------------------------------------------------------------------------+-----+------+------+------+------+------+------+------+-----+
*POVZETEK*
|
|
583|
434|
58|
79| 0.182|
103| 1086| 2.5|
\--mod C:\Documents and Settings\branko\Desktop\AdmralBatti.v2\connection.cpp|
|
583|
434|
58|
79| 0.182|
103| 1086| 2.5|
| +--r/m DisplayHelp
|
31|
26|
25|
0|
5|
0.2|
5|
6| 0.24|
| +--r/m ReadString
|
58|
10|
9|
0|
3| 0.333|
3|
8|0.889|
| +--r/m Connect
|
69|
31|
17|
2|
2| 0.118|
2|
124| 7.29|
| +--r/m WaitForIncomingConnection
| 101|
21|
7|
3|
1| 0.143|
1|
134| 19.1|
| +--r/m CountElements
| 122|
8|
8|
0|
4|
0.5|
4|
0|
0|
| +--r/m ClearBoard
| 131|
6|
6|
0|
3|
0.5|
3|
0|
0|
| +--r/m DisplayBoard
| 138|
15|
15|
0|
6|
0.4|
6|
4|0.267|
| +--r/m DisplayBoards
| 154|
25|
23|
2|
11| 0.478|
11|
8|0.348|
| +--r/m DisplayBoardDebug
| 180|
11|
11|
0|
3| 0.273|
3|
3|0.273|
| +--r/m ShipName
| 192|
15|
14|
0|
5| 0.357|
5|
7| 0.5|
| +--r/m CheckCoordinates
| 208|
5|
4|
0|
1| 0.25|
1|
6| 1.5|
| +--r/m GetElement
| 214|
16|
6|
1|
2| 0.333|
2|
45| 7.5|
| +--r/m SetElement
| 231|
13|
5|
0|
2|
0.4|
2|
36| 7.2|
| +--r/m ThereIsSpaceFor
| 245|
26|
12|
1|
4| 0.333|
4|
125| 10.4|
| +--r/m IsValidPosition
| 272|
16|
12|
0|
1|0.0833|
1|
27| 2.25|
| +--r/m PlaceShipAt
| 289|
17|
12|
1|
4| 0.333|
4|
57| 4.75|
| +--r/m PlaceShip
| 307|
57|
41|
5|
10| 0.244|
10|
113| 2.76|
| +--r/m SendResponse
| 365|
5|
4|
0|
1| 0.25|
1|
7| 1.75|
| +--r/m ReceiveResponse
| 371|
14|
9|
1|
4| 0.444|
4|
22| 2.44|
| +--r/m ReadMove
| 386|
21|
19|
0|
5| 0.263|
5|
59| 3.11|
| +--r/m ProcessShot
| 408|
24|
24|
0|
4| 0.167|
4|
10|0.417|
| +--r/m MarkShot
| 433|
17|
17|
0|
4| 0.235|
4|
1|0.0588|
| +--r/m SendMove
| 451|
8|
6|
0|
1| 0.167|
1|
20| 3.33|
| +--r/m ReceiveMove
| 460|
25|
20|
3|
4|
0.2|
4|
59| 2.95|
| \--r/m main
| 486|
98|
86|
10|
13| 0.151|
13|
142| 1.65|
-----------------------------------------------------------------------------+-----+------+------+------+------+------+------+------+-----+
start ... začetna vrstica področja
LOC
... število vseh vrstic v področju
LOPC ... število vrstic programske (ne-prazne, ne-komentarske) kode v področju
EL
... število praznih vrstic v področju
LC1
... logična kompleksnost področja (število osnovnih testnih poti v področju)
LC2
... logična kompleksnost na vrstico programske kode (LC1/LOPC)
LC3
... McCabejeva logična kompleksnost
CM1
... število besed komentarja v področju
CM2
... število besed komentarja na vrstico programske kode (LOPC) za to področje
--Področja:
r/m
... podprogram ali metoda
cls
... razred
mod
... modul
(Poročilo generirano z WinMetr-om v3.0.4)
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 53
5.5.3
Coverage report:
96% subroutine coverage was reached. On sobroutine was not called, because it is dead code used only during coding.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 54
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 55
6 DESIGN DOCUMENTATION
6.1 IDENTIFIKACIJA DOKUMENTA, POVEZAVA Z DRUGIMI DOKUMENTI
Document
Design documentation
Version
Date
Location
1
15.6.2005
File AmiralBatti.doc located in main project folder
Person in charge
Ercan
References to other documents
Internal standard CVVS 2-2000
User requirements
Project plan, V0.9
System specifications V 1.0
User manual V 1.0
Test cases 1.0
6.2 SUMMARY FROM SPECIFICATION
6.2.1
MSC
6.3 DESCRIPTION OF SYSTEM
Player 2
Player 1
A1 (SHOOT)
MISS or HIT
H8 (RESPONSE SHOOT)
MISS or HIT
.
.
.
.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 56
6.3.1
Files, final user will need
Final user needs following files for a program to work properly:
 connection.exe (executable program file)
6.3.2
Program start
Program is run from a command line or started through a shortcut. On command line user has to enter
program name (connection).
6.3.3
Files maintainer will need
Maintainer will need following files:
 project documentation (AmiralBatti.doc)
 connection.sln and connection.vcproj (files with project description for Visual Studio .NET
2003)
 connection.cpp (program source code)
 practicalsocket.cpp and practicalsocket.h (sockets library)
6.4
STRUCTURAL DIAGRAM
Program consists of single module (file) but many subroutines. This diagram shows subroutine
hieararchy.
0.0
Main
dfgdf
1.1
1.2
MarkShot
ClearBoard
2.1
ProcessShot
3.3
SendResponse
533582056
1.3
PlaceShip
2.2
ReceiveMove
3.4
CheckCoordinates
1.4
DisplayBoards
2.3
DisplayBoard
3.2
PlaceShipAt
Tiskano: dd/03/yyyy 14:09
Verzija:36
1.5
Connect
2.4
ReadString
3.5
DisplayHelp
3.1
TCPSocket
Library
str. 57
6.5
LIST OF MODULES AND DATA STREAMS
6.5.1
Modules (subroutines)
id
Name of subroutine/module
Source file
0.0
main
MarkShoot
ClearBoard
PlaceShip
DisplayBoards
DisplayBoardDelay
WaitForIncomingConecction
Connect
ReadMove
SendMove
ReceiveMove
ProcessShot
DisplayBoard
ReadString
CheckCoordinates
SendResponse
PracticalTCPSocket
MarkShot
ShipName
IsValidPosition
DisplayHelp
PlaceShipAt
CountElement
SetElement
ThereIsSpaceFor
GetElement
connection.cpp
6.5.2
Predeveloped
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
PracticalSocket.h
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
connection.cpp
Remarks
Yes
Data streams
mark
BS
HC
C
B
TS
533582056
Name of data stream
Board of shots
Type of hit coordintes
Coordinates
Board
Type of Ship
vrsta (vhod/izhod, kontrola,status)
Output
Input
Input
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 58
PB
CV
ROS
HN
SS
O
M
CN
6.6
Player Board
Coordinates Validity
Result Of Shot
Help Number
Size of Ship
Orientation
Marker
Computer Name
DESCRIPTION OF MODULES (SOBROUTINES)
6.6.1
Subroutine RecieveMove
This soubroutine reads move from network, decodes it and returns coordinates of shot.
6.6.2
Subroutine DisplayHelp
This subroutine writes the help texts. There are different texts according to the step of the program.
6.6.3
Subroutine ReadString
This subroutine reads strings from keyboard and if user enters ‘?’ , it shows online help.
6.6.4
Subroutine Connect
This subroutine connects two computer to each others by using PracticalTCPSocket.
6.6.5
Subroutine WaitingForIncomigConnection
This subroutine provides connection if the player chooses waiting in the connection step.
6.6.6
Subroutine CountElementsCfgsdfgsdfgsdfgsdfhd fghsdsdasa
This subroutine count the elements of the player board.
6.6.7
Subroutine ClearBoard
This subroutine cteates a clear board for shooting and placing ships.
6.6.8
Subroutine DisplayBoard
This subruotine makes the changes on the player board and shows the updated player board.
6.6.9
Subroutine DisplayBoards
This subruotine makes the changes on the player board and opponent board which cann be seen for
shooing points and shows the updated boards.
6.6.10 Subroutine DisplayBoardDebug
This subroutine display players board with numerical number. It was only used in developing program.
6.6.11 Subroutine ShipName
This subroutine names thie ships according to their sizes.
6.6.12 Subroutine CheckCoordinates
This subroutine checks the validity of the entered coordinates.
6.6.13 Subroutine GetElement
This subroutine returns element from specified coordinates of player board.
6.6.14 Subroutine SetElement
This subroutine sets element with specified marker to specified coordinates of player board. If
coordinates are not valid, it does nothing.
6.6.15 Subroutine ThereIsSpaceFor
This subroutine checks,if ship with specified dimensions can be placed to specified location. It does
not check if it is suitible (according to the rules) to place ship there.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 59
6.6.16 IsValidPosotin
This subroutine checks if specified location is valid for ship of specified size.
6.6.17 PlaceShip
This subroutine reads the location of single ship from keyboard and place this ship on playing board.
6.6.18 PlaceShipAt
This subroutine places ship on board. It places ship only if position is valid.
6.6.19 SendResponse
This subroutine sends response to other player (move accuracy).
6.6.20 ReceiveResponse
This subroutine receives response through network and returns it.
6.6.21 ReadMove
This subroutine provides shooting to the player and after that it reads the coordinates.
6.6.22 ProcessShot
This subroutine analyses the shot. According to the result of the shot (Ex: Water, hit, sunk), it gives
information about the shot.
6.6.23 MarkShot
This subroutine dedicates a characters according to the result of the shot.
6.6.24 SendMove
This subroutine sends move to the opponent.
6.6.25 ReceiveMove
This subroutine receives move through the network and returns it to numbers.
6.7
THE MOST IMPORTANT PARAMETERS AND DATA STRUCTURES
6.7.1
Moves
Moves consist of string containing single character (column) and a number (row).
move::=<character><number>
6.7.2
Data structure for players board
Data structure for players’s board and board of shots is called Board. It is two dimensional array of
10x10 characters. Each cell of array represents one cell of players’s board. Each ship is represented
with it’s own unique value. There are more values for water and so on…
6.7.3
Program start parameters
There is only one command line argument. This is »-t« (without quote marks). It turns on the test mode
that assists testing by displaying screen numbers and letting players play with lesser number of ships.
6.8




6.9
IDENTIFICATION OF TOOLS AND LIBRARIES USED
For source code development and compilation we used Visual Studio .NET 2003
For documentation we used…
For complexity metrics calculation WinMetr 3.06 was used.
For test coverage analysis we used Devpartner Studio 7.1.
COMPILATION PROCEDURE
For compilation of source code you have to open connection.sln solution in Visual Studio .NET 2003
and select Build Solution from Visual Studio’s Build menu. Afther the compilation has been done, you
will find executable code in Debug subdirectory of source code folder.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 60
BuildLog.htm file explaining compilation parameters is located in appendix.
6.10 DICTIONARY
Appendix: File BuildLog.htm
Build Log
6.10.1 ------- Build started: Project: connection, Configuration:
Debug|Win32 -------
Command Lines
Creating temporary file "c:\Documents and
Settings\branko\Desktop\AdmralBatti.v2\Debug\RSP000001.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MLd
/Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
".\PracticalSocket.cpp"
".\connection.cpp"
]
Creating command line "cl.exe @"c:\Documents and
Settings\branko\Desktop\AdmralBatti.v2\Debug\RSP000001.rsp" /nologo"
Creating temporary file "c:\Documents and
Settings\branko\Desktop\AdmralBatti.v2\Debug\RSP000002.rsp" with contents
[
/OUT:"Debug/connection.exe" /INCREMENTAL /NOLOGO /DEBUG
/PDB:"Debug/connection.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 wsock32.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\connection.obj"
".\Debug\PracticalSocket.obj"
]
Creating command line "link.exe @"c:\Documents and
Settings\branko\Desktop\AdmralBatti.v2\Debug\RSP000002.rsp""
Output Window
Compiling...
PracticalSocket.cpp
c:\Documents and
Settings\branko\Desktop\AdmralBatti.v2\PracticalSocket.cpp(95) : warning
C4244: '=' : conversion from 'SOCKET' to 'int', possible loss of data
c:\Documents and
Settings\branko\Desktop\AdmralBatti.v2\PracticalSocket.cpp(266) : warning
C4244: '=' : conversion from 'SOCKET' to 'int', possible loss of data
connection.cpp
Generating Code...
Linking...
Results
Build log was saved at "file://c:\Documents and
Settings\branko\Desktop\AdmralBatti.v2\Debug\BuildLog.htm"
connection - 0 error(s), 2 warning(s)
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 61
7
USER MANUAL
7.1
IDENTIFICATION OF DOCUMENT, REFERENCES TO OTHER DOCUMENTS
Dokument
Uporabniški priročnik
Version
datum
Location
2
17.6.2005
datoteka prirocnik_polinomi.doc v podmapi dokumentacija\Priročnik.
Person in Charge
ErkanErcan
References to other documents
Interni standard CVVS 2-2000
Naročnikove zahteve
Sistemske specifikacije V 1.0
Testni primeri 1.0
Instalation procedure
The way user should play:
The player just double click of the connection.exe icon. After that player will see the following screen:
Welcome to Battleship v2.0
You will place;
1 Aircraft Carier(5 fields)
2 battleship(4 fields for each)
3 destroyers(3 fields for each)
4 frigates(2 fields for each)
For playing game you will connect to an another player
Press 1 to connect,Press 2 to wait for a connection:
At this step, player should choose connection type. If he/she press 1, he/she connects to the other
computer himself/herself via entering IP address of the other player. For choosing this, player sholud
know the IP address of the other player. If he/she press 2, he/she waits for connection. In this choice,
for playing the game, any other player connect to this player.
After the connection was established, player see the following screen:
Connection with 127.0.0.1 has been established.
Please enter your Aircraft Carrier's coordinates:
.......... 1
.......... 2
.......... 3
.......... 4
.......... 5
.......... 6
.......... 7
.......... 8
.......... 9
.......... 10
ABCDEFGHIJ
Enter location of the topmnost or lefmost part of Aircraft Carrier:
At this step, player will begin to place his/her ships. For this, player enter the topmost or leftmost
coordinate of the ships. Player should enter the coordinates according to the game rules. If he/she
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 62
enters an invalid coordinate, program warns him/her and player enters a coordinate again. After
placing of each ship, program shows the player board. The ship-placed coordinates are denoted with
*.
After finishing placing ships, players are ready to play. The first shot is done by the player who
establishes the connection. That player shoots to the opponent board. For shooting, players should
enter the coordinates like placing the ships. After shooting, player learns the result on the screen. In
addition, player see the result on the opponent board, which is on his/her screen. For the hitted
coordinates are denoted with ‘+’. And if a shot sunks a ship, the result of that shot is denoted with ‘*’
and this result is denoted in written. If the player misses the shot, it is denoted with in written and that
coordinate is denoted with ‘:’.
By this way, players try to sunk the opponent’s ships. Who will shunk opponent’s ship earlier, that
player wins the game.
At the end of the game, players should press a button. After finishing the game, players can play the
game again following the same procedure.
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 63
8
SOURCE CODE – SAMPLE
8.1
IDENTIFICATION OF DOCUMENT, REFERENCES TO OTHER DOCUMENTS
Dokument
Izvorna koda – izpis
Version
Date
Location
1
17.6.2005
My source code is located in file connection.cpp
Person in charge
Erkan Ercan
References to other documents
8.1.1
Sample of source code
g_totalFleet = 2;
if (!g_testMode) {
g_totalFleet = 30;
PlaceShip(pb, 5, 1);
//place 5-element ship (aircraft carrier and mark
it with number 1)
PlaceShip(pb, 4, 2);
//place 4-element ship (Battleship and mark it with
number 1)
PlaceShip(pb, 4, 3);
//place 4-element ship (aircraft carrier and mark
it with number 1)
PlaceShip(pb, 3, 4);
//place 5-element ship (aircraft carrier and mark
it with number 1)
PlaceShip(pb, 3, 5);
//place 5-element ship (aircraft carrier and mark
it with number 1)
PlaceShip(pb, 3, 6);
//place 5-element ship (aircraft carrier and mark
it with number 1)
PlaceShip(pb, 2, 7);
//place 5-element ship (aircraft carrier and mark
it with number 1)
PlaceShip(pb, 2, 8);
//place 5-element ship (aircraft carrier and mark
it with number 1)
PlaceShip(pb, 2, 9);
//place 5-element ship (aircraft carrier and mark
it with number 1)
DisplayBoards(pb, ps);
}//if
PlaceShip(pb, 2, 10);
//place 5-element ship (aircraft carrier and mark it with
number 1)
DisplayBoards(pb, ps);
if (g_testMode)
printf("Test mode: this is screen #x\n");
printf("number of tons left: %d\n", CountElements(pb, 'O'));
printf("Okey! Your ships were putted smoothly\n");
printf("Now you are ready to shoot\n");
int moveNumber = 1;
int column, row;
do {
DisplayBoards(pb, ps);
printf("Move #%d\n", moveNumber);
if (g_playerStartsFirst || moveNumber != 1) {
//DisplayBoardDebug(pb);
ReadMove(column, row);
SendMove(column, row);
switch (ReceiveResponse()) {
case WATER:
printf("Your shot missed.\n");
MarkShot(ps, WATER, column, row);
break;
case HIT:
printf("Your shot hit a ship.\n");
MarkShot(ps, HIT, column, row);
break;
case SUNK:
printf("Your shot sunk a ship.\n");
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 64
MarkShot(ps, SUNK, column, row);
break;
default:
printf("Error in response. Terminating.\n");
exit(-1);
}//swaitch
DisplayBoards(pb, ps);
if (CountElements(ps, SHIP_HIT) + CountElements(ps, SHIP_SUNK) >=
g_totalFleet)
break;
}//if
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 65
9
EXECUTABLE CODE
9.1
IDENTIFICATION, CONNECTION WITH OTHER DOCUMENTS
Document
Executable code
Version
Date
location
2
17.6.2005
Executable is located in file connection.exe in folder version2\debug…
Person in charge
Erkan Ercan
References to other documents
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 66
10
DESCRIPTION OF ALL FILES
10.1 IDENTIFIKACIJA DOKUMENTA, POVEZAVA Z OSTALIMI DOKUMENTI
Dokument
Izvršilna koda
verzija
datum
lokacija
1
6.4.2002
datoteka Projekt_Polinomi.doc (oziroma .pdf) v podmapi »dokumentacija«
mape projekta
Odgovorna oseba
Miha Štukovnik
Reference na drugo dokumentacijo
Version 1.0 Files:
Directory of H:\AdmralBatti.v1\Debug
Connection.exe 148 KB 10.06.2005 13:22
Main executable file that enables to play the game.
BuildLog.htm
3KB
15.06.2005 13:04
Build log
Connection.obj 92B
10.06.2005 13:22
temporary file
PracticalSocket.obj
114KB
10.06.2005 13:22
temporary file
Connection.pdb 595KB
10.06.2005 13:22
temporary file
Vc70.pdb
164KB
10.06.2005 13:22
Temporary file
Vc70.idb
395KB
10.06.2005 13:22
Temporary file
Directory of H:\AdmralBatti.v1
PracticalSocket.h
12KB
21.03.2005 14:14
Source code of connection
Stdafx.h
1KB
31.5.2005 14:40
This file is used to build a precompiled header (PCH) file named connection.pch and a
precompiled types file named StdAfx.obj.
Connection.cpp 21KB
9.06.2005 14:45
This is the main application source file.
PracticalSocket.cpp
12KB
21.03.2005 14:10
This is the source code of socket library.
Stdafx.cpp
1KB
31.05.2005 14:40
This file is used to build a precompiled header (PCH) file named connection.pch and a
precompiled types file named StdAfx.obj.
Connection.sln 1KB
31.05.2005 14:40
Visual Studio solution file (this is file you have to open to open the project)
Connection.vcproj
4KB
1.06.2005 13:37
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
Connection.ncb 107KB
15.06.2005 13:50
Temporary file
Connection.suo 10KB
15.06.2005 13:50
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 67
Temporary file
Version 2.0 Files:
Directory of H:\AdmralBatti.v2\Debug
Connection.exe 148 KB 15.06.2005 13:04
Main executable file that enables to play the game.
BuildLog.htm
3KB
15.06.2005 13:04
Buil log
Connection.obj 93KB
15.06.2005 13:03
Temporary file
PracticalSocket.obj
114KB
15.06.2005 13:03
Temporary file
Connection.pdb 595KB
15.06.2005 13:04
Temporary file
Vc70.pdb
164KB
15.06.2005 13:03
Temporary file
Vc70.idb
395KB
15.06.2005 13:03
Temporary file
Directory of H:\AdmralBatti.v2
PracticalSocket.h
12KB
21.03.2005 14:14
Source code of connection
Stdafx.h
1KB
31.5.2005 14:40
This file is used to build a precompiled header (PCH) file named connection.pch and a
precompiled types file named StdAfx.obj.
Connection.cpp 22KB
13.06.2005 14:47
This is the main application source file.
PracticalSocket.cpp
12KB
21.03.2005 14:10
This is the source code of connection.
Stdafx.cpp
1KB
31.05.2005 14:40
This file is used to build a precompiled header (PCH) file named connection.pch and a
precompiled types file named StdAfx.obj.
Connection.sln 1KB
31.05.2005 14:40
Temporary file
Connection.vcproj
4KB
1.06.2005 13:37
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
Connection.ncb 115KB
15.06.2005 13:47
Temporary file
Connection.suo 9KB
15.06.2005 13:47
Temporary file
533582056
Tiskano: dd/03/yyyy 14:09
Verzija:36
str. 68
Download