Software Engineering File
Software Engineering File
(KCA-352)
(SESSION 2021-2022)
Submitted To :- Submitted By :-
Departments of
Master of Computer Application
LABORATORY MANUAL
Prepared by
2
Introduction and Project
Definition
3
SE Lab III Semester
1. Outline
Introduction to the lab plan and objectives.
Project definition.
2. Background
The software engineer is a key person analyzing the business, identifying
opportunities for improvement, and designing information systems to implement these
ideas. It is important to understand and develop through practice the skills needed to
successfully design and implement new software systems.
2.1 Introduction
In this lab you will practice the software development life cycle (project
management, requirements engineering, systems modeling, software design,
prototyping, and testing) using CASE tools within a team work environment.
UML notation is covered in this lab as the modeling language for analysis and
design.
4
SE Lab III Semester
Software Processes
5
SE Lab III Semester
Software Processes
Objectives
Obtain a deeper understanding of software process models and software processes.
1. Outline
Review of the basic software process models and software processes.
2. Background
IEEE defined a software process as: “a set of activities, practices and
transformations that people use to develop and maintain software and the associated
products, e.g., project plans, design documents, code, test cases and user manual”.
Following the software process will stabilize the development life cycle and make
the software more manageable and predictable. It will also reduce software
development risk and help to organize the work products that need to be produced
during a software development project. A well-managed process will produce high
quality products on time and under budget. So following a mature software process is
a key determinant to the success of a software project.
6
SE Lab III Semester
7
SE Lab III Semester
1. Outline
Project work planning.
Risk management.
MS project.
Examples.
2. Background
Project management is the process of planning and controlling the development of a system
within a specified timeframe at a minimum cost with the right functionality.
2.1 Project Work Plan
Prepare a list of all tasks in the work breakdown structure, plus:
Duration of task.
Current task status.
Task dependencies.
Key milestone dates.
2.2 Tracking Progress
Gantt Chart:
o Bar chart format.
o Useful to monitor project status at any point in time.
PERT Chart:
o Flowchart format.
o Illustrate task dependencies and critical path.
2.3 Risk Management
Risk management is concerned with identifying risks and drawing up plans to minimize
their effect on a project.
A risk is a probability that some adverse circumstance will occur.
Project risks which affect schedule or resources.
Product risks which affect the quality or performance of the software being developed.
Business risks which affect the organization developing the software.
2.4 Risk Management Process
Risk identification: identify project, product and business risks.
Risk analysis: assess the likelihood and consequences of these risks.
Risk planning: draw up plans to avoid or minimize the effects of the risk.
Risk monitoring: monitor the risks throughout the project.
3. CASE Tools
Microsoft Project is the clear market leader among desktop project management
applications.
Primavera Project Planner: multi-project, multi-user project, and resource planning and
scheduling.
SureTrak Project Manager: resource planning and control for small-to-medium sized
projects.
According to the Gartner Group, it accounts for about two-thirds of all project management
software sales.
8
SE Lab III Semester
Software Requirement
Specification (SRS)
9
SE Lab III Semester
1. Outline
Review of the requirements engineering process.
Write requirements and specifications.
RequisitePro tutorial.
Software Requirement Specification (SRS).
2. Background
A requirement is a statement of a behavior or attribute that a system must possess
for the system to be acceptable to a stakeholder.
Software Requirement Specification (SRS) is a document that describes the
requirements of a computer system from the user's point of view. An SRS document
specifies:
The required behavior of a system in terms of: input data, required processing,
output data, operational scenarios and interfaces.
The attributes of a system including: performance, security, maintainability,
reliability, availability, safety requirements and design constraints.
Requirements management is a systematic approach to eliciting, organizing and
documenting the requirements of a system. It is a process that establishes and maintains
agreement between the customer and the project team on the changing requirements of
a system.
Requirements management is important because, by organizing and tracking the
requirements and managing the requirement changes, you improve the chances of
completing the project on time and under budget. Poor change management is a key
cause of project failure.
2.1 Requirements Engineering Process
Requirements engineering process consists of four phases:
Requirements elicitation: getting the customers to state exactly what the
requirements are.
Requirements analysis: making qualitative judgments and checking for
consistency and feasibility of requirements.
Requirements validation: demonstrating that the requirements define the system
that the customer really wants.
Requirements management: the process of managing changing requirements
during the requirements engineering process and system development, and
identifying missing and extra requirements.
2.2 Writing Requirements
Requirements always need to be correct, unambiguous, complete, consistent, and
testable.
10
SE Lab III Semester
RequisitePro offers the power of a database and Microsoft Word and is integrated
with other Rational Suite products.
11
SE Lab III Semester
12
SE Lab III Semester
1. Outline
Visual modeling.
Introduction to UML.
Introduction to visual modeling with UML.
Use case diagrams: discovering actors and use cases.
2. Background
Visual Modeling is a way of thinking about problems using models organized
around real-world ideas. Models are useful for understanding problems,
communicating with everyone involved with the project (customers, domain experts,
analysts, designers, etc.), modeling enterprises, preparing documentation, and
designing programs and databases
13
SE Lab III Semester
intended functions (use cases), its surroundings (actors), and relationships between the
use cases and actors (use case diagrams).
2.5 Actors
Are NOT part of the system – they represent anyone or anything that must
interact with the system.
Only input information to the system.
Only receive information from the system.
Both input to and receive information from the system.
Represented in UML as a stickman.
3. CASE Tools
The Rational Rose product family is designed to provide the software developer
with a complete set of visual modeling tools for development of robust, efficient
solutions to real business needs in the client/server, distributed enterprise and real-time
systems environments. Rational Rose products share a common universal standard,
making modeling accessible to nonprogrammers wanting to model business processes
as well as to programmers modeling applications logic.
14
SE Lab III Semester
System Modeling
15
SE Lab III Semester
System Modeling
Objective:
Deeper understanding of System modeling:
Data model: entity-relationship diagram (ERD).
Functional model: data flow diagram (DFD).
Outline
System analysis model elements:
Data model: entity-relationship diagram (ERD)
Functional model: data flow diagram (DFD)
Background
Modeling consists of building an abstraction of reality. These abstractions are
simplifications because they ignore irrelevant details and they only represent the
relevant details (what is relevant or irrelevant depends on the purpose of the model).
2.1 Why Model Software?
Software is getting larger, not smaller; for example, Windows XP has more than 40
million lines of code. A single programmer cannot manage this amount of code in its
entirety. Code is often not directly understandable by developers who did not participate
in the development; thus, we need simpler representations for complex systems
(modeling is a mean for dealing with complexity).
A wide variety of models have been in use within various engineering disciplines
for a long time. In software engineering a number of modeling methods are also
available.
2.2 Analysis Model Objectives
To describe what the customer requires.
To establish a basis for the creation of a software design.
To define a set of requirements that can be validated once the software is built.
2.3 The Elements of the Analysis Model
The generic analysis model consists of:
An entity-relationship diagram (data model).
A data flow diagram (functional model).
A state transition diagram (behavioral model).
NOTE: state transition diagram will be covered in lab 11.
2.3.1 Entity Relationship Diagram
An entity relationship diagram (ERD) is one means of representing the objects and
their relationships in the data model for a software product.
Relationship
16
SE Lab III Semester
External entity
Process
Data flow
Control flow
Data store
CASE Tools
You can use MS word to create your ERD and DFD since we do not have a license
for a case tool that supports these diagrams.
17
SE Lab III Semester
18
SE Lab III Semester
1. Outline
Writing flow of events.
Flow of events template and example.
Activity diagrams.
Examples.
2. Background
Each use case is documented with a flow of events. The flow of events for a use
case is a description of the events needed to accomplish the required behavior of the
use case.
Activity diagrams may also be created at this stage in the life cycle. These diagrams
represent the dynamics of the system. They are flow charts that are used to show the
workflow of a system; that is, they show the flow of control from one activity to another
in the system,
19
SE Lab III Semester
A sample completed flow of events document for the Select Courses to Teach use case
follows.
1.1 Preconditions
Create course offerings sub-flow of the maintain course information use case
must execute before this use case begins.
If the activity selected is ADD, the S-1: add a course offering sub-flow is performed.
If the activity selected is DELETE, the S-2: delete a course offering sub-flow is
performed.
If the activity selected is REVIEW, the S-3: review schedule sub-flow is performed.
If the activity selected is PRINT, the S-4: print a schedule sub-flow is performed.
1.3 Sub-flows
S-1: Add a Course Offering:
The system displays the course screen containing a field for a course name and
number. The professor enters the name and number of a course (E-3). The system
displays the course offerings for the entered course (E-4). The professor selects a course
offering. The system links the professor to the selected course offering (E-5). The use
case then begins again.
20
SE Lab III Semester
3. CASE Tools
Rational Rose (introduced in lab 5).
21
SE Lab III Semester
22
SE Lab III Semester
1. Outline
Object-Oriented concepts
Discovering classes’ approaches: noun phrase approach, common class
patterns, use case driven method, CRC (Class-Responsibility-Collaboration)
and mixed approach.
Examples.
2. Background
Classes: a description of a group of objects with common properties (attributes),
common behavior (operations), common relationships to other objects and common
semantics.
2.1 Object-Oriented Concepts
Attribute: the basic data of the class.
Method (operation): an executable procedure that is encapsulated in a class and
is designed to operate on one or more data attributes that are defined as part of
the class.
Object: when specific values are assigned to all the resources defined in a class,
the result is an instance of that class. Any instance of any class is called an
object.
2.2 Discovering Classes
Discovering and defining classes to describe the structure of a computerized system
is not an easy task. When the problem domain is new or unfamiliar to the software
developers it can be difficult to discover classes; a cookbook for finding classes does
not exist.
2.3 Classes Categories
Classes are divided into three categories:
Entity: models information and associated behavior that is long-lived, independent
of the surrounding, application independent, and accomplishes some responsibility
Boundary: handles the communication between the system surroundings and the
inside of the system, provides interface, and facilitates communication with other
systems
Control: model sequencing behavior specific to one or more use cases. Control
classes coordinate the events needed to realize the behavior specified in the use
case, and they are responsible for the flow of events in the use case.
2.4 Discovering Classes Approaches
Methods of discovering classes:
2.4.1 Noun Phrase Approach: Examine the requirements and underline each noun.
Each noun is a candidate class; divide the list of candidate classes into:
Relevant classes: part of the application domain; occur frequently in
requirements.
Irrelevant classes: outside of application domain
Fuzzy classes: unable to be declared relevant with confidence; require
additional analysis
23
SE Lab III Semester
2.4.2 Common Class Patterns: Derives candidate classes from the classification
theory of objects; candidate classes and objects come from one of the following
sources:
Tangible things: e.g. buildings, cars.
Roles: e.g. teachers, students.
Events: things that happen at a given date and time, or as steps in an ordered
sequence: e.g. landing, request, interrupt.
Interactions: e.g. meeting, discussion.
Sources, facilities: e.g. departments.
Other systems: external systems with which the application interacts.
Concept class: a notion shared by a large community.
Organization class: a collection or group within the domain.
People class: roles people can play.
Places class: a physical location relevant to the system.
2.4.3 Use Case Driven Method: The scenarios - use cases that are fundamental to
the system operation are enumerated. Going over each scenario leads to the
identification of the objects, the responsibilities of each object, and how these
objects collaborate with other objects.
2.4.4 CRC (Class-Responsibility-Collaboration): Used primarily as a
brainstorming tool for analysis and design. CRC identifies classes by analyzing
how objects collaborate to perform business functions (use cases).
A CRC card contains: name of the class, responsibilities of the class and
collaborators of the class. Record name of class at the top; record
responsibilities down the left-hand side; record other classes (collaborators) that
may be required to fulfill each responsibility on the right-hand side.
CRC cards are effective at analyzing scenarios; they force you to be concise and
clear; they are cheap, portable and readily available.
2.4.5 Mixed Approach: A mix of these approaches can be used, one possible
scenario is:
Use CRC for brainstorming.
Identify the initial classes by domain knowledge.
Use common class patterns approach to guide the identification of the
classes.
Use noun phrase approach to add more classes.
Use the use case approach to verify the identified classes.
3. CASE Tools
Rational Rose (introduced in lab 7).
24
SE Lab III Semester
Interaction Diagrams:
Sequence & Collaboration
Diagrams
25
SE Lab III Semester
1. Outline
Interaction diagrams:
o Sequence diagrams
o Collaboration diagrams
2. Background
Interaction diagrams describe how groups of objects collaborate in some behavior.
An interaction diagram typically captures the behavior of a single use case.
Interaction diagrams do not capture the complete behavior, only typical scenarios.
26
SE Lab III Semester
2.5 Notes
Always keep your diagrams simple.
For “IF... then ...” else scenarios, you may draw separate sequence diagrams
for the different branches of the “if statement”. You may even hide them, (at
least during the analysis phase) and document them by the text description
accompanying the sequence diagrams.
3. CASE Tools
Rational Rose (introduced in lab 5).
27
SE Lab III Semester
Software Design:
Software Architecture and Object-
Oriented Design
28
SE Lab III Semester
1. Outline
Software design concepts and principals.
Software architecture.
Specifying the attributes and the operations and finding the relationships
between classes.
Creating UML class diagram.
Software design document.
2. Background
The purpose of software design is “to produce a workable (implementable) solution
to a given problem.” David Budgen in Software Design: An Introduction.
29
SE Lab III Semester
3. CASE Tools
Rational Rose (introduced in lab 7).
30
SE Lab III Semester
31
SE Lab III Semester
1. Outline
UML state diagrams.
UML state diagram notation
UML state details
Examples
2. Background
Mainly, we use interaction diagrams to study and model the behavior of objects in
our system. Sometimes, we need to study the behavior of a specific object that shows
complex behavior to better understand its dynamics. For that sake, UML provides state
transition diagrams used to model the behavior of objects of complex behavior. In this
Lab, UML state transition diagrams will be introduced. We will study their notation
and how can we model them using Rational Rose.
32
SE Lab III Semester
In the operations part, we usually use one of the following reserved words:
o Entry: a specific action performed on the entry to the state.
o Do: an ongoing action performed while in the state.
o On: a specific action performed while in the state.
o Exit: a specific action performed on exiting the state.
There are two special states added to the state transition diagram- start state and
end state.
Notation of start state is a solid black circle and for the end state a bull’s eye is
used.
State
[entry:…]
[do: …]
[exit:…]
Event causing transition
Action that occurs
New State
[entry:…]
[do: …]
[exit:…]
3. CASE Tools
Rational Rose (introduced in Lab 5).
33
SE Lab III Semester
Implementation Diagrams:
Component & Deployment Diagrams
34
SE Lab III Semester
1. Outline
Implementation diagrams: component and deployment diagrams.
Examples.
2. Background
Implementation diagrams capture design information. The main implementation
diagrams in UML are: component and deployment diagrams. In this Lab we will study
these diagrams and their notation.
35
SE Lab III Semester
3. CASE Tools
Rational Rose (introduced in Lab 5).
36
SE Lab III Semester
Software Testing
37
SE Lab III Semester
Software Testing
Objectives
Gain a deeper understanding of software testing and the software testing
document.
Become familiar with a software testing tool (JUnit).
1. Outline
Overview of software testing.
Unit testing.
JUnit tutorial.
Software test specification.
2. Background
Testing is the process of executing a program with the intent of finding errors. A
good test case is one with a high probability of finding an as-yet undiscovered error. A
successful test is one that discovers an as-yet-undiscovered error.
The causes of the software defects are: specification may be wrong; specification may
be a physical impossibility; faulty program design; or the program may be incorrect.
3. CASE Tools
JUnit is an open-source project to provide a better solution for unit testing in Java.
It can be integrated with many Java IDEs.
Central idea: create a separate Java testing class for each class you’re creating, and then
provide a means to easily integrate the testing class with the tested class for unit testing.
38
SE Lab III Semester
39