cscbank.info · Web viewPractical No 8: Draw a state chart diagram for accessing a Word Document....
Transcript of cscbank.info · Web viewPractical No 8: Draw a state chart diagram for accessing a Word Document....
LABORATORY MANUALSoftware Engineering (INFS-334)
Level -8
Offered in CS | IS | CNET Departments
College of Computer Science
&
Information Systems
Jazan University, Jazan, KSA.
Second Semester -2017
PREFACE
This document is prepared to serve as a laboratory manual for Software Engineering Course that is a major course offered in Computer Science, Information Systems and Computer Engineering & Network Programs. Software Engineering is a college required course and it helps a lot to students in their Graduation Projects. It gives broad coverage of most important terminology and concepts in the software engineering, basic understanding of software life cycle, software processes, requirements engineering and Unified Modeling Language. Experiments given in this manual help the students to apply the theoretical knowledge they obtain in Lectures. Students can design, build, and verify using Rational Rose/Agro UML/Smart Draw/ Microsoft Visio. This set of experiments cover relevant topics prescribed in the syllabus and are designed to reinforce the theoretical concepts taught in the classroom with practical experience in the lab. By the end of the course, students are expected to have a good understanding of software engineering and implementation with unified modeling languages. The Unified Modeling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system. The UML gives you a standard way to write a system's blueprints, covering conceptual things, such as business processes and system functions, as well as concrete things, such as classes written in a specific programming language, database schemas, and reusable software components.
[1]. Software Engineering by Pressman[2]. Software Engineering by Ian Somerville[3]. Object-Oriented Systems Analysis and Design (2nd Edition) Authors - George, Batra, Valacich and Hoffer Publisher - Pearson/Prentice Hall
2
List of Experiments1. Practical No 1: Draw a use case Diagram for Banking Operations.
2. Practical No 2: Draw a use case Diagram for Online Air Ticket Booking.
3. Practical No 3: Draw a class diagram highlighting the use of Generalization for the example of Geometrical Shapes.
4. Practical No 4: Draw a class diagram highlighting the use of Aggregation & Composition and Generalization for the example of Building Structure.
5. Practical No 5: Object Diagram representing Customer and his/her order.
6. Practical No 6: Sequence Diagram for a customer to order a food at a restaurant.
7. Practical No 7: Draw a Sequence Diagram for a student to apply exam retake in the college.
8. Practical No 8: Draw a state chart diagram for accessing a Word Document
9. Practical No 9: Draw an Activity Diagram for ATM operations.
10. Practical No 10: Draw collaboration Diagram to print file on server printer
11. Practical No 11: Draw a component Diagram for Student Registration
12. Practical No 12: Draw DFD Level 0, 1 and 2 for food ordering system.
13. Practical No 13: Draw DFD Level 0, 1 and 2 for online learning website.
HOW TO DRAW DIAGRAM IN RATIONAL ROSE / ARGO UML3
1: UML Diagrams Interfaces ---->Choose the interface of Diagram you want to draw.
2: UML Notations according to selected UML Diagram in toolbar 1
3: Draw Area / Work Area -----> Select the objects from toolbar 2 and drop here.
4
USE CASE DIAGRAM
Use-Case: Use case is represented as an eclipse with a name inside it. Use cases are used to represent actions / operations / tasks of the system.
Use Case
Actor:An actor can be defined as some internal or external entity that interacts with the system.
Actor
Association: is a link between the actor and use cases to show the interaction and it Simple Association or Uni-Association as follows:
Association Uni-Association
Practical No 1: Draw a use case Diagram for Banking Operations.
5
Deposit Money
Change Pin
Transfer Money
New Account
Withdraw Money
view balanceCustomer
Credit Card
Practical No 2: Draw a use case Diagram for Online Air Ticket Booking.
Exercise:
1. Draw use case diagram of Student’s Interface @ JU Academic System.2. Draw a use case diagram for network users to store and retrieve files from a shared
device. (Eg. Google Drive, DropBox)3. Draw use case diagram for an online library system. (Eg. Saudi Digital Library SDL) 4. Draw use case diagram for an ATM Systems with the help of actors (Administrator,
Customer, and Bank) show the following functions appropriately.Login, System Maintenance, Check Balance, Transaction, Withdraw Funds, Repairing, Bad Pin, Shutdown, Print Receipt, Deposit Funds.
5. Draw use case diagram for a Hotel Management Systems with the help of actors (Administrator, Customer, and Reception) show the following functions appropriately.
User Login, Admin Login, Cancel Booking, Manage & Update Database, Check in time, Make payment, Check out tine, Make Booking, View Profile & Gallery, Check Room Availability, Ask for Room & Check Booking.
6
CLASS DIAGRAM
Class diagrams are used when developing an object-oriented system to show the components in a system and the associations between them.
Class diagram is an illustration of the relationships and source code dependencies among classes in the Unified Modeling Language (UML).
Class Diagram Notations: UML class is represented by the diagram shown below that is divided into three sections.
First section is used to name the class. Second section is used to show the attributes / member variable of the class. Third section is used to describe the operations performed by the class.
Types of Relationship between the classes:
Difference between Aggregation and Composition: (Has-a Relationship)
In aggregation contained class exist even if main class deleted. Eg: Car has Engine, If car is broken still engine exist and can be used in another car.
In composition contained class live or die on the basis of main class. Eg: Folder has file, If you delete a folder all files also deleted.
Practical No 3: Draw a class diagram highlighting the use of Generalization for the example of Geometrical Shapes.
7
Class Students {private:int ID;char * Name;public:void Registration(); };
1. Shows Generalization between two classes to maintain parent-child relationship. (is-a relation)
2. Shows Aggregation between two classes to maintain containership. (has-a relation)
3. Shows Composition between two classes to maintain containership. (has-a relation)
4. Shows Association between two classes to maintain a simple connectivity.
Interpretation:
Generalization is used in UML class diagrams to deal with most powerful concept of object orientation that is Inheritance. Generalization is drawn between two classes to show Parent-Child relation. In General we can say using Generalization nomenclature is explained.
Practical No 4: Draw a class diagram highlighting the use of Aggregation & Composition and Generalization for the example of Building Structure.
8
Interpretation:
In above class diagram Aggregation is applied between building and Furniture. “Building has furniture” but we know by demolishing the Building furniture do not lost that’s why aggregation is used. Whereas Composition is applied between Building and Rooms. “Building has Rooms” but we know by demolishing the building rooms are also demolished that’s why composition is used. Generalization is used in four places to show the types of Furniture and Rooms.
Exercise:
1. Draw Class Diagram for Toyota Company. Company deals with two types of Vehicles () that are Cars and Jeeps. Vehicles have Spare Parts (المركبات غيار ,like Engine (قطع
9
Breaks and Lights. Technicians (الفنيين) fix the spare parts whereas Engineer Inspect ( .the Vehicles (فحص
2. Draw a class diagram for a Hotel. Rooms in the hotel are of two types Single-Bed or Double-Bed. Each Room has facilities like AC, Refrigerator, LCD and Iron. Customer has to pay the bill according to Room type to the Cashier.
3. Draw a class diagram for a library management system. Library has multiple types of books like course books and general reading books. Course Books are issued to students only whereas general reading books can be issued to any member reader.
OBJECT DIAGRAM
Object diagrams represent an instance of a class diagram
10
Object Notation: The object is represented in the same way as the class. The only difference is the name which is underlined as shown below:
Customer : Customer Info- Customer Name- Customer Order
Note: In Rational Rose, you cannot find specifically object diagram. Hence you can show objects on both collaboration and sequence diagrams.
For a more typical object diagram, you should create a collaboration diagram. Dragging and dropping classes onto the diagram surface will create objects.
Practical No 5: Draw an Object Diagram representing Customer and his/her order.
Customer : Customer
- id=C001- Name=Ali- Phone=123456
Order : Order1- Amount=500- order-no=001
Order : Order2- Amount=478- Order-no=002
Order : Order3- Amount=300- Order-no=003
SEQUENCE DIAGRAM
A Sequence diagram is an interaction diagram that shows how processes operate with one another and in what order. It is a construct of a Message Sequence Chart.
11
The represents when the object is destroyed
Practical No 6: Sequence Diagram for a customer to order a food at a restaurant.
Customer Waiter Chef
Order Food Places the Order
Food is readyServes the food
Cashier
Pay Bill
Practical No 7: Draw a Sequence Diagram for a student to apply exam retake in the college.
12
Destruction Object
Object
Messages
Exercise:
1. Draw a sequence diagram for a customer for online shopping through mobile application. 2. Draw a sequence diagram for a student to loan a book from college library. 3. Draw a sequence diagram for a student to register final graduation project, where Project
Committee and supervisor are the other classifiers in this domain.
STATECHART DIAGRAM
13
The name of the diagram itself clarifies the purpose of the diagram and other details. It describes different states of a component in a system. The states are specific to a component/object of a system.
State diagrams require that the system described is composed of a finite number of states.
Practical No 8: Draw a state chart diagram for accessing a Word Document
Open Word Document
Edit Word Document
Save Word Document
ACTIVITY DIAGRAM
14
Activity diagrams describe the workflow behavior of a system. Activity diagrams are similar to state diagrams because activities are the state of doing something. The diagrams describe the state of activities by showing the sequence of activities performed.
Practical No 9: Draw an Activity Diagram for ATM operations.
Insert The Card
Enter Pin Number
Select the Type of Transaction
Check if pin is Correct
Yes
Perform the Transaction
Want to perform Any other Transaction
Take the Card
No
Exercise:1. Draw Activitydiagram for Library management systems with the help of following
functions in appropriate manner.Book not available, Inquiries, Issue book, Validate member, Add member book and issue details, Checking availability, Update book status, Number books issued to member.
2. Draw Activitydiagramshowing an Online Bank Systems. Illustrate checking balance sheet, and taking printout of balance sheet on your wish. Show the following activity in appropriate manner.Exit, Login Id & Password, Print balance sheet, Select option, View balance sheet.
Collaboration Diagram
15
A collaboration diagram, also called a communication diagram or interaction diagram, is an
illustration of the relationships and interactions among software objects in the Unified Modeling
Language (UML).
Practical No 10: Draw collaboration Diagram to print file on server printer
: Person
Computer : Computer
Printer Server : Printer Server
Print : Print Queue :
Queue
1: Print(File)
2: Print(File)
[Printer Free]
3: Print(File)
[Printer Busy] 4: Print(File)
16
Component Diagram
In the Unified Modeling Language, a component diagram depicts how components are wired together to form larger components and or software systems.
Practical No 11: Draw a component Diagram for Student Registration
Student
Admin
Book Bank
Student Apllies for admission
Admin does the registeration
Books can be Obatained from book bank after
Student Affairs
Issues Id Card
Data flow diagram
17
1. Introduction:
System development life cycle (SDLC) is an essential process uses during the development of
any system. SDLC consists of four main phases. They are planning, analysis, design and
implementation. During analysis phase, context diagram and data flow diagrams are used to
produce the process model of a system. Process model can be used to represent the processes or
activities that are performed in a system and show the way of data moves among the processes.
In order to diagram a process model, data flow diagramming is needed.
2. Definition:
Data flow diagram is defined as a graphical tool that allows system analysts and users to depict
the flow of data in an information system.
3. DFD components & Symbols:
Data flow diagram symbols consist of four components which are processes, data flows, data
stores and external entities.
External entities represent persons, processes or machines which produce data to be used
by the system or receive data that is output by the system. Examples: Student, Customer,
Client
Processes are discrete actions that transform input data to output data. Examples: Create
Student Record, Calculate Purchase Cost, Register Client
Data stores are temporary or permanent repositories of information that are inputs to or
outputs of processes. Examples: Student Master, Client List
Data flows represent the transfer of data over time from one “place” (entity, process, data
store) to another. Examples: New Student Information (from Student, to Student Master)
18
4. Rules of DFD:
For external entity,
• At least one input or output data flow for external entity
• Process from external entity cannot move directly to another external entity
For process,
• At least one input data flow and/or at least one output data flow for a process
• Output data flows usually have different names than input data flows for a process
For data flows,
• Data flows only in one direction
• Every data flow connects to at least one process
For data store,
• For every data store, data cannot move directly from one data store to another data
store, data must be moved by a process.
• At least one input data flow and /or at least one output data for a data store
19
5. Data Flow Diagram Layers
Draw data flow diagrams in several nested layers. A single process node on a high level diagram
can be expanded to show a more detailed data flow diagram.
Context diagram
Context diagram shows the overall business process as just one process, Shows all the
outside entities that receive information from or contribute information to the system
System is the collection of all business processes which perform tasks or produce outputs
we care about. It is “what happens.”The system is a single process, connected to external
entities.
Subsystem gives more detailed view of an individual processes contained in the context
diagram which includes data stores, more elementary processes.
Level 0 diagram (same like context diagram)
Shows all the processes that comprise the overall system
Shows how information moves from and to each process
Adds data stores
Level 1 diagram
Shows all the processes that comprise a single process on the level 0 diagram
Shows how information moves from and to each of these processes
Shows in more detail the content of higher level process
Level 1 diagrams may not be needed for all level 0 processes
Level 2 diagrams
Shows all processes that comprise a single process on the level 1 diagram
Shows how information moves from and to each of these processes
Level 2 diagrams may not be needed for all level 1 processes
Correctly numbering each process helps the user understand where the process fits into
the overall system
Decomposition & Balancing in DFD20
Decomposition is the process of modeling the system and its components in increasing
levels of detail.
Balancinginvolves insuring that information presented at one level of a DFD is
accurately represented in the next level DFD
DFDs Created by Top-Down Analysis
Create a narrative: description of system
Create a Context Diagram that contains a single process (“the system”) and all entities
which share data with the system
Explode the “parent” context diagram to produce a Diagram 0 (“child”) DFD
Create Diagram 1, 2, …, n DFDs that represent “explosions” of Diagram 0, 1, …, n-1
DFDs until a diagram has only “primitive” processes
Practical No 12: Draw DFD Level 0,1 and 2 for food ordering system.
21
Level 0 diagram
Level 1 Diagram
Level 2 diagram – Process 1 – receive and transform the order
22
Practical No 13: Draw DFD Level 0,1 and 2 for online learning website.
Level 0 diagram
23
Level 1 diagram
24
Level 2 diagrams
2.1. Student or Faculty Registration and Login
25
2.2. Faculty activities
26
2.3. Student activities
27