DAAD project
“Joint Course on OOP using Java”
Humboldt University Berlin, University of Novi Sad, ‘Polytehnica’ University of Timisoara, University of Plovdiv, University of Belgrade
Author: Dušan Tošić Version: Sep. 21, 2006
Java case studies: game playing
Java case studies: game playing
A simple software development process from specification, to design,
implementation, and test
Points of this
Points of this
development
development
Java
Java
sample
sample
games
games
Create a simple gameby using Java
Point out the significance of requirements in software development Demonstrate the importance of software engineering
principles for simple Java programs development
Using Java API
For the lecturer
DAAD project „Joint Course on OOP using Java“ © 3
Course
Course
materials
materials
Lecture slides:
• about 20 slides • takes 1 lecture hour
Assignments:
• modify presented programs by adding new requirements
• make new games using presented examples
• Starting from presented examples, make a program that can be use in education.
For the lecturer
only
Goal: Develop the program
Goal: Develop the program
-
-
game:
game:
“
“
Memory test
Memory test
”
”
Task:Develop a program, to test the memory of the user!
Motive:
DAAD project „Joint Course on OOP using Java“ © 5
First option
First option
The Requirements are not specified on the beginning.
A pupil: ’I made a good Pascal program, we can use it!’
OK, we can try that program! (The same kind of program, as an application, we can easily make in Java!)
Text-based program:Pascal\MEM1.EXE
Facts concerning software
Facts concerning software
development phases
development phases
Most errors of software systems result from misunderstanding the problem to be solved.
Software development consists only of a small part of programming:
• Requirements analysis: 20 % • Design: 15 % • Implementation: 20 % • Test: 45 % This slide is taken from K. Bothe
DAAD project „Joint Course on OOP using Java“ © 7
Learning goals
Learning goals
The presented examples should stress out the importance of requirements in the process of software development.
Before implementing, the next step should be design of the application:
specify components and relations between them.
Starting with the implementation too early may lead to project’s failure.
Development
Development
process
process
of
of
“
“
Memory test
Memory test
“
“
Requirements analysis Design
DAAD project „Joint Course on OOP using Java“ © 9
1. Requirements analysis:
1. Requirements analysis:
“
“
Memory test
Memory test
”
”
Task:Develop a program based on GUI to test memory of the user. The user should have possibilities to open 2 fields and see data there. If 2 fields with same data are opened, the fields stay opened, otherwise closed. The goal is to open all fields.
Questions?
Open
Open
questions
questions
What kind of program should be developed (applet or application in Java)?
Whether use keyboard or mouse? How the field should look like?
What kind of data should be put into fields? How to measure the properties (capacity)
DAAD project „Joint Course on OOP using Java“ © 11
Requirements
Requirements
specification
specification
(1,2,3)
(1,2,3)
1. It is not so important; the applet is
acceptable.
2. The mouse should be use.
3. The table with fields can be designed in the following way:
A field
Requirements
Requirements
Specification
Specification
(4,5)
(4,5)
4. For the beginning, the kind of data is not so important (we can use: numbers, letters, signes, ...)5. The numbers of mouse-clicks can be use as the measure.
DAAD project „Joint Course on OOP using Java“ © 13
2. Requirements analysis:
2. Requirements analysis:
”
”Memory testMemory test””
The first 3 requirements can stay. Additional requirements:
Instead the numbers, some pictures can be used as data in fields. For example,
something like these:
Some other measures could be use for the capacity of memory. For example the time spent.
Some changes are made in design of table and two new implementations are created.
The third option:
Ann\SEMINARSKI_JEZICI\index.html SrdjanJeisel\memorija.html
DAAD project „Joint Course on OOP using Java“ © 15
3. Requirements analysis:
3. Requirements analysis:
“
“Memory testMemory test””
The previous requirements can be kept. The game may be improved by introducing
the different levels.
As the measure, the number of tests can be used (in fact, this measure is used in the second option).
The fourth option:
Dusan Radojevic\Memory.html
Development
Development
process
process
of
of
“
“
Memory test
Memory test
“
“
Requirements analysis Design
DAAD project „Joint Course on OOP using Java“ © 17
Notes about design
Notes about design
SW architecture description languages: UML- industry standard. So, the UML is used in this process.
The finding of classes and relations
between them is the most important task. (In our cases different classes are used in different examples.)
Our task is not so complicated (it is a simple student’s assignment!) Thus, the structure of our program(s) should not be complicated.
We will skip the details about design-phase.
Development
Development
process
process
of
of
“
“
Memory test
Memory test
“
“
Requirements analysis Design
DAAD project „Joint Course on OOP using Java“ © 19
Note about implementation
Note about implementation
The different implementations are presented here.
The programming language Java is used for the GUI-implementation.
If requirements are well defined and design phase is completed, the implementation phase is simple.
The details related to the implementation will be skipped. (The source code is available.)
Testing
Testing
This is the most time consuming phase. After the first version of programs, different
corrections are made.
On the beginning, the testing is made without pictures. Later, the pictures are included.
The most interesting cases are examined but the errors are possible.
DAAD project „Joint Course on OOP using Java“ © 21
Critics of the implementations
Critics of the implementations
The on-line help is usually absent. The applets are not scaleable.
Better structure of classes is necessary. Program should be more secure (the
private variable should be used). . . .