CSC 403 Software Engineering Lecture Notes 2019-2020
CSC 403 Software Engineering Lecture Notes 2019-2020
OUTLINE
• Introduction
• Software Processes and Software Process Models
• Software Design
• Object Oriented Analysis and Design
• Software Architecture
• Design Patterns
• Design for Re-use
• Software tools and environment
• Requirement Analysis tools
• Design Modelling tools
• Testing tools
• Using API
• API programming class
• Component based computing
Introduction
What is a Software?
• This approach is based on the existence of a significant number of reusable components. The system
development process focuses on integrating these components into a system rather than developing
them from scratch.
• Reuse-oriented approaches rely on a large base of reusable software components and an integrating
framework for the composition of these components.
• Systems are integrated from existing components or COTS (Commercial-off-the-shelf) systems.
Software Process Model
ITERATIVE PROCESS MODEL
• System requirements change as the business evolves and the system responds to external pressures.
• Management priorities change. As new technologies become available, design and implementation
change.
• Iterative development is fundamental to software and there are two important process models that
are explicitly designed for this purpose :
Incremental development
Spiral development
Software Process Model
INCREMENTAL DEVELOPMENT
• Rather than deliver the system as a single delivery, the development and delivery is broken down
into increments
• Each increment delivers a different part of the required functionality
• User requirements are prioritised and the highest priority requirements are included in early
increments
• Once the development of an increment is started, the requirements are frozen.
Software Process Model
ADVANTAGES OF INCREMENTAL DEVELOPMENT
• Customer value can be delivered with each increment so system functionality is available earlier
• Early increments act as a prototype to define requirements for later increments
• Lower risk of overall project failure
• The highest priority system services tend to receive the most testing
Software Process Model
SPIRAL DEVELOPMENT
• Process is represented as a spiral rather than as a sequence of activities with backtracking
• Each loop in the spiral represents a phase in the process.
• No fixed phases such as specification or design -loops in the spiral are chosen depending on what
is required
• Risks are explicitly assessed and resolved throughout the process
Software Specification
• The process of establishing what services are required and the constraints on the system’s operation
and development is called Software specification or Software Requirement Specification.
• Requirements are a description of what the system should do.
• Just like the traditional software engineering, the process begins with understanding and
documenting the requirements of the system. This includes identifying the functionalities,
constraints, and desired behaviour of the software. The process of identifying, analysing,
and detailing these functionalities and constraints is called requirement engineering.
• A requirement can be a high-level, abstract statement of a service that a system should
provide (user requirement) or a detailed, formal definition of a system function (system
requirement).
• System requirements are often classified into Functional requirements and Non-functional
requirements.
Software Specification
• Functional Requirements: These are statements of services the system should provide,
how the system should react to particular inputs, and how the system should behave in
particular situations.
• Non-Functional Requirements: These are constraints on the services or functions provided
by the system.
i. Activity diagrams, which show the activities involved in a process or in data processing.
ii. Use case diagrams, which show the interactions between a system and its environment.
iii. Sequence diagrams, which show interactions between actors and the system and between system
components.
iv. Class diagrams, which show the object classes in the system and the associations between these
classes.
v. State diagrams, which show how the system reacts to internal and external events.
Analysis and Design
Use Case Diagram
• A use case is a methodology used in system analysis to identify, clarify, and organize system
requirements.
• Use case diagram or model represents the different ways in which a system can be used by the
users.
• Use case is used to support requirements elicitation.
• The main purpose of use-case diagrams is to capture the software’s functional requirement
• Each use case represent a task that involves external interaction with the system.
• The use cases do not mention any specific algorithm to be used or the internal data representation,
internal structure of the software
Analysis and Design
The boundary, which defines the system of interest in relation to the world around it.
The actors, usually individuals involved with the system defined according to their roles.
The use cases, which are the specific roles played by the actors within and around the system.
The relationships between and among the actors and the use cases
Analysis and Design
• The sequence diagram is used primarily to show the interactions between system components and
actors as well as interactions among system components.
• The interactions in these diagrams have an order and thus they are called sequence diagrams.
• One of the primary uses of sequence diagrams is in the transition from requirements expressed as
use cases to the next and more formal level of refinement.
• Use cases are often refined into one or more sequence diagrams
• There could be multiple objects and components in a sequence diagram. However, each sequence
diagram contains usually one actor.
Analysis and Design
ACTOR AND OBJECTS
• The actors and the objects are the integral part of sequence diagrams.
• While the actor represents a user of the system, the objects represent a specific component of the
system itself.
• The dashed lines under the objects represents the timeline of the object. The Actor and the objects
can have “active” and “non-active” states.
• During the active state, the actor/object is interacting with other objects. During the non-active
state, the actor/object is not needed.
• By looking at the timeline of objects, it is possible to say which objects are frequently interacting
with the system.
Analysis and Design
Analysis and Design
ACTIVATION
• The activation displays the “active” and “non-active” state of objects.
• The activation is represented as a vertical bar.
• An object and an actor can have “alive” and “non-alive” states.
• The activation depends on how much interaction happens with the system
Analysis and Design
MESSAGES
• Messages are written with horizontal arrows with the message name written above/on them.
• Messages display interactions on a sequence diagram.
• There are four types of messages in a Sequence Diagram.
Analysis and Design
MESSAGES
• Solid arrow heads represent synchronous messages, open arrow heads represent asynchronous
messages, dashed lines represent reply messages and half-rectangular lines represents self
messages.
• If a caller sends a synchronous message, it must wait until the message is done, such as invoking a
method.
• If a caller sends an asynchronous message, it can continue processing and doesn’t have to wait for
a response.
Analysis and Design
• Reply or return messages are the answers given to synchronous messages. All reply messages
are asynchronous and does not have to wait for a reply as they are the reply themselves.
• Self messages are generally used for validation or self respond. While these messages are generally
used for error handling, they are also used to show response for a specific operation, or when
results from an operation are computed and returned.
Analysis and Design
Fragments
• Unlike Use-case diagrams, Sequence Diagrams can be used for error handling (such as for
validation).
• Sequence diagrams show the order of interactions whereas the use-case do not.
• Sequence diagrams are generally created for developers whereas use-cases usually made for
Stakeholders to explain how the system would work.
Analysis and Design
CLASS DIAGRAM
Software design is a process that conceptualize the software requirements into software
implementation.
There are multiple variants of software design. They include:
• Structured Design
Structured design is a conceptualization of problem into several well-organized
elements of solution. It is basically concerned with the solution design. Benefit of structured
design is, it gives better understanding of how the problem is being solved. Structured
design also makes it simpler for designer to concentrate on the problem more accurately
• Function-oriented Design
In function-oriented design, the system is comprised of many smaller sub-systems
known as functions. These functions are capable of performing significant task in the
system. The system is considered as top view of all functions
SOFTWARE DESIGN STRATEGIES
• Object-Oriented Design: is a method for designing systems using self-contained objects and
object classes which allow the system to be formed of standalone objects and maintainable.
SOFTWARE DESIGN STRATEGIES
CHARACTERISTICS OF OOD
• Objects are abstractions of real-world or system entities and manage themselves;
• Objects are independent and encapsulate state and representation information;
• System functionality is expressed in terms of object behaviour;
• Objects may be distributed and may execute sequentially or in parallel.
ADVANTAGES OF OOD
• Maintenance: Objects are stand-alone entities and reusable entities.
• Concurrent execution :Objects can be executed in sequence or in parallel(also called multi-
tasking)
• Realism: There is an obvious mapping from real world entities to system objects (every real
entity can be an object).
SOFTWARE ARCHITECTURE
• Software Architecture defines what connects what is required with how it should be done in a
software project. In a sense, software architecture is not so much different than the genuine
architecture.
• Architectural design is concerned with understanding how a system should be organized and
designing the overall structure of that system
• In the requirements section you defined what to do.
• In system modeling, you draw a path regarding how to reach these requirements.
• The Software Architecture ensures that you can reach those requirements within the path you
identified.
• It is the critical link between the system design and requirements engineering
• Software architecture is important because it affects the performance, robustness, and
maintainability of a system
• Deciding system architecture does not have a de facto standard way of doing it.
• To design a system architecture; you need to understand how data flows within a system.
Data-Driven modeling
• Data Driven modeling is used during System Architecture Design in order to understand
how data flows throughout the system.
• Data Driven modeling is designed using Data-Flow Diagrams also referred to as DFDs.
• The UML does not support data-flow diagrams (DFDs) as they were originally proposed
and used for modeling data processing. The reason for this is that DFDs focus on system
functions and do not recognize system objects.
Architecture patterns
• It is a description of a system organization
• Architectural patterns are abstract description of a good practice in software engineering which has
been tested and proven to be successful.
• The architectural pattern describes which sort of organization is successful in which type of
system.
• No architectural pattern is perfect and they all have their own strengths and weaknesses.
• Hence, it is imperative to understand these strengths and weakness before selecting an architectural
pattern.
• Patterns are a means of representing, sharing and reusing knowledge.
• An architectural pattern is a stylized description of good design practice, which has been tried and
tested in different environments.
• Patterns should include information about when they are and when they are not useful.
• Patterns may be represented using tabular and graphical descriptions.
Architecture patterns
Because of the close relationship between non-functional requirements and software architecture, the particular
architectural style and structure that you choose for a system should depend on the non-functional system
requirements:
•MVC architecture is triangular: the view sends updates to the controller, the controller updates the
model, and the view gets updated directly from the model.
• ALL COMPONENTS CAN INTERACT WITH EACH OTHER
• It is especially useful when there are multiple ways to view and interact with data.
• It is also a very useful architecture pattern when the future requirements for interaction and
presentation is not known as it provides flexibility over the view of data.
MVC Advantages
•Independency: Allows data to change independently of its presentation.
•Multiple presentation: Supports presentation of data in multiple ways.
•Consistency: A change in the model (i.e. data) is always reflected to controller and the view.
MVC Disadvantages
•Difficult to maintain a clean system: Requires more effort and additional code to provide simplicity of
data model and controller interactions.
•Complexity: Can easily lead to code complexity.
Architecture patterns
Layered Architecture
• The layered architecture is especially useful when the development is spread across several teams with
each team having a responsibility for a layer of functionality.
• User Interface : GUI Designer team
• Business logic : Developer team
• Management authentication and validation : Q & A Tester team
• System support : Database designer & administrator(s)
Architecture patterns
In a Two tiered architecture, a web server is where the business logic and presentation runs and
a database is where the persistency resides. These do not necessarily have to be a database or a
web server. It could also be an XML repository, a cloud account and/or an object repository.
Architecture patterns
•Maintenance: Each layer is individual on its own and updates can be done on a layer without affecting
another layer.
•Consistency: Replacement of layers so long as the interface is maintained.
•Multi-level security: e.g. authentication can be provided in each layer to increase security of the system.
Repository Architecture
•Repository architecture is used in systems that produce large volumes of information, generated and used
for a long time. This architecture is also useful when data triggers a tool or an action.
•The information is then becomes available and could be used by other tools.
•With the arise of big data, repository architecture pattern got very popular. Almost all systems today
provide some sort of cloud and management services.
•There is no need to transmit data explicitly from one component to the other.
•However, on the development side, it is not easy to distribute the repository over a number of machines.
•Although a repository can be logically distributed over a number of machines, there may be problems with
data redundancy and inconsistency.
Architecture patterns
•Components are independent –They do not need to know of existence of other components.
•All data can be managed consistent as if it is all in one place.
•Changes made by one component on the repository is automatically reflected to all other components.
Architecture patterns
•The name « pipe » and « filter» comes from original UNIX system where it was possible to link processes
using « pipes».
•The pipes were in fact text streams frequently used with UNIX commands which then facilitate the control
of UNIX shell.
•The entire workflow of this architecture is based on this as statements are filtered through pipelines.
•The transformation of data is sequential and the data is processed in batches. Hence, the pipe and filter
architecture is in fact a batch sequential model for data processing.
•Most billing systems are designed with this architecture.
•The architecture of an embedded system can be organized as a process pipeline, with each process
executing concurrently.
•In other words, pipe and filter architecture is often used with embedded systems.
•This architecture is particularly displayed with STATE MACHINE Diagrams
Architecture patterns
• Software testing is the process of finding errors in the developed product. It also checks whether
the real outcomes match the expected results. It also aids in the identification of defects, missing
requirements, or gaps .
• Testing is intended to show that a program does what it is intended to do and to discover program
defects before it is put into use.
• Testing can only show the presence of errors, not there absence.
• Testing is done to achieve two goals. This include:
• To demonstrate that the software meets its requirements. This is achieved through Validation
test.
• To discover situations in which the behaviour of the software is incorrect, undesirable, or does
not conform to its specification. This is achieved through defect test.
Software Testing
• Unit Testing: Unit testing is the process of testing program components, such as methods or object
classes.
• Requirements-based Testing: is a software testing approach where you consider each requirement
and derive a set of tests for it. It is a validation rather than defect test.
• Performance Testing: after a system has been completely integrated, testing for performance and
reliability is very important. Performance tests have to be designed to ensure that the system can
process its intended load.
• Release Testing: is the process of testing a particular release of a system that is intended
for use outside of the development team. Normally, the system release is for customers
and users.
Software Testing
• User Testing: This is a process where users or customers provide input on system testing. There
are three types of user testing:
• Alpha Testing: in this test, users of the software work with the development team to test the software at
the developer’s site.
• Beta Testing: in this test a release of the software is made available to users to allow them to experiment
and to raise problems that they discover with the system developers.
• Acceptance Testing: in this test the customers test a system to decide whether or not it is ready to be
accepted from the system developers and deployed in the customer environment.
Software Testing