case tools lab first 3 exercise
DESCRIPTION
case toos labTRANSCRIPT
Know more @ www.vidyarthiplus.com Powered by WR1334
Aim:
To study the UML Diagrams.
Description:
The heart of object-oriented problem solving is the construction of a model.
The model abstracts the essential details of the underlying problem from its
usually complicated real world. Several modeling tools are wrapped under the
heading of the UML, which stands for Unified Modeling Language. The
purpose of this course is to import knowledge about UML.
At the center of the UML are its nine kinds of modeling diagrams, which we
describe here
• USE CASE DIAGRAM
• CLASS DIAGRAM
• SEQUENCE DIAGRAM
• COLLOBORATION DIAGRAM
• ACTIVITY DIAGRAM
• COMPONENT DIAGRAM
WHY UML IS IMPORTANT?
From the construction point of view, the architects design buildings. Builders
use the design to create buildings. The more complicated about building, the
more critical the communication between architect and builder. Blueprints are
the standard graphical language that both architects and builders must learn as
part of their trade.
Ex. No.: 1
STUDY OF UML DIAGRAMS
Know more @ www.vidyarthiplus.com Powered by WR1334
Writing software is not unlike constructing a building. The more complicated
the underlying system, the more critical the communication among everyone
involved in creating and deploying the software. In the past decade, the UML
has emerged as the software blueprint language for analysis, designers and
programmers alike.
It is now part of the software trade. The UML gives everyone from business
analyst to designer to programmer, a common vocabulary to talk about software
design. The UML is applicable to object oriented problem solving. Anyone
interested in learning UML must be familiar with the underlying tenet of object
oriented problem solving it all begins with the construction of a model. A
model is an abstraction of the underlying problem. The domain is the actual
word from which the problem comes.
Models consist of objects that interact by sending each other message. Think of
an object as alive. Objects have things they know (attributes) and things they
can do (behaviors). The values of an objects attributes determine its state.
Classes are the blueprints for objects. A class wraps attributes and behaviors
into a single distinct entity. Objects are instances of classes.
CLASS DIAGRAMS:
Start program rational software rational rose enterprise edition use case
view new class diagram.
A class diagrams gives an overview of a system by showing its classes and the
relationships among them. Class diagrams are static- they display what interacts
but not what happens when they do interact.
UML class notation is a rectangle divided into three parts: class name, attributes
and operations. Relationships between classes are the connecting links.
Our class diagram has three types of notations:
• ASSOCIATION- A relationship between instances of the two classes if an
instance of one class must know about the other in order to perform its
work. In a diagram, an association is a link connecting two classes.
• AGGREGATION- An association in which one class belongs to the part
containing the whole.
Know more @ www.vidyarthiplus.com Powered by WR1334
• GENERALIZATION- An inheritance link indicating one class is a super
class of the other. A generalization has a triangle pointing to the super class.
An association has two ends. An end may have a roll name to clarify the
nature of the association.
A navigability arrow on an association shows which direction the association
can be traversed or queried. An order detail may be queried about its item, but
not the other way around. The arrow also lets us know who owns the
association implementation: in this case, order detail has an item. Association
with no navigability arrows is bi-directional.
The multiplicity of an association end is the number of possible instances of
the class associated with a single instance of the other end. Multiplicities are
single numbers or ranges of numbers.
USE CASE DIAGRAM:
Start program rational software rational rose enterprise edition use case
view new use case diagram.
Use case diagrams describe what a system does from the standpoint of an
external observer. The emphasis is on what a system does rather than how.
Use case diagrams are closely connected to scenarios. A scenario is an example
of what happens when someone interacts with the system.
Know more @ www.vidyarthiplus.com Powered by WR1334
Use case is a summary of scenarios for a single task or goal. An actor is who or
what initiates the events involved in that task. Actors are simply roles that
people or objects play. The connection between actor and use case is a
communication association (or communication for short).
Actors are stick figures. Use cases are ovals. Communications are lines that link
actors to use cases.
A use case diagram is a collection of actors, use cases, and their
communications. A single use case can have multiple actors. Use case diagrams
are helpful in three areas.
• Determining features (requirements): New use cases often generate new
requirements as the system is analyzed and the design takes place.
• Communicating with clients: Their notational simplicity makes use case
diagram a good way for developers to communicate with clients.
• Generating test cases: The collection of scenarios for a use case may
suggest a suite of test cases for those scenarios.
Login
Add New Members
Add New Books
USER
ADMIN
PRINTER Book Details
Know more @ www.vidyarthiplus.com Powered by WR1334
SEQUENCE DIAGRAM:
Start program rational software rational rose enterprise edition use case
view new sequence diagram.
Class and object diagrams are static model views. Interaction diagrams
are dynamic. They describe how objects collaborate.
A sequence diagram is an interaction diagram that details how operations are
carried out, what messages are sent and when. Sequence diagrams are organized
according to time. The time progresses as we go down the page. The objects
involved in the operation are listed from left to right according to when they
take part in the message sequence.
Each vertical dotted line is a lifeline, representing the time that an object exist.
Each arrow is a message call. An arrow goes from the sender to the top of the
activation bar of the message on the receiver’s lifeline. The activation bar
represents the duration of execution of the message.
System Database
Admin
Ask book details
Give the details
Check book details
Book not present
Add this book
Store details
Know more @ www.vidyarthiplus.com Powered by WR1334
COLLOBORATIION DIAGRAM :
Collaboration diagrams are also interaction diagrams. They convey the same
information as sequence diagrams, but they focus on object roles instead of the
times that messages are sent. In a sequence diagram, object roles are the vertices
and messages are the connecting links.
Collaboration diagram consists of the numbered sequences of actions involved
in a use case. The numbering may be simple numbering system or decimal
numbering system. The collaboration diagram is very useful for large
applications as they include only the order of sequence of actions happening in
use cases.
ACTIVITY DIAGRAM:
Start program rational software rational rose enterprise edition use case
view new activity diagram.
Student
Librarian
Databas e
1: Ask details 4: Display successful message
2: Give member id
3: Validate member id
Know more @ www.vidyarthiplus.com Powered by WR1334
An Activity diagram is essentially a fancy flow chart. Activity diagrams and
state chart diagram focuses attention on an object undergoing a process, an
activity diagram focuses on the flow of activities involved in a single process.
The activity diagram shows how the activities are involved in a single process.
The activity diagram shows how the activities depend on one another.
For our example, we used the following process.
“Login of the User into the Library through a Database”
The three involved classes (people, etc) of the activity are User, Database and
Library.
The process begins at the black start circle at the top and ends at the concentric
white/black
Know more @ www.vidyarthiplus.com Powered by WR1334
COMPONENT DIAGRAM:
Start program rational software rational rose enterprise edition use case
view new component view.
A Component is a code module. Component diagrams are physical analogs of
class diagram.
stop circles at the bottom. The activities are rounded rectangles .
system requires username & password
customer enters username & password
system validation username & password
system displays successful messages
system displays unsuccessful messages
yes
no
Know more @ www.vidyarthiplus.com Powered by WR1334
DEPLOYMENT DIAGRAM:
Start program rational software rational rose enterprise edition use case
view new deployment view.
Deployment diagrams show the physical configurations of software and
hardware. The deployment diagrams are necessary in order to show the physical
relationship with other classes as a whole.
CONCLUSION:
Thus the UML description and diagram were designed and studied.
Library Management System
Counter Pc
Know more @ www.vidyarthiplus.com Powered by WR1334
Ex. No.: 2 ATM SYSTEM
PROBLEM STATEMENT:
To design an ATM system that will enable customers to deposit amount
into account , transfer funds from one account to another, to change PIN number
of the customer with the permission of bank officer, withdraw money from
his/her account, view the account details, make payments through credit system.
The system must be capable of handling customer access to accounts and
maintain integrity of the database. The system must also be robust in handling
multiple transactions concurrently. The system must also be consistent in the
transfer of amount from one account to another. The system should notice all
error flows and messages clearly stating detailed explanation of the error that
occurs. The system must be able to recover if system failure occurs. The user
interface components should be self explanatory and user friendly. A separate
help system should also accompany the system.
PROBLEM REQUIREMENTS:
1. Basic Requirements:
1) Validity of the card.
2) Balance in the account.
3) Verification of password and PIN id number.
4) Invalid PIN id and Password.
5) Withdrawal of amount exceeding maximum balance.
Know more @ www.vidyarthiplus.com Powered by WR1334
6) Withdrawal of amount affecting minimum balance.
2. Functional Requirements:
1) Details of transaction.
2) Amount to be withdrawn.
3) Cross withdrawal limit.
3. Non-Functional Requirements:
1) Failure of ATM network due to power cut.
2) Card validity.
MODELING:
UML DIAGRAMS:
Use case Diagram:
Figure1.Usecase diagram for ATM system
Class Diagram:
Deposit
Overdraft
Bank Client
Withdraw
Transacton History Invalid PIN
Approval Process
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure2.Class diagram for deposit
Figure3. class diagram for invalid pin
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure4.Class diagram for withdraw
Sequence Diagram:
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure5.Sequence diagram for deposit
Figure6.sequence diagram for invalid pin
ClientClient ATM MachineATM Machine AccountAccount
Inser Card
Request PIN
Enter PIN
Verify PIN
Validate PIN
Request Amount
Enter Amount
Request Money
Insert Money
Process Transaction
Validate Transaction
Show Balance
ClientClient ATM MachineATM Machine AccountAccount
Insert Card
Request PIN
Enter PIN
Verify PIN
Valid/Invalid PIN
Display Message
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure7.Sequence diagram for with draw
Collaboration Diagram:
Figure8. Collaboration diagram for deposit
ClientClient ATM MachineATM Machine AccountAccount
Insert Card
Request PIN
Enter PIN
Verify PIN
Validate PIN
Request Amount
Enter Amount
Process Transaction
Validate Transaction
Gives out cash
Take cash
Client ATM
Machine
Account
1: Inser Card3: Enter PIN
7: Enter Amount9: Insert Money
2: Request PIN6: Request Amount8: Request Money12: Show Balance
4: Verify PIN10: Process Transaction5: Validate PIN
11: Validate Transaction
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure9. Collaboration diagram for invalid pin
Figure10. Collaboration diagram for withdraw
Client ATM
Machine
Account
1: Insert Card3: Enter PIN
2: Request PIN6: Display Message
4: Verify PIN5: Valid/Invalid PIN
Client ATM
Machine
Account
1: Insert Card3: Enter PIN
7: Enter Amount11: Take cash
2: Request PIN6: Request Amount10: Gives out cash
4: Verify PIN8: Process Transaction5: Validate PIN
9: Validate Transaction
Know more @ www.vidyarthiplus.com Powered by WR1334
Activity Diagram:
Figure11.Activity diagram for deposit
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure12. Activity diagram for invalid pin
Figure13. Activity diagram for withdraw
Know more @ www.vidyarthiplus.com Powered by WR1334
Component Diagram:
Figure14.Component diagram for atm system
Deployment Diagram:
Figure15.Deployment diagram for ATM system
atm system application
counterpc
Know more @ www.vidyarthiplus.com Powered by WR1334
SOFTWARE DEVELOPMENT:
CODE IMPLEMENTATION:
Dim rs As New ADODB.Recordset
Dim con As New ADODB.Connection
Private Sub Command1_Click()
If Text2.Text = "" And Text3.Text = "" And Text4.Text = "" Then
MsgBox "Enter all the fields correctly"
Else
a = Text2.Text
b = Text3.Text
c = 0
Do Until rs.EOF
c = c + 1
rs.MoveNext
Loop
rs.MoveFirst
For i = 1 To c
If a = rs.Fields(1) And b = rs.Fields(2) Then
MsgBox "You can now deposit or withdraw the amount you entered"
Exit Sub
Else
rs.MoveNext
End If
Next i
If rs.EOF Then
MsgBox "WRONG DATAS ENTERED!!!!!!!!!!!!RE TYPE"
End If
End If
End Sub
Private Sub Command3_Click()
a = Text2.Text
b = 0
Do Until rs.EOF
b = b + 1
rs.MoveNext
Loop
rs.MoveFirst
Know more @ www.vidyarthiplus.com Powered by WR1334
For i = 1 To b
If a = rs.Fields(1) Then
MsgBox "CASH IS WITHDRAWN SUCCESSFULLY--------ATM
MANAGAER"
Else
rs.MoveNext
End If
Next i
rs.Update
Text5.Text = rs.Fields(3)
End Sub
Private Sub Command4_Click()
a = Text2.Text
b = 0
Do Until rs.EOF
b = b + 1
rs.MoveNext
Loop
rs.MoveFirst
For i = 1 To b
If a = rs.Fields(1) Then
MsgBox "CASH IS DEPOSITED SUCESSSFULLY --------ATM
MANAGAER"
Else
rs.MoveNext
End If
Next i
rs.Fields(3) = Val(rs.Fields(3)) + Text4.Text
rs.Update
Text5.Text = rs.Fields(3)
End Sub
Private Sub Command5_Click()
a = Text2.Text
b = 0
Do Until rs.EOF
b = b + 1
rs.MoveNext
Know more @ www.vidyarthiplus.com Powered by WR1334
Loop
rs.MoveFirst
For i = 1 To b
If a = rs.Fields(1) Then
Label1.Caption = "You are now enjoying banking in a better way" + "Bye" +
rs.Fields(0)
Else
rs.MoveNext
End If
Next i
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Form_Load()
con.Open "dsn=form1"
rs.Open "select * from amount", con, adOpenDynamic, adLockOptimistic
End Sub
SCREEN SHOTS:
FORM 1
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 16. Details Form
FORM 2
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 17. Deposit Successful
Know more @ www.vidyarthiplus.com Powered by WR1334
FORM 3
Figure 18. Withdraw Successful
Know more @ www.vidyarthiplus.com Powered by WR1334
FORM 4
Figure 19. Report Form
SOFTWARE TESTING:
TEST CASE REPORT:
TEST CASE NAME: Password Availability
OBJECTIVE: Usability Test
TEST CASES
SCENARIO 1: Password: ****
EXPECTED OUTPUT: Error Message
TEST RESULT
ACTUAL OUTPUT: Invalid Password
Know more @ www.vidyarthiplus.com Powered by WR1334
CONCLUSION:
Thus the application for an ATM System is developed using rational rose
and implemented using visual basic. The main aspects that are behind this
application are that they enabled us to bring out the new ideas that sustained
within us for many days. This application will be a successful one because this
application offers the users to deposit or withdraw their amount in a very easy
manner. Thus saving our time.
Know more @ www.vidyarthiplus.com Powered by WR1334
Ex. No.: 3 LIBRARY MANAGEMENT SYSTEM
PROBLEM STATEMENT:
A Library must keep record of information about borrower and status of
lending books. And the library is not only for tracking information about
books it must keep tracking about user who must take the books and the
admin who keeps tracks about the borrower record and status of the library.
Library management system require to easy update of user records
who must use the library and member details. In this Automation system
each user will be provided with a specific id and for administrator.
A Library System must contains an authentication system for different
levels of accessing the specific information . Administrator should have
access to the user database and administrator only can do any changes like
adding new books, deleting a book from database , updating the information
like maintaining the user account , maintains borrower details etc. . .
When entered into the new book database the main database should
automatically updated with the existing books database and also new book
database. This Automation system for the purpose of automatically updating
and easy to maintain all the information about library . A separate record
for the new user should be maintained and when a new member wants a
new login it must get the details about the user and updating automatically .
Know more @ www.vidyarthiplus.com Powered by WR1334
In this system have the details about member login , administrator
login ,borrower information , adding new member , adding new book,
updating book details deleting a account , deleting a book from record etc…
PROBLEM REQUIREMENTS:
1. Basic Requirements:
1) Validity of the membership.
2) Availability of library card.
3) Availability of book. or article.
2. Functional Requirements:
1) Member of the library.
2) Return of book or article.
3) Renewal of book or article.
4) Loss of book or article.
5) Loss of member card.
6) Enquiry of availability.
7) Reservation of book.
3. Non-Functional Requirements:
1) System should be simple to operate without any formal training.
2) System must be reused and protected from library member and
other unauthorized users.
MODELING:
UML DIAGRAMS:
Use case Diagram:
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 1.Use case diagram for Library Automation System
Class Diagram:
Login
Add New Members
Add New Books
USER
ADMIN
PRINTERBook Details
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 2.Class diagram for Login
Figure 3.Class diagram for Add Member
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 4.Class diagram for Add Book
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 5. Class diagram for Book Details
Activity Diagram:
Figure 6.Activity diagram for Login
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 7.Activity diagram for Add New Member
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 8.Activity diagram for Add New Book
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure 9.Activity diagram for Book Details
Component Diagram:
Figure10: Component Diagram for Library Management System
Deployment Diagram:
library management
system
update
front
panel
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure11: Component Diagram for Library Management System
SOFTWARE DEVELOPMENT:
CODE IMPLEMENTATION:
Form 1:
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
a = Text1.Text
b = Text2.Text
For i = 1 To 100
If a = rs.Fields(0) And b = rs.Fields(1) Then
MsgBox "YOU ARE LOGGED IN SUCCESSFULLY"
Form1.Show
Text1.Text = ""
Text2.Text = ""
library management2
counter pc2
Know more @ www.vidyarthiplus.com Powered by WR1334
Form2.Visible = False
Exit Sub
Else
rs.MoveNext
End If
Next i
MsgBox "Wrong Username or Password.....Try Again"
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Form_Load()
con.Open "dsn=c1"
rs.Open "select * from Login", con, adOpenDynamic, adLockOptimistic
End Sub
Form 2:
Private Sub Command1_Click()
Form3.Show
Form1.Visible = False
End Sub
Private Sub Command2_Click()
Form4.Show
Form1.Visible = False
End Sub
Private Sub Command3_Click()
Form5.Show
Form1.Visible = False
End Sub
Form3:
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
Know more @ www.vidyarthiplus.com Powered by WR1334
rs.AddNew
If rs.EditMode = adEditAdd Then
rs("MemberCode") = Text1.Text
rs("MemberName") = Text2.Text
rs("Address") = Text3.Text
rs("MemberFee") = Text4.Text
rs("RenewelDate") = Text5.Text
End If
rs.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
MsgBox "Member Added Successfully"
Form1.Show
Form3.Visible = False
End Sub
Private Sub Command2_Click()
rs.Delete
If rs.EditMode = adEditAdd Then
rs("MemberCode") = Text1.Text
rs("MemberName") = Text2.Text
rs("Address") = Text3.Text
rs("MemberFee") = Text4.Text
rs("RenewelDate") = Text5.Text
End If
rs.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
MsgBox "Member deleted Successfully"
Form1.Show
Form3.Visible = False
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Know more @ www.vidyarthiplus.com Powered by WR1334
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Form1.Show
End Sub
Private Sub Form_Load()
con.Open "dsn=c1"
rs.Open "select * from Login", con, adOpenDynamic, adLockOptimistic
End Sub
Form4:
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
rs.AddNew
If rs.EditMode = adEditAdd Then
rs("BookCode") = Text1.Text
rs("BookName") = Text2.Text
rs("Author") = Text3.Text
rs("Publisher") = Text4.Text
rs("Stock") = Text5.Text
rs("RackNo") = Text6.Text
End If
rs.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
MsgBox "Book Added Successfully"
Form1.Show
Form4.Visible = False
End Sub
Private Sub Command2_Click()
rs.Delete
If rs.EditMode = adEditAdd Then
rs("BookCode") = Text1.Text
Know more @ www.vidyarthiplus.com Powered by WR1334
rs("BookName") = Text2.Text
rs("Author") = Text3.Text
rs("Publisher") = Text4.Text
rs("Stock") = Text5.Text
rs("RackNo") = Text6.Text
End If
rs.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
MsgBox "Book Deleted Successfully"
Form1.Show
Form4.Visible = False
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Form_Load()
con.Open "dsn=c1"
rs.Open "select * from Login", con, adOpenDynamic, adLockOptimistic
End Sub
SCREEN SHOTS
FORM 1
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure12: Login Form
FORM 2
Figure13: Option Form
FORM 3
Know more @ www.vidyarthiplus.com Powered by WR1334
Figure14: Member Details Form
FORM 4
Figure15: Book Details Form
Know more @ www.vidyarthiplus.com Powered by WR1334
FORM 5
Figure 16: Member Added Successfully
FORM 6
Figure17: Book Added Successfully
Know more @ www.vidyarthiplus.com Powered by WR1334
SOFTWARE TESTING:
TEST REPORT:
TEST CASE: Book available.
OBJECTIVE: Usability test.
TEST CASES:
SCENARIO: Books available.
SAMPLE INPUT: OS
EXPECTED OUTPUT: Error message.
TEST RESULT:
ACTUAL OUTPUT: book not available
Know more @ www.vidyarthiplus.com Powered by WR1334
CONCLUSION:
Thus the application for a Library automation system is developed using
rational rose and implemented using visual basic. Thus the application will be
user friendly since we provide all the necessary functions needed for the library
automation system. This application can implement for the larger organizations
without any difficulties.