Slides on case tools and program generation and third assignment

Download Report

Transcript Slides on case tools and program generation and third assignment

CASE Tools
• CASE = Computer-Aided Software Engineering
• A set of tools to (optimally) assist in each step of
software development.
• Typically integrated with a design data repository /
design data base
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
1
CASE-supported tasks
•
•
•
•
•
•
•
•
•
•
Business systems planning
Analysis & Design
Project management
Data definition
Program development (program generation)
Round-trip engineering
Prototyping
Simulation
Integration
Testing
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
2
Program generation
• Generating source code based on
- Functional specifications,
- Data specifications,
- Coding standards,
…
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
3
What do tools generate
• Templates for things like classes based on design
(e.g. generation of Java source files without
method implementation from a class diagram –
Fujaba).
• Forms and code to run them
• Source code to do routine tasks such as access
data in the database or in a form.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
4
CASE Data Repository / Data Base
•
•
•
•
The heart of the CASE tool
Will be used by different tools
Key to tool integration
Ideally provides concurrent access to design data
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
5
This year at our course
• We do not have commercial tools.
• Will be using a simple tool to generate Java classes
to access database data (”Dbswtool”)
• The tool needs descriptions of the database and it
will produce classes for retrieving and storing data
in the database (one class per relation).
• The tool can also be used to create classes to
execute queries and access their results.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
6
Motivation – 3rd assignment
• Choose one use case of the use cases in your
previous assignment.
• The use case should be such that it needs to make
a query to the database retrieving data from more
than one relation.
• You are to write and test a program, which
executes that use case.
• The program is to read the user input from a file
or terminal (no graphical user interface).
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
7
3rd assignment - continued
• As the use case is based on a straightforward user story, you
do not need to prepare for lots of different cases or execution
paths - if something goes wrong then just an error message
and stopping program execution will be enough.
• Write a test plan for your program. The test plan includes
information on
- what data you are going to use to test the program and
- what is the desired outcome of your program.
• Having written your program, test it. Create a test report of
your program.
• If you need to run the tests several times, then make a test
report for each individual execution.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
8
3rd assignment – data base
access
• Your program needs to access a database
• An example program will be provided for an
example database, which has some data in it.
• You are to use the Dbswtool (to be discussed in
this lecture) to access the data in the data base.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
9
3rd assignment documentation
•
•
•
•
How to install the program
How to use the program
How to remove the installation
How to maintain the program (class diagram,
short explanation,…?)
• How to test the program (test material, test plan,
instructions on how to run the test)
• Test reports
• Configuration files for Dbswtool
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
10
Dbswtool input
• Description of attributes
• Description of relations
• Description of queries
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
11
Dbswtool output
• For each relation/query, a ”Db” class containing
the data to access the database data.
• For each ”Db” class, a class extending the ”Db”
class – this is the class where the developer may
add his/her extra functionality.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
12
Db classes for relations
• Set and check data in the object using an input
string
• Access the data object in the Db class object
• Insert the object’s data in the database
• Modify the object’s data in the database
• Delete the object’s data from the database (based
on key attribute values)
• Retrieve the object’s data from the database
(based on key attribute values)
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
13
Db classes for queries
• A method for executing the predefined query with
possibly extra conditions (which is ”and”ed to the
end of the predefined condition).
• A method for stepping through the answer row by
row.
• Methods for retrieving the objects (for classes of
relations) in the current answer row.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
14
Why to use the tool?
• To keep the data definitions in data base and Java
classes synchronised.
• To reduce the number of errors.
• To automate a routine (and boring) part of
programming.
• To provide consistency in data management.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
15
Complications
• The Java classes for JDBC (SQL) data objects are
much different from each other in terms of the
services they give.
• The tool comes with a set of classes (SQL Data
Types) for wrapping the JDBC Java classes – this is
to provide uniform services and aid in program
generation.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
16
Getting started
• Download the stuff from
http://www.cs.uta.fi/~jyrki/se03/dbswtooldownload
• Read README.txt and follow the instructions
given.
• The data base will be provided by next week
(9.4.), when the demo is continued.
• Anyway, it is a good idea to try out the software
already before that, although you can not actually
execute the programs on the database.
15.1.2003
Software Engineering 2003
Jyrki Nummenmaa
17