Advanced Software Engg Notes Unit1 5
Advanced Software Engg Notes Unit1 5
1. Communication
2. Planning
3. Modeling
4. Construction
5. Deployment
The name 'prescriptive' is given because the model prescribes a set of activities,
actions, tasks, quality assurance and change the mechanism for every project.
NOTE: The description of the phases of the waterfall model is same as that of
the process model.
• The incremental model combines the elements of the waterfall model and
they are applied in an iterative fashion.
• The first increment in this model is generally a core product.
• Each increment builds the product and submits it to the customer for any
suggested modifications.
• The next increment implements the customer's suggestions and adds
additional requirements to the previous increment.
• This process is repeated until the product is finished.
For example, the word-processing software is developed using the
incremental model.
3. RAD model
1. Business Modeling
• Business modeling consist of the flow of information between various
functions in the project.
• For example, what type of information is produced by every function and
which are the functions to handle that information.
• A complete business analysis should be performed to get the essential
business information.
2. Data modeling
• The information in the business modeling phase is refined into the set of
objects and it is essential for the business.
• The attributes of each object are identified and define the relationship
between objects.
3. Process modeling
• The data objects defined in the data modeling phase are changed to fulfil
the information flow to implement the business model.
• The process description is created for adding, modifying, deleting or
retrieving a data object.
4. Application generation
• In the application generation phase, the actual system is built.
• To construct the software the automated tools are used.
5. Testing and turnover
• The prototypes are independently tested after each iteration so that the
overall testing time is reduced.
• The data flow and the interfaces between all the components are fully
tested. Hence, most of the programming components are already tested.
• The agile process forces the development team to focus on software itself
rather than design and documentation.
• The agile process believes in iterative method.
• The aim of agile process is to deliver the working model of software quickly
to the customer for example: Extreme programming is the best known of
agile process.
Agile Principles
2. It can be difficult to estimate the overall time and cost of a project, as the
process is iterative and changes are made throughout the development.
Scrum
One of the widely known and followed agile types, Scrum process usually is
followed in a small team. It majorly focuses on managing the process in a
development team. It uses a scrum board and divides the whole development
process into sprints. While the duration of the sprint may vary between 2 weeks
to 1 month, each of them is defined by analysis, development as well as user
acceptance.
Scrum also focuses on team interaction as well as effective client involvement.
There are different roles that people play in a scrum team, such as −
Scrum Master − The Scrum master’s responsibility is to set up the meeting,
team formation and overall managing of the whole sprint wise development. He/
she also takes care of any kind of hurdle faced during the development process.
Product owner − The product owner is responsible for creating and maintaining
the backlog, which is a repository or dashboard containing all the developmental
plans or requirement for the particular sprint. The product owner also assigns
and manages the requirements based on their priority order in each sprint.
Scrum team − The development team responsible for development or
completion of the tasks and successful execution of each of the sprints.
For each sprint, the product backlog is prepared by the product owner which
comprises of requirements or tasks and user stories for that particular sprint.
Once the tasks are selected for that sprint backlog, the development team works
on those tasks and executes them as a product sprint wise. The scrum master
manages the whole sprint process and takes care of the smooth execution of
plan.
Everyday there is a small meeting of around 15 mins, called the daily Scrum or
stand-up meeting, where the scrum master gets the status update regarding the
product backlog and tries to find out if there is any blockage for further action.
XP
It focuses on short deliveries with checkpoints all over the project in order to
analyze if there are any changes in requirement and act accordingly. The small
deliveries and iterative development cycles happen in a more confusing manner
without any clear picture. However, it makes sense once the whole development
is completed. XP is largely dependent on its developer team’s ability to
coordinate. There are 5 phases in Extreme programming, which are −
Planning −
The initial phase where clients and the developers meet and discuss about the
requirement and scope of the development. Based on the client input, developer
team prepare short iterative user stories or development cycles for the full
development as a whole. Based on the stories created, duration and cost of the
project is defined.
Designing −
Here all the user stories are broken down into smaller tasks and further analysis
is done regarding the execution. Even development standards such as class and
method names, architecture and formats etc. are planned during designing. Test
cases are concurrently prepared for those iterative tasks. For probable problems
even contingency plans as well as solutions are discussed.
Coding −
The most important phase where the development based on the planning takes
place which include coding based on requirement and simultaneous
documentation for updating customer regarding the present status. Coding
standards and architectures defined during designing are properly followed with
a strictly 40 hours work a week follow up.
Testing −
Once the coding is done, user acceptance testing is started. XP integrates testing
during the coding phase itself for testing and development to run simultaneously.
Based on the test results, bugs are eliminated and then the product goes through
customer acceptance testing which is based on the customer requirements. Once
the testing is passed, the product along with the test result is then delivered to
the customer.
Closure −
Here, once the product is delivered, the team waits for customer as well as
manager feedback. Based on the feedback, they again follow the same planning-
coding-testing iteration till customer acceptance test is passed. The team also
provide technical support during production in case of further issue arises.
Kanban
Unlike Scrum, where only the sprint tasks are added to the board, all the tasks
related to the production schedule are added into the Kanban board in form of
cards. Typically, the tasks are divided into 3 columns such as Completed tasks,
To-do tasks, ongoing tasks. Unlike Scrum, task completion based on priority is
optional in Kanban and it can contain all the tasks related to the whole
developmental cycle at one place.
DevOps
The DevOps is the combination of two words, one is Development and other
is Operations. It is a culture to promote the development and operation process
collectively.
What is DevOps?
The DevOps is a combination of two words, one is software Development, and
second is Operations. This allows a single team to handle the entire application
lifecycle, from development to testing, deployment, and operations. DevOps
helps you to reduce the disconnection between software developers, quality
assurance (QA) engineers, and system administrators.
Why DevOps?
o The operation and development team worked in complete isolation.
o After the design-build, the testing and deployment are performed
respectively. That's why they consumed more time than actual build cycles.
o Without the use of DevOps, the team members are spending a large
amount of time on designing, testing, and deploying instead of building the
project.
o Manual code deployment leads to human errors in production.
o Coding and operation teams have their separate timelines and are not in
synch, causing further delays.
code. The configuration file can be written during deployment, or they can be
loaded at the run time, depending on the environment in which it is running.
Advantages:
1. Improves collaboration and communication between development and
operations teams.
2. Automates software delivery process, making it faster and more efficient.
3. Enables faster recovery and response time in case of issues.
Disadvantages:
1. Requires a significant investment in tools and technologies.
2. Can be difficult to implement in organizations with existing silos and lack
of culture of collaboration.
3. Need to have a skilled workforce to effectively implement the DevOps
practices.
4. Ultimately, the choice of which methodology to use depends on the specific
project and organization, as well as the goals and requirements of the
project.
Prototype Construction
user specific and may not have been considered by the developer during product
design.
Horizontal prototypes are used to get more information on the user interface level
and the business requirements. It can even be presented in the sales demos to
get business in the market. Vertical prototypes are technical in nature and are
used to get details of the exact functioning of the sub systems. For example,
database requirements, interaction and data processing load in a given sub
system.
merged into a single product. This method is helpful to reduce the feedback time
between the user and the application development team.
Extreme Prototyping:
Extreme prototyping method is mostly used for web development. It is consists
of three sequential phases.
1. Basic prototype with all the existing page is present in the HTML format.
2. You can simulate data process using a prototype services layer.
3. The services are implemented and integrated into the final prototype.
Prototype Evaluation
A prototype is the first step on your way to a successful digital product. You’ve
already spent a lot of time and money on your idea, so you shouldn’t risk
developing a product that doesn’t match your users’ needs or preferences, or
that your users won’t understand. That’s why you should invest in usability
testing and UX testing.
In a Prototype Evaluation, you get the chance to ask your target users for initial
feedback on design, usability, and user experience. In this phase, the prototype
is tested to see if it meets the requirements and specifications. This is done by
evaluating its functionality, performance, and reliability.
During the user testing process, the testers will check your prototype and make
sure you don’t work further on a product with usability problems or that’s not
suited to your users’ needs. Based on the feedback of your target users you can
then adapt your first draft and move on with development.
Advantages of Prototype Evaluation
• Make sure your future product is suited to your users’ needs and
expectations
• Prevent operational blindness by involving your target group in
development
• Get feedback on design, usability, and UX at an early stage
• Only invest time and money in features your users will use
Prototype Evolution
The prototype developed is then presented to the customer and the other
important stakeholders in the project. The feedback is collected in an organized
manner and used for further enhancements in the product under development.
The feedback and the review comments are discussed during this stage and some
negotiations happen with the customer based on factors like – time and budget
Based on the results of the testing and evaluation phase, the prototype is refined
and improvements are made. After the refinement phase, the final prototype is
created. This prototype is then tested and evaluated to ensure that it meets all
the requirements before it is mass-produced.
Evolutionary Prototype
In an evolutionary prototype, a system or product is built via several iterations,
with each iteration building on the one before it to enhance and improve the
design. The objective is to provide a final design that satisfies the expectations
and requirements of the intended audience.
This method can be used for a wide variety of projects in various industries, but
it is frequently utilized in software development and engineering.
Modeling
Modeling is a central part of all activities that lead up to the deployment of good
software. It is required to build quality software. Modeling is widely used in
science and engineering to provide abstractions of a system at some level of
precision and detail. The model is then analyzed in order to obtain a better
understanding of the system being developed. “Modeling” is the designing of
software applications before coding.”
In model-based software design and development, software modeling is used as
an essential part of the software development process. Models are built and
analyzed prior to the implementation of the system and are used to direct the
subsequent implementation.
A better understanding of a system can be obtained by considering it from
different perspectives, such as requirements models, static models, and dynamic
models of the software system. A graphical modeling language such as UML helps
in developing, understanding, and communicating the different views.
Importance of Modeling:
• Modeling gives a graphical representation of the system to be built.
• Modeling contributes to a successful software organization.
• Modeling is a proven and well-accepted engineering technique.
• Modeling is not just a part of the building industry. It would be
inconceivable to deploy a new aircraft or an automobile without first
building models-from computer models to physical wind tunnel models to
full scale prototypes.
• A model is a simplification of reality. A model provides the blueprint of a
system.
• A model may be structural, emphasizing the organization of the system,
or it may be behavioral, emphasizing the dynamics of the system.
• Models are built for a better understanding of the system that we are
developing:
a. Models help us to visualize a system as it is or as we want it to be.
b. Models permit us to specify the structure or behavior of a system.
c. Models give us a template that guides us in constructing a system.
d. Models support the decisions we have made.
Principles
There are several basic principles of a good software engineering approach that
are commonly followed by software developers and engineers to produce high-
quality software. Some of these principles include:
1. Modularity: Breaking down the software into smaller, independent, and
reusable components or modules. This makes the software easier to
understand, test, and maintain.
2. Abstraction: Hiding the implementation details of a module or component
and exposing only the necessary information. This makes the software
more flexible and easier to change.
3. Encapsulation: Wrapping the data and functions of a module or
component into a single unit, and providing controlled access to that unit.
This helps to protect the data and functions from unauthorized access and
modification.
4. DRY principle (Don’t Repeat Yourself): Avoiding duplication of code
and data in the software. This makes the software more maintainable and
less error-prone.
5. KISS principle (Keep It Simple, Stupid): Keeping the software design
and implementation as simple as possible. This makes the software more
understandable, testable, and maintainable.
6. YAGNI (You Ain’t Gonna Need It): Avoiding adding unnecessary
features or functionality to the software. This helps to keep the software
focused on the essential requirements and makes it more maintainable.
7. SOLID principles: A set of principles that guide the design of software to
make it more maintainable, reusable, and extensible. This includes the
Single Responsibility Principle, Open/Closed Principle, Liskov Substitution
Principle, Interface Segregation Principle, and Dependency Inversion
Principle.
8. Test-driven development: Writing automated tests before writing the
code, and ensuring that the code passes all tests before it is considered
complete. This helps to ensure that the software meets the requirements
and specifications.
9. By following these principles, software engineers can develop software that
is more reliable, maintainable, and extensible.
10. It’s also important to note that these principles are not mutually
exclusive, and often work together to improve the overall quality of the
software.
Requirement Engineering
Requirements engineering (RE) refers to the process of defining, documenting,
and maintaining requirements in the engineering design process. Requirement
engineering provides the appropriate mechanism to understand what the
customer desires, analyzing the need, and assessing feasibility, negotiating a
reasonable solution, specifying the solution clearly, validating the specifications
and managing the requirements as they are transformed into a working system.
Thus, requirement engineering is the disciplined application of proven principles,
methods, tools, and notation to describe a proposed system's intended behavior
and its associated constraints.
1. Feasibility Study:
The objective behind the feasibility study is to create the reasons for developing
the software that is acceptable to users, flexible to change and conformable to
established standards.
Types of Feasibility:
1. Technical Feasibility - Technical feasibility evaluates the current
technologies, which are needed to accomplish customer requirements
within the time and budget.
2. Operational Feasibility - Operational feasibility assesses the range in
which the required software performs a series of levels to solve business
problems and customer requirements.
3. Economic Feasibility - Economic feasibility decides whether the
necessary software can generate financial profits for an organization.
of the analyst to write the requirement in technical language so that they can be
understood and beneficial by the development team.
The models used at this stage include ER diagrams, data flow diagrams (DFDs),
function decomposition diagrams (FDDs), data dictionaries, etc.
o Data Flow Diagrams: Data Flow Diagrams (DFDs) are used widely for
modeling the requirements. DFD shows the flow of data through a system.
The system may be a company, an organization, a set of procedures, a
computer hardware system, a software system, or any combination of the
preceding. The DFD is also known as a data flow graph or bubble chart.
o Data Dictionaries: Data Dictionaries are simply repositories to store
information about all data items defined in DFDs. At the requirements
stage, the data dictionary should at least define customer data items, to
ensure that the customer and developers use the same definition and
terminologies.
o Entity-Relationship Diagrams: Another tool for requirement
specification is the entity-relationship diagram, often called an "E-R
diagram." It is a detailed logical representation of the data for the
organization and uses three main constructs i.e., data entities,
relationships, and their associated attributes.
Scenario-based Modelling
Requirements for a computer-based system can be seen in many different ways.
Some software people argue that it’s worth using a number of different modes of
representation while others believe that it’s best to select one mode of
representation. The specific elements of the requirements model are
dedicated to the analysis modeling method that is to be used.
Scenario-Based Elements
Using a scenario-based approach, system is described from user’s point of
view. For example, basic use cases and their corresponding use-case diagrams
evolve into more elaborate template-based use cases. Figure 1(a) depicts a UML
activity diagram for eliciting requirements and representing them using use
cases. There are three levels of elaboration.
Class-Based Elements
A collection of things that have similar attributes and common behaviors i.e.,
objects are categorized into classes. For example, a UML case diagram can be
used to depict a Sensor class for the SafeHome security function. Note that
diagram lists attributes of sensors and operations that can be applied to modify
these attributes. In addition to class diagrams, other analysis modeling elements
depict manner in which classes collaborate with one another and relationships
and interactions between classes.
Class-based Modelling
Class-based modeling identifies classes, attributes and relationships that the
system will use. In the airline application example, the traveler/user and the
boarding pass represent classes. The traveler's first and last name, and travel
document type represent attributes, characteristics that describe the traveler
class. The relationship between traveler and boarding pass classes is that the
traveler must enter these details into the application in order to get the boarding
pass, and that the boarding pass contains this information along with other
details like the flight departure gate, seat number etc.
Class based modeling represents the object. The system manipulates the
operations.
The elements of the class-based model consist of classes and object, attributes,
operations, class – responsibility - collaborator (CRS) models.
Classes
Classes are determined using underlining each noun or noun clause and enter it
into the simple table.
Classes are found in following forms:
External entities: The system, people or the device generates the information
that is used by the computer-based system.
Things: The reports, displays, letter, signal are the part of the information
domain or the problem.
Occurrences or events: A property transfer or the completion of a series or
robot movements occurs in the context of the system operation.
Roles: The people like manager, engineer, salesperson are interacting with the
system.
Organizational units: The division, group, team are suitable for an application.
Places: The manufacturing floor or loading dock from the context of the problem
and the overall function of the system.
Structures: The sensors, computers are defined a class of objects or related
classes of objects.
Attributes
Attributes are the set of data objects that are defining a complete class within
the context of the problem.
For example, 'employee' is a class and it consists of name, Id, department,
designation and salary of the employee are the attributes.
Operations
The operations define the behavior of an object.
The operations are characterized into following types:
• The operations manipulate the data like adding, modifying, deleting and
displaying etc.
• The operations perform a computation.
• The operation monitors the objects for the occurrence of controlling an
event
CRS Modeling
• The CRS stands for Class-Responsibility-Collaborator.
• It provides a simple method for identifying and organizing the classes that
are applicable to the system or product requirement.
• Class is an object-oriented class name. It consists of information about sub
classes and super class
• Responsibilities are the attributes and operations that are related to the
class.
• Collaborations are identified and determined when a class can achieve each
responsibility of it. If the class cannot identify itself, then it needs to
interact with another class.
Functional Modelling
Functional Modelling gives the process perspective of the object-oriented analysis
model and an overview of what the system is supposed to do. It defines the
function of the internal processes in the system with the aid of Data Flow
Diagrams (DFDs). It depicts the functional derivation of the data values without
indicating how they are derived when they are computed, or why they need to
be computed.
Data Flow Diagrams
Functional Modelling is represented through a hierarchy of DFDs. The DFD is a
graphical representation of a system that shows the inputs to the system, the
processing upon the inputs, the outputs of the system as well as the internal data
stores. DFDs illustrate the series of transformations or computations performed
on the objects or the system, and the external controls and objects that affect
the transformation.
Rumbaugh et al. have defined DFD as, “A data flow diagram is a graph which
shows the flow of data values from their sources in objects through processes
that transform them to their destinations on other objects.”
The four main parts of a DFD are −
• Processes - Processes are the computational activities that transform data
values. A whole system can be visualized as a high-level process. A process
may be further divided into smaller components. The lowest-level process
may be a simple function.
• Data Flows - Data flow represents the flow of data between two processes.
It could be between an actor and a process, or between a data store and
a process. A data flow denotes the value of a data item at some point of
the computation. This value is not changed by the data flow.
• Actors - Actors are the active objects that interact with the system by either
producing data and inputting them to the system, or consuming data
produced by the system. In other words, actors serve as the sources and
the sinks of data.
• Data Stores - Data stores are the passive objects that act as a repository
of data. Unlike actors, they cannot perform any operations. They are used
to store data and retrieve the stored data. They represent a data structure,
a disk file, or a table in a database.
The other parts of a DFD are −
Behavioural Modelling
Behavioural Modelling indicates how software will respond to external events or
stimuli. In behavioral model, the behavior of the system is represented as a
function of specific events and time.
To create behavioral model following things can be considered:
• Evaluation of all use-cases to fully understand the sequence of interaction
within the system.
Design Concepts
The software design phase is the first step in the SDLC (Software Development
Life Cycle) that shifts the focus from the problem domain to the solution domain.
In software design, the system is viewed as a collection of components or
modules with clearly defined behaviors and bounds.
Architectural Design
A system's architecture can be defined as the system's overall structure and how
that structure offers conceptual integrity to the system. The architectural
design characterizes the software as a system with numerous interconnected
components. The designers acquire an overview of the proposed solution domain
at this level.
High-level Design
The high-level design deconstructs the architectural design's 'single entity-
multiple component' notion into a less abstract perspective of subsystems and
modules, depicting their interaction with one another. High-level design is
concerned with how the system and its components can be implemented as
modules. It recognizes the modular structure of each subsystem, as well as their
relationship and interaction with one another.
Detailed Design
After the high-level design is completed, the detailed design begins. Each module
is extensively investigated at this level of software design to establish the data
structures and algorithms to be used. Finally, a module specification
document is used to document the stage's outcome. It defines the logical
structure of each module as well as its interfaces with other modules.
division of a system into smaller elements that can be built independently and
then used in multiple systems to execute different purposes. Sometimes to deal
with Monolithic software, which is difficult to grasp for software engineers, it is
required to partition the software into components known as modules. As a
result, modularity in design has become a trend that is also essential.
Architecture
A system's software architecture represents the design decisions linked to the
general structure and behavior of the system. Architecture assists stakeholders
in comprehending and analyzing how the system will attain critical characteristics
such as modifiability, availability, and security. It specifies how components
of a software system are constructed, as well as their relationships and
communication. It acts as a software application blueprint and a development
foundation for the developer team.
Refinement
Refinement means removing any impurities and improving the quality of
something. The software design refinement idea is a process of building or
presenting the software or system in a detailed manner, which implies
elaborating on a system or software. In addition, refinement is essential for
identifying and correcting any possible errors.
Design Patterns
A Software Design Pattern is a general, reusable solution to a commonly
occurring problem within a given context in software design. They are templates
to solve common software engineering problems, representing some of the finest
practices experienced object-oriented software engineers utilize. A design
pattern systematically describes and explains a general design that handles a
recurring design challenge in object-oriented systems. It discusses the problem,
the remedy, when to use it, and the repercussions. It also provides
implementation guidance and examples.
Information/Data Hiding
Design Model
A design model in software engineering is an object-based picture or pictures that
represent the use cases for a system. Or to put it another way, it's the means to
describe a system's implementation and source code in a diagrammatic
fashion. Software modeling should address the entire software design including
interfaces, interactions with other software, and all the software methods.
Software models are ways of expressing a software design. Usually, some sort of
abstract language or pictures are used to express the software design. For object-
In almost all cases a modeling language is used to develop the design not just to
capture the design after it is complete. This allows the designer to try different
designs and decide which will be best for the final solution. Think of designing
your software as you would a house. You start by drawing a rough sketch of the
floor plan and layout of the rooms and floors. The drawing is your modeling
language and the resulting blueprint will be a model of your final design. You will
continue to modify your drawings until you arrive at a design that meets all your
requirements. Only then should you start cutting boards or writing code.
Again, the benefit of designing your software using a modeling language is that
you discover problems early and fix them without refactoring your code.
The design model builds on the analysis model by describing, in greater detail,
the structure of the system and how the system will be implemented. Classes
that were identified in the analysis model are refined to include the
implementation constructs.
The design model is based on the analysis and architectural requirements of the
system. It represents the application components and determines their
appropriate placement and use within the overall architecture.
In the design model, packages contain the design elements of the system, such
as design classes, interfaces, and design subsystems, that evolve from the
analysis classes. Each package can contain any number of subpackages that
further partition the contained design elements. These architectural layers form
the basis for a second-level organization of the elements that describe the
specifications and implementation details of the system.
Within each package, sequence diagrams illustrate how the objects in the classes
interact, state machine diagrams to model the dynamic behavior in classes,
component diagrams to describe the software architecture of the system, and
deployment diagrams to describe the physical architecture of the system.
Software Architecture
Software Architecture defines fundamental organization of a system and more
simply defines a structured solution. It defines how components of a software
system are assembled, their relationship and communication between them. It
serves as a blueprint for software application and development basis for
developer team.
Software architecture defines a list of things which results in making many things
easier in the software development process.
Besides all these software architectures is also important for many other factors
like quality of software, reliability of software, maintainability of software,
Supportability of software and performance of software and so on.
Architectural Styles
The software needs the architectural design to represent the design of the
software. IEEE defines architectural design as “the process of defining a collection
of hardware and software components and their interfaces to establish the
framework for the development of a computer system.” The software that is built
for computer-based systems can exhibit one of these many architectural styles.
Each style will describe a system category that consists of:
The use of architectural styles is to establish a structure for all the components
of the system.
Architectural styles provide several benefits. The most important of these benefits
is that they provide a common language.
Architectural Design
1. It defines an abstraction level at which the designers can specify the functional
and performance behavior of the system.
4. It develops and documents top-level design for the external and internal
interfaces.
6. It defines and documents preliminary test requirements and the schedule for
software integration.
Component-Level Design
Functional Independence
Coupling
1. No direct coupling: Two modules are said to be ‘no direct coupled’ if they
are independent of each other.
2. Data coupling: Two modules are said to be ‘data coupled’ if they use
parameter list to pass data items for communication.
3. Stamp coupling: Two modules are said to be ‘stamp coupled’ if they
communicate by passing a data structure that stores additional information
than what is required to perform their functions.
4. Control coupling: Two modules are said to be ‘control coupled’ if they
communicate (pass a piece of information intended to control the internal
logic) using at least one ‘control flag’. The control flag is a variable whose
value is used by the dependent modules to make decisions.
5. Content coupling: Two modules are said to be ‘content coupled’ if one
module modifies data of some other module or one module is under the
control of another module or one module branches into the middle of
another module.
6. Common coupling: Two modules are said to be ‘common coupled’ if they
both reference a common data block.
Cohesion
“User Experience Design” is often used interchangeably with terms such as “User
Interface Design” and “Usability.” However, while usability and user interface (UI)
design are important aspects of UX design, they are subsets of it.
User interface is the front-end application view to which user interacts in order to
use the software. The software becomes more popular if its user interface is:
• Attractive
• Simple to use
• Responsive in short time
• Clear to understand
• Consistent on all interface screens
The analysis and design process of a user interface is iterative and can be
represented by a spiral model. The analysis and design process of user interface
consists of four framework activities.
Design issues such as response time, command and action structure, error
handling, and help facilities are considered as the design model is refined.
This phase serves as the foundation for the implementation phase.
3. Interface construction and implementation: The implementation
activity begins with the creation of prototype (model) that enables usage
scenarios to be evaluated. As iterative design process continues a User
Interface toolkit that allows the creation of windows, menus, device
interaction, error messages, commands, and many other elements of an
interactive environment can be used for completing the construction of an
interface.
4. Interface Validation: This phase focuses on testing the interface. The
interface should be in such a way that it should be able to perform tasks
correctly and it should be able to handle a variety of tasks. It should achieve
all the user’s requirements. It should be easy to use and easy to learn.
Users should accept the interface as a useful one in their work.
Golden Rules:
The following are the golden rules stated by Theo Mandel that must be followed
during the design of the interface. Place the user in control:
• Define the interaction modes in such a way that does not force the user
into unnecessary or undesired actions: The user should be able to easily
enter and exit the mode with little or no effort.
• Provide for flexible interaction: Different people will use different
interaction mechanisms, some might use keyboard commands, some might
use mouse, some might use touch screen, etc, Hence all interaction
mechanisms should be provided.
• Allow user interaction to be interruptible and undoable: When a user is
doing a sequence of actions the user must be able to interrupt the sequence
to do some other work without losing the work that had been done. The
user should also be able to do undo operation.
• Streamline interaction as skill level advances and allow the interaction to
be customized: Advanced or highly skilled user should be provided a chance
to customize the interface as user wants which allows different interaction
mechanisms so that user doesn’t feel bored while using the same
interaction mechanism.
• Hide technical internals from casual users: The user should not be aware
of the internal technical details of the system. He should interact with the
interface just to do his work.
• Design for direct interaction with objects that appear on screen: The user
should be able to use the objects and manipulate the objects that are
present on the screen to perform a necessary task. By this, the user feels
easy to control over the screen.
• Allow the user to put the current task into a meaningful context: Many
interfaces have dozens of screens. So it is important to provide indicators
consistently so that the user know about the doing work. The user should
also know from which page has navigated to the current page and from the
current page where can navigate.
• Maintain consistency across a family of applications: The development of
some set of applications all should follow and implement the same design,
rules so that consistency is maintained among applications.
• If past interactive models have created user expectations do not make
changes unless there is a compelling reason.
There are several key principles that software engineers should follow
when designing user interfaces:
There are three general classes of mobile code systems: remote evaluation, code-
on-demand and mobile agent.
1. Remote evaluation: A component on the source host has the know-how but
not the resources needed for performing a service. The component is transferred
to the destination host, where it is executed using the available resource. The
result is returned to the source host.
2. Code-on-Demand:
Here the needed resources are available locally, but the know-how is not known.
The local sub-system thus requests the component providing the know-how from
the appropriate remote host. The code-on-demand requires the same steps as
remote-evaluation, the only difference is that roles of target and destination hosts
are reserved.
3. Mobile agent:
If a component on a given host has the know-how for providing some service,
has some execution state and has access to some of the resources needed to
provide that service along with its state and local resources, may migrate to the
destination host, which may have remaining resources need for providing the
service. From a software architectural perspective, mobile agents are stateful
software components.
There are some factors which has to be taken care of while migrating the code,
some architectural concerns of which engineers must be aware are:
Pattern-Based Design
Design patterns can be broken down into three types, organized by their intent
into creational design patterns, structural design patterns, and behavioral design
patterns.
A creational design pattern deals with object creation and initialization, providing
guidance about which objects are created for a given situation. These design
patterns are used to increase flexibility and to reuse existing code.
• Factory Method: Creates objects with a common interface and lets a class
defer instantiation to subclasses.
• Abstract Factory: Creates a family of related objects.
• Builder: A step-by-step pattern for creating complex objects, separating
construction and representation.
• Prototype: Supports the copying of existing objects without code
becoming dependent on classes.
• Singleton: Restricts object creation for a class to only one instance.
A structural design pattern deals with class and object composition, or how to
assemble objects and classes into larger structures.
4. Prevent the Need for Refactoring Code - Since the design pattern is already
the optimal solution for the problem, this can avoid refactoring.
5. Lower the Size of the Codebase - Each pattern helps software developers
change how the system works without a full redesign. Further, as the “optimal”
solution, the design pattern often requires less code.
Dependable Systems
•Availability: the system and services are mostly available, with very little or
no down time.
•Safety: the systems do not pose unacceptable risks to the environment or the
health of users.
•Confidentiality: data and other information should not be divulged without intent
and authorization.
•Integrity: System data should not be modified without intent and authorization.
These attributes have some overlap among themselves. For example, just like
security, it is a weakest link phenomenon, in that the strength of the whole is
determined by the weakest link in the chain. Thus, for a product or system to be
considered dependable, it should possess all the aforementioned attributes.
Conversely, a system is not dependable in proportion to the degree of lack of
these dependability attributes. In most cases, dependability is also not a binary
phenomenon (present or absent) but based on gradations and acceptable
thresholds. These thresholds are specific to infrastructures such as electronic,
electromechanical, and quantum, as well as applications, such as
communications, process control, and data processing.
One of the keys for dependable systems is that they should be empirically
verifiable in terms of their dependability. That means that fashionable or trendy
methodologies that may be very popular need to be objectively assessed on the
basis of their true effectiveness. One of the measures for dependability is the
number of faults. Faults are errors in design or implementation that
cause failures. A failure is deemed to have occurred if any of the functional
specifications of the system are not met. Failures can range from minor to
catastrophic, depending upon the impact of failure on the system and the
immediate environment. Minor failures are referred to as errors. The underlying
faults may thus be prioritized, based on their potential impact. Lack of
dependability means that the system is undependable due to shortcoming in one
or more of the dependability attributes, caused by faults in the system and
potential cause of system failure.
Faults can manifest themselves during the operation of a system. Such faults are
known as active. Otherwise, the faults may be present and possibly manifest
themselves in the future. Such faults are referred to as dormant, and the purpose
of the testing phase in systems engineering is to discover as many dormant and
active faults as possible before deployment and general use of the tested system.
Dependability Properties
Principal properties:
• Availability: The probability that the system will be up and running and
able to deliver useful services to users.
• Reliability: The probability that the system will correctly deliver services
as expected by users.
• Safety: A judgment of how likely it is that the system will cause damage
to people or its environment.
• Security: A judgment of how likely it is that the system can resist
accidental or deliberate intrusions.
• Resilience: A judgment of how well a system can maintain the continuity
of its critical services in the presence of disruptive events such as
equipment failure and cyberattacks.
Socio-technical systems
There are interactions and dependencies between the layers in a system and
changes at one level ripple through the other levels. For dependability, a
systems perspective is essential.
Dependable processes
Explicitly defined
A process that has a defined process model that is used to drive the software
production process. Data must be collected during the process that proves that
the development team has followed the process as defined in the process model.
Repeatable
A process that does not rely on individual interpretation and judgment. The
process can be repeated across projects and with different team members,
irrespective of who is involved in the development.
Formal Methods
1. Requirements engineering
2. Architecture design
3. Implementation
4. Testing
5. Maintenance
6. Evolution
Some may argue that all these steps usually take place, but they must, to some
extent for at least usable software with longer perspectives for exploitation. Some
of the earlier steps – particularly design stages – may bring a sense of uncertainty
in terms of unforeseen problems later in the process. The reasons could be:
These are just some avoidable factors in the completion of complex projects.
Safety-critical systems, in particular, have a significant need for earlier fault
detection. It is crucial to validate software faultlessness where agile incremental
analysis and development bring about quality assurance concerns. Thus, that is
where the implementation of such techniques finds its highest demand.
B METHOD
Z NOTATION
EVENT-B
Evaluation
Before deciding on the use of formal methods, each architect must list the pros
and cons against resources available, as well as the system’s needs.
BENEFITS
Reliability Engineering
Objectives
The reason for the priority emphasis is that it is by far the most effective way of
working, in terms of minimizing costs and generating reliable products. The
primary skills that are required, therefore, are the ability to understand and
anticipate the possible causes of failures, and knowledge of how to prevent them.
It is also necessary to have knowledge of the methods that can be used for
analyzing designs and data.
What is Availability?
What is Reliability?
The formal definition of reliability does not always reflect the user's
perception of a system's reliability. Reliability can only be defined formally with
respect to a system specification i.e. a failure is a deviation from a
specification. Users don't read specifications and don't know how the system is
supposed to behave; therefore, perceived reliability is more important in practice.
Removing X% of the faults in a system will not necessarily improve the reliability
by X%. Program defects may be in rarely executed sections of the code so may
never be encountered by users. Removing these does not affect the perceived
reliability. Users adapt their behavior to avoid system features that may fail for
them. A program with known faults may therefore still be perceived as reliable
by its users.
Reliability Requirements
Fault-Tolerant Architectures
• Flight control systems, where system failure could threaten the safety of
passengers;
• Reactor systems where failure of a control system could lead to a chemical
or nuclear emergency;
• Telecommunication systems, where there is a need for 24/7 availability.
Good programming practices can be adopted that help reduce the incidence of
program faults. These programming practices support fault avoidance, detection,
and tolerance.
Program components should only be allowed access to data that they need for
their implementation. This means that accidental corruption of parts of the
program state by these components is impossible. You can control visibility by
using abstract data types where the data representation is private and you only
allow access to the data through predefined operations such as get () and put ().
All program take inputs from their environment and make assumptions about
these inputs. However, program specifications rarely define what to do if an input
is not consistent with these assumptions. Consequently, many programs behave
unpredictably when presented with unusual inputs and, sometimes, these are
threats to the security of the system. Consequently, you should always check
inputs before processing against the assumptions made about these inputs.
Error-prone constructs:
For systems that involve long transactions or user interactions, you should always
provide a restart capability that allows the system to restart after failure without
users having to redo everything that they have done.
Always give constants that reflect real-world values (such as tax rates) names
rather than using their numeric values and always refer to them by name You are
less likely to make mistakes and type the wrong value when you are using a name
rather than a value. This means that when these 'constants' change (for sure,
they are not really constant), then you only have to make the change in one place
in your program.
Reliability Measurement
1. Product Metrics
Product metrics are those which are used to build the artifacts, i.e., requirement
specification documents, system design documents, etc. These metrics help in
the assessment if the product is right sufficient through records on attributes like
usability, reliability, maintainability & portability. In these measurements are
taken from the actual body of the source code.
3. Process Metrics
Process metrics quantify useful attributes of the software development process &
its environment. They tell if the process is functioning optimally as they report on
characteristics like cycle time & rework time. The goal of process metric is to do
the right job on the first time through the process. The quality of the product is
a direct function of the process. So process metrics can be used to estimate,
monitor, and improve the reliability and quality of software. Process metrics
describe the effectiveness and quality of the processes that produce the software
product.
Examples are:
To achieve this objective, a number of faults found during testing and the failures
or other problems which are reported by the user after delivery are collected,
summarized, and analyzed. Failure metrics are based upon customer information
regarding faults found after release of the software. The failure data collected is
therefore used to calculate failure density, Mean Time between Failures
(MTBF), or other parameters to measure or predict software reliability.
Agile methods are not usually used for safety-critical systems engineering.
Extensive process and product documentation is needed for system regulation,
which contradicts the focus in agile methods on the software itself. A detailed
safety analysis of a complete system specification is important, which contradicts
the interleaved development of a system specification and program. However,
some agile techniques such as test-driven development may be used.
• Do we have the right processes? Are the processes appropriate for the
level of dependability required. Should include requirements management,
change management, reviews and inspections, etc.
• Are we doing the processes right? Have these processes been followed
by the development team.
Static program analysis uses software tools for source text processing. They
parse the program text and try to discover potentially erroneous conditions and
bring these to the attention of the V & V team. They are very effective as an aid
to inspections - they are a supplement to but not a replacement for inspections.
The static analyzer can check for patterns in the code that are characteristic of
errors made by programmers using a particular language.
Users of a programming language define error patterns, thus extending the types
of error that can be detected. This allows specific rules that apply to a program
to be checked.
Assertion checking
Developers include formal assertions in their program and relationships that must
hold. The static analyzer symbolically executes the code and highlights potential
problems.
Safety-critical systems
Safety terminology
Term Definition
An unplanned event or sequence of events which results in human death
Accident
or injury, damage to property, or to the environment. An overdose of
(mishap)
insulin is an example of an accident.
A measure of the loss resulting from a mishap. Damage can range from
Damage many people being killed as a result of an accident to minor injury or
property damage.
This is a measure of the probability that the system will cause an accident.
Risk The risk is assessed by considering the hazard probability, the hazard
severity, and the probability that the hazard will lead to an accident.
Hazard avoidance
The system is designed so that some classes of hazard simply cannot arise.
The system is designed so that hazards are detected and removed before they
result in an accident.
Damage limitation
The system includes protection features that minimize the damage that may
result from an accident.
Accidents in complex systems rarely have a single cause as these systems are
designed to be resilient to a single point of failure. Almost all accidents are a
result of combinations of malfunctions rather than single failures. It is probably
the case that anticipating all problem combinations, especially, in software-
controlled systems is impossible so achieving complete safety is impossible.
However, accidents are inevitable.
Safety Requirements
Hazard-driven analysis:
Hazard identification
Identify the hazards that may threaten the system. Hazard identification may be
based on different types of hazards: physical, electrical, biological, service
failure, etc.
Hazard assessment
The process is concerned with understanding the likelihood that a risk will
arise and the potential consequences if an accident or incident should occur.
Risks may be categorized as: intolerable (must never arise or result in an
accident), as low as reasonably practical - ALARP (must minimize the
possibility of risk given cost and schedule constraints), and acceptable (the
consequences of the risk are acceptable and no extra costs should be incurred to
reduce hazard probability).
cleaning up pollution may be less than the costs of preventing it but this may not
be socially acceptable). Risk assessment is subjective.
Hazard assessment process: for each identified hazard, assess hazard probability,
accident severity, estimated risk, acceptability.
Hazard analysis
• Put the risk or hazard at the root of the tree and identify the system states
that could lead to that hazard.
• Where appropriate, link these with 'and' or 'or' conditions.
• A goal should be to minimize the number of single causes of system failure.
Risk reduction
Safety Cases
A safety case is a written proof that identifies the hazards and risks of a
manufactured product or installation. A safety case is a structured argument,
supported by evidence, intended to justify that a system is acceptably safe, and
when there is danger or damage to make it as low as reasonably possible
(ALARP). In industries like transportation and medicine, safety cases are
mandatory and legally binding. Safety cases tend to be presented in a document
of textual information and requirements accompanied by a graphical notation.
The most popular way to this graphical notation is using the Goal Structure
Notation (GSN). Even though a requirement in the automotive ISO 26262, the
GSN notation is not some farfetched complex. It is basically sets the goals, the
strategies justifying the claims and evidence, and a solution to make that goal
safe.
The elements of the Goal Structured Notation have a Symbol plus a count, and
are inside a shape. They are as following: (*N represents a number that grows
to N+1 on each preceding)
So, considering how a safety case in the GSN notation is structured any program
that can make sketches like Microsoft Visio or mind map could work. But there is
a tool specifically for this it is called ASTHA-GSN. It has an student license, and
the tool has some major pluses:
Security Engineering
Dimensions of security:
Reliability terminology
Term Description
Something of value which has to be protected. The asset may be
Asset
the software system itself or data used by that system.
An exploitation of a system's vulnerability. Generally, this is from
Attack outside the system and is a deliberate attempt to cause some
damage.
A protective measure that reduces a system's vulnerability.
Control Encryption is an example of a control that reduces a vulnerability of
a weak access control system.
Possible loss or harm to a computing system. This can be loss or
Exposure damage to data, or can be a loss of time and effort if recovery is
necessary after a security breach.
Circumstances that have potential to cause loss or harm. You can
Threat think of these as a system vulnerability that is subjected to an
attack.
Vulnerability avoidance
The system is designed so that vulnerabilities do not occur. For example, if there
is no external network connection then external attack is impossible.
If a system is attacked and the system or its data are corrupted as a consequence
of that attack, then this may induce system failures that compromise the
reliability of the system.
An attack that corrupts the system or its data means that assumptions about
safety may not hold. Safety checks rely on analyzing the source code of safety
critical software and assume the executing code is a completely accurate
translation of that source code. If this is not the case, safety-related failures may
be induced and the safety case made for the software is invalid.
Resilience is a system characteristic that reflects its ability to resist and recover
from damaging events. The most probable damaging event on networked
software systems is a cyberattack of some kind so most of the work now done in
resilience is aimed at deterring, detecting and recovering from such attacks.
Security policies should set out general information access strategies that
should apply across the organization. The point of security policies is to inform
everyone in an organization about security so these should not be long and
detailed technical documents. From a security engineering perspective, the
security policy defines, in broad terms, the security goals of the organization. The
security engineering process is concerned with implementing these goals.
For sensitive personal information, a high level of security is required; for other
information, the consequences of loss may be minor so a lower level of security
is adequate.
The security policy should set out what is expected of users e.g. strong
passwords, log out of computers, office security, etc.
For reasons of practicality and cost, it may be essential to continue to use existing
approaches to security even where these have known limitations.
The aim of this initial risk assessment is to identify generic risks that are
applicable to the system and to decide if an adequate level of security can be
achieved at a reasonable cost. The risk assessment should focus on the
identification and analysis of high-level risks to the system. The outcomes of the
risk assessment process are used to help identify security requirements.
This risk assessment takes place during the system development life cycle and is
informed by the technical system design and implementation decisions. The
results of the assessment may lead to changes to the security requirements and
the addition of new requirements. Known and potential vulnerabilities are
identified, and this knowledge is used to inform decision making about the system
functionality and how it is to be implemented, tested, and deployed.
This risk assessment process focuses on the use of the system and the possible
risks that can arise from human behavior. Operational risk assessment should
continue after a system has been installed to take account of how the system is
used. Organizational changes may mean that the system is used in different ways
from those originally planned. These changes lead to new security requirements
that have to be implemented as the system evolves.
Security Requirements
• When safety failures occur, you can look for the root cause or
weakness that led to the failure. When failure results from a deliberate
attack, the attacker may conceal the cause of the failure.
• Shutting down a system can avoid a safety-related failure. Causing a
shutdown may be the aim of an attack.
• Safety-related events are not generated from an intelligent
adversary. An attacker can probe defenses over time to discover
weaknesses.
• Risk avoidance requirements set out the risks that should be avoided by
designing the system so that these risks simply cannot arise.
• Risk detection requirements define mechanisms that identify the risk if it
arises and neutralize the risk before losses occur.
• Risk mitigation requirements set out how the system should be designed
so that it can recover from and restore system assets after some loss has
occurred.
• Asset identification: identify the key system assets (or services) that
have to be protected.
• Asset value assessment: estimate the value of the identified assets.
• Exposure assessment: assess the potential losses associated with each
asset.
Design risk assessment is done while the system is being developed and after
it has been deployed. More information is available - system platform, middleware
and the system architecture and data organization. Vulnerabilities that arise from
design choices may therefore be identified.
Distributing assets means that attacks on one system do not necessarily lead to
complete loss of system service. Each platform has separate protection features
and may be different from other platforms so that they do not share a common
vulnerability. Distribution is particularly important if the risk of denial-of-service
attacks is high.
These are potentially conflicting. If assets are distributed, then they are more
expensive to protect. If assets are protected, then usability and performance
requirements may be compromised.
o Fail securely - When systems fail, for whatever reason, ensure that
sensitive information cannot be accessed by unauthorized users even
although normal security procedures are unavailable.
o Balance security and usability - Try to avoid security procedures that
make the system difficult to use. Sometimes you have to accept weaker
security to make the system more usable.
o Log user actions - Maintain a log of user actions that can be analyzed to
discover who did what. If users know about such a log, they are less likely
to behave in an irresponsible way.
o Use redundancy and diversity to reduce risk - Keep multiple copies of
data and use diverse infrastructure so that an infrastructure vulnerability
cannot be the single point of failure.
o Specify the format of all system inputs - If input formats are known
then you can check that all inputs are within range so that unexpected
inputs don't cause problems.
o Compartmentalize your assets - Organize the system so that assets are
in separate areas and users only have access to the information that they
need rather than all system information.
o Design for deployment - Design the system to avoid deployment
problems
o Design for recoverability - Design the system to simplify recoverability
after a successful attack.
The main goal of Security Testing is to identify the threats in the system and
measure its potential vulnerabilities, so the threats can be encountered and the
system does not stop functioning or cannot be exploited. It also helps in detecting
all possible security risks in the system and helps developers to fix the problems
through coding.
There are seven main types of security testing as per Open-Source Security
Testing methodology manual. They are explained as follows:
It is always agreed, that cost will be more if we postpone security testing after
software implementation phase or after deployment. So, it is necessary to involve
security testing in the SDLC life cycle in the earlier phases.
Let’s look into the corresponding Security processes to be adopted for every
phase in SDLC
In security testing, different methodologies are followed, and they are as follows:
• Tiger Box: This hacking is usually done on a laptop which has a collection
of OSs and hacking tools. This testing helps penetration testers and security
testers to conduct vulnerabilities assessment and attacks.
• Black Box: Tester is authorized to do testing on everything about the
network topology and the technology.
• Grey Box: Partial information is given to the tester about the system, and
it is a hybrid of white and black box models.
The benefits of SSA extend from the companies that develop software to
the end users of that software. When procuring a third-party application, SSA
assures that you’re getting code built from the ground up with security in mind.
For software-led businesses that sell software to other companies or users, SSA
increases trust in your code. And, when coding custom web applications in-
house for your own company’s use, SSA can significantly reduce the likelihood of
breaches or compromises from basic security mistakes.
It’s important not to confuse the concept of SSA with the popular idea of shifting
security to the left. Shift left guard mainly focuses on moving security checks and
tests to earlier phases of the development cycle.
Software security assurance also differs from quality assurance in that the latter
is about ensuring software engineering processes meet defined policies and
standards, usually through testing. Security assurance, on the other hand, is
all about ensuring that software conforms to its security requirements
and doesn’t include any functionality that could compromise security.
Resilience Engineering
The resilience of a system is a judgment of how well that system can maintain
the continuity of its critical services in the presence of disruptive events, such
as equipment failure and cyberattacks. This view encompasses these three ideas:
Four related resilience activities are involved in the detection and recovery
from system problems:
Cybersecurity
Cybercrime is the illegal use of networked systems and is one of the most
serious problems facing our society. Cybersecurity is a broader topic than system
security engineering. Cybersecurity is a socio-technical issue covering all
aspects of ensuring the protection of citizens, businesses, and critical
infrastructures from threats that arise from their use of computers and the
Internet. Cybersecurity is concerned with all of an organization's IT assets from
networks through to application systems.
Cybersecurity threats:
Socio-technical Resilience
Resilience engineering is concerned with adverse external events that can lead to
system failure. To design a resilient system, you have to think about socio-
technical systems design and not exclusively focus on software. Dealing with
these events is often easier and more effective in the broader socio-technical
system.
Organizations should monitor both their internal operations and their external
environment for threats before they arise.
A resilient organization should not simply focus on its current operations but
should anticipate possible future events and changes that may affect its
operations and resilience.
People inevitably make mistakes (human errors) that sometimes lead to serious
system failures. There are two ways to consider human error:
Systems engineers should assume that human errors will occur during system
operation. To improve the resilience of a system, designers have to think about
the defense and barriers to human error that could be part of a system. Can
these barriers should be built into the technical components of the system
(technical barriers)? If not, they could be part of the processes, procedures and
guidelines for using the system (socio-technical barriers).
Defensive layers have vulnerabilities: they are like slices of Swiss cheese
with holes in the layer corresponding to these vulnerabilities. Vulnerabilities are
dynamic: the 'holes' are not always in the same place and the size of the holes
may vary depending on the operating conditions. System failures occur when the
holes line up and all of the defenses fail.
• Identifying critical services and assets that allow a system to fulfill its
primary purpose.
• Designing system components that support problem recognition,
resistance, recovery and reinstatement.
Service-oriented Architecture
together with a service contract that specifies the nature of the service,
how to use it, the requirements for the service, and the fees charged.
2. Service consumer: The service consumer can locate the service metadata
in the registry and develop the required client components to bind and use
the service.
Services might aggregate information and data retrieved from other services or
create workflows of services to satisfy the request of a given service consumer.
This practice is known as service orchestration Another important interaction
pattern is service choreography, which is the coordinated interaction of services
without a single point of control.
Components of SOA:
Advantages of SOA:
Disadvantages of SOA:
RESTful Services
REST emerged as the predominant Web service design model just a couple of
years after its launch, measured by the number of Web services that use it. Owing
to its more straightforward style, it has mostly displaced SOAP and WSDL-based
interface design.
RESTful Architecture:
a file on the server, or issue the DELETE request to delete a file from the
server.
2. Stateless, Layered, Caching-Support, Client/Server Architecture: A
type of architecture where the web browser acts as the client, and the web
server acts as the server hosting the application, is called a client/server
architecture. The state of the application should not be maintained by
REST. The architecture should also be layered, meaning that there can be
intermediate servers between the client and the end server. It should also
be able to implement a well-managed caching mechanism.
Service Engineering
Service Composition
Existing services are composed and configured to create new composite services
and applications. The basis for service composition is often a workflow. Workflows
are logical sequences of activities that, together, model a coherent business
process. For example, provide a travel reservation services which allows flights,
car hire and hotel bookings to be coordinated.
Systems Engineering
Systems Engineering is an engineering field that takes an interdisciplinary
approach to product development. Systems engineers analyze the collection of
pieces to make sure when working together, they achieve the intended objectives
or purpose of the product. For example, in automotive development, a propulsion
system or braking system will involve mechanical engineers, electrical engineers,
and a host of other specialized engineering disciplines. A systems engineer will
focus on making each of the individual systems work together into an integrated
whole that performs as expected across the lifecycle of the product.
A systems engineer is tasked with looking at the entire integrated system and
evaluating it against its desired outcomes. In that role, the systems engineer
must know a little bit about everything and have an ability to see the “big picture.”
While specialists can focus on their specific disciplines, the systems engineer must
evaluate the complex system as a whole against the initial requirements and
desired outcomes.
Systems engineers have multi-faceted roles to play but primarily assist with:
• Design compatibility
• Definition of requirements
• Management of projects
• Cost analysis
• Scheduling
• Possible maintenance needs
• Ease of operations
• Future systems upgrades
• Communication among engineers, managers, suppliers, and customers in
regards to the system’s operations
The systems engineering process can take a top-down approach, bottoms up, or
middle out depending on the system being developed. The process encompasses
all creative, manual, and technical activities necessary to define the ultimate
outcomes and see that the development process results in a product that meets
objectives.
systems that will integrate into one cohesive whole. The systems engineer
helps manage traceability and integration of the individual systems.
• Implementation/market launch: When everyone has executed their
roles properly, the final product is manufactured or launched with the
assurance that it will operate as expected in a complex system throughout
its anticipated life cycle.
Socio-technical systems
Socio-technical systems are large-scale systems that do not just include software
and hardware but also people, processes and organizational policies. Socio-
technical systems are often 'systems of systems' i.e., are made up of a number
of independent systems. The boundaries of socio-technical system are subjective
rather than objective: different people see the system in different ways.
There are a number of key elements in an organization that may affect the
requirements, design, and operation of a socio-technical system. A new system
may lead to changes in some or all of these elements:
• Functional properties: These appear when all the parts of a system work
together to achieve some objective. For example, a bicycle has the
functional property of being a transportation device once it has been
assembled from its components.
• Non-functional emergent properties: Examples are reliability,
performance, safety, and security. These relate to the behavior of the
system in its operational environment. They are often critical for computer-
based systems as failure to achieve some minimal defined level in these
properties may make the system unusable.
Failures are not independent and they propagate from one level to another.
System reliability depends on the context where the system is used. A system
that is reliable in one environment may be less reliable in a different environment
because the physical conditions (e.g., the temperature) and the mode of
operation is different.
Conceptual design
Conceptual design investigates the feasibility of an idea and develops that idea
to create an overall vision of a system. Conceptual design precedes and overlaps
with requirements engineering. May involve discussions with users and other
stakeholders and the identification of critical requirements. The aim of conceptual
design is to create a high-level system description that communicates the system
purpose to non-technical decision makers.
System Procurement
• The state of other organizational systems and whether or not they need to
be replaced
• The need to comply with external regulations
• External competition
• Business re-organization
• Available budget
• Off-the-shelf applications that may be used without change and which need
only minimal configuration for use.
• Configurable application or ERP systems that have to be modified or
adapted for use either by modifying the code or by using inbuilt
configuration features, such as process definitions and rules.
• Custom systems that have to be designed and implemented specially for
use.
System Development
System delivery and deployment takes place after completion, when the
system has to be installed in the customer's environment. A number of issues can
occur:
Operational processes are the processes involved in using the system for its
defined purpose. For new systems, these processes may have to be designed and
tested and operators trained in the use of the system. Operational processes
should be flexible to allow operators to cope with problems and periods of
fluctuating workload.
Large systems have a long lifetime. They must evolve to meet changing
requirements. Existing systems which must be maintained are sometimes called
legacy systems. Evolution is inherently costly for a number of reasons:
Computers are used to control a wide range of systems from simple domestic
machines, through games controllers, to entire manufacturing plants. Their
software must react to events generated by the hardware and, often, issue control
signals in response to these events. The software in these systems is
embedded in system hardware, often in read-only memory, and usually
responds, in real time, to events from the system's environment.
The design process for embedded systems is a system engineering process that
has to consider, in detail, the design and performance of the system hardware.
Part of the design process may involve deciding which system capabilities are to
be implemented in software and which in hardware. Low-level decisions on
hardware, support software and system timing must be considered early in the
process. These may mean that additional software functionality, such as battery
and power management, has to be included in the system.
Producer processes collect data and add it to the buffer. Consumer processes take
data from the buffer and make elements available. Producer and consumer
processes must be mutually excluded from accessing the same element. The
buffer must stop producer processes adding information to a full buffer and
consumer processes trying to take information from an empty buffer.
• Observe and React pattern is used when a set of sensors are routinely
monitored and displayed.
• Environmental Control pattern is used when a system includes sensors,
which provide information about the environment and actuators that can
change the environment.
• Process Pipeline pattern is used when data has to be transformed from
one representation to another before it can be processed.
The input values of a set of sensors of the same types are collected and analyzed.
These values are displayed in some way. If the sensor values indicate that some
exceptional condition has arisen, then actions are initiated to draw the operator's
attention to that value and, in certain cases, to take actions in response to the
exceptional value.
The system analyzes information from a set of sensors that collect data from the
system's environment. Further information may also be collected on the state of
the actuators that are connected to the system. Based on the data from the
sensors and actuators, control signals are sent to the actuators that then cause
changes to the system's environment. Information about the sensor values and
the state of the actuators may be displayed.
Stimuli - Values from sensors attached to the system and the state of the system
actuators.
A pipeline of processes is set up with data moving in sequence from one end of
the pipeline to another. The processes are often linked by synchronized buffers
to allow the producer and consumer processes to run at different speeds. The
culmination of a pipeline may be display or data storage or the pipeline may
terminate in an actuator.
Timing Analysis
The correctness of a real-time system depends not just on the correctness of its
outputs but also on the time at which these outputs were produced. In a timing
analysis, you calculate how often each process in the system must be executed
to ensure that all inputs are processed and all system responses produced in a
timely way. The results of the timing analysis are used to decide how frequently
each process should execute and how these processes should be scheduled by
the real-time operating system.
Real-time operating systems are specialized operating systems which manage the
processes in the RTS. Responsible for process management and
resource (processor and memory) allocation. May be based on a standard kernel
which
is used unchanged or modified for a particular
application. Do not normally include facilities such as file management.
The scheduler chooses the next process to be executed by the processor. This
depends on a scheduling strategy which may take the process priority into
account. The resource manager allocates memory and a processor for the process
to be executed. The dispatcher takes the process from ready list, loads it onto a
processor and starts execution.
Scheduling strategies:
Neural Networks
Neural networks can help computers make intelligent decisions with limited
human assistance. This is because they can learn and model the relationships
between input and output data that are nonlinear and complex. For instance, they
can do the following tasks.
A neural network would know that both sentences mean the same thing. Or it
would be able to broadly recognize that Baxter Road is a place, but Baxter Smith
is a person’s name.
Neural networks have several use cases across many industries, such as the
following:
Computer vision
• Visual recognition in self-driving cars so they can recognize road signs and
other road users
• Content moderation to automatically remove unsafe or inappropriate
content from image and video archives
• Facial recognition to identify faces and recognize attributes like open eyes,
glasses, and facial hair
• Image labeling to identify brand logos, clothing, safety gear, and other
image details
Speech recognition
Neural networks can analyze human speech despite varying speech patterns,
pitch, tone, language, and accent. Virtual assistants like Amazon Alexa and
automatic transcription software use speech recognition to do tasks like these:
Recommendation engines
The human brain is the inspiration behind neural network architecture. Human
brain cells, called neurons, form a complex, highly interconnected network and
send electrical signals to each other to help humans process information.
Similarly, an artificial neural network is made of artificial neurons that work
together to solve a problem. Artificial neurons are software modules, called
nodes, and artificial neural networks are software programs or algorithms that,
at their core, use computing systems to solve mathematical calculations.
Input Layer
Information from the outside world enters the artificial neural network from the
input layer. Input nodes process the data, analyze or categorize it, and pass it on
to the next layer.
Hidden Layer
Hidden layers take their input from the input layer or other hidden layers. Artificial
neural networks can have a large number of hidden layers. Each hidden layer
analyzes the output from the previous layer, processes it further, and passes it
on to the next layer.
Output Layer
The output layer gives the final result of all the data processing by the artificial
neural network. It can have single or multiple nodes. For instance, if we have a
binary (yes/no) classification problem, the output layer will have one output node,
which will give the result as 1 or 0. However, if we have a multi-class classification
problem, the output layer might consist of more than one output node.
Deep neural networks, or deep learning networks, have several hidden layers
with millions of artificial neurons linked together. A number, called weight,
represents the connections between one node and another. The weight is a
positive number if one node excites another, or negative if one node suppresses
the other. Nodes with higher weight values have more influence on the other
nodes.
Theoretically, deep neural networks can map any input type to any output type.
However, they also need much more training as compared to other machine
learning methods. They need millions of examples of training data rather than
perhaps the hundreds or thousands that a simpler network might need.
Artificial neural networks can be categorized by how the data flows from the input
node to the output node. Below are some examples:
Feedforward neural networks process data in one direction, from the input node
to the output node. Every node in one layer is connected to every node in the
next layer. A feedforward network uses a feedback process to improve predictions
over time.
Backpropagation algorithm
1. Each node makes a guess about the next node in the path.
2. It checks if the guess was correct. Nodes assign higher weight values to
paths that lead to more correct guesses and lower weight values to node
paths that lead to incorrect guesses.
3. For the next data point, the nodes make a new prediction using the higher
weight paths and then repeat Step 1.
hidden layer extracts and processes different image features, like edges, color,
and depth.
Biological Motivation
Motivation behind neural network is human brain. Human brain is called as the
best processor even though it works slower than other computers. Many
researchers thought to make a machine that would work in the prospective of the
human brain.
Human brain contains billion of neurons which are connected to many other
neurons to form a network so that if it sees any image, it recognizes the image
and processes the output.
Perceptron
We can model the decision boundary and the classification output in the Heaviside
step function equation, as follows:
To produce the net input to the activation function (here, the Heaviside step
function) we take the dot product of the input and the connection weights. We
see this summation in the left half of Figure 2-3 as the input to the summation
function.
If the bias value is negative, it forces the learned weights sum to be a much
greater value to get a 1 classification output. The bias term in this capacity moves
the decision boundary around for the model. Input values do not affect the bias
term, but the bias term is learned through the perceptron learning algorithm.
Multi-layer Perceptron
It is mainly similar to a single-layer perceptron model but has more hidden layers.
In a multilayer perceptron’s a group of neurons will be organized in multiple
layers. Every single neuron present in the first layer will take the input signal and
send a response to the neurons in the second layer and so on. A multilayer
perceptron model has a greater processing power and can process linear and non-
linear patterns.
• Forward Stage: From the input layer in the on stage, activation functions begin
and terminate on the output layer.
• Backward Stage: In the backward stage, weight and bias values are modified
per the model’s requirement. The backstage removed the error between the
actual output and demands originating backward on the output layer.
2. Synapse - The getting neuron can obtain the sign, process the same,
and sign the subsequent one. A neuron can send information or
signals through the synapse to another adjacent neuron. It processes
it and signals the subsequent one. This process in the perceptron
algorithm continues until an output signal is generated.
3. Input Nodes or Input Layer - This is the primary component of
Perceptron which accepts the initial data into the system for further
processing. Each input node contains a real numerical value. All the
Features of the model we want to train the neural network are taken
as inputs in the perceptron algorithm. Inputs are denoted as x1, x2,
x3, x4, … xn – ‘x’ in these inputs indicates the feature value and ‘n’
the total occurrences of these features.
4. Weight - Weight parameter represents the strength of the
connection between units. This is another most important parameter
of Perceptron components. These are values that are calculated
during the training of the model. Initially, we have to pass some
random values as values to the weights and these values get
automatically updated after each training error that is the values are
generated during the training of the model. In some cases, weights
can also be called as weight coefficients that occurs during hidden
layers which is donated w1, w2, w3, w4, ... wn. Weight is directly
proportional to the strength of the associated input neuron in deciding
the output.
5. Bias – Bias is a special input type which allows the classifier to move
the decision boundary around from its original position. The objective
of the bias is to shift each point in a particular direction for a specified
distance. Bias allows for higher quality and faster model training.
If you notice, we have passed value one as input in the starting and
W0 in the weights section. Bias is an element that adjusts the boundary away
from origin to move the activation function left, right, up or down. Since we want
this to be independent of the input features, we add constant one in the statement
so that the features will not get affected by this and this value is known as Bias.
• Sign function
• Sigmoid function
Based on the type of value we need as output we can change the activation
function. We can use the step function depending on the value required. Sigmoid
function and sign functions can be used for values between 0 and 1 and 1 and -
1, respectively. The sign function is a hyperbolic tangent function which is a zero
centered function making it easy the multi-layer neural networks. Rectified Linear
Unit (ReLu) is another step function that is highly computational and can be used
for values approaching zero – value more less than or more than zero.
The data scientist uses the activation function to take a subjective decision based
on various problem statements and forms the desired outputs. Activation function
may differ (e.g., Sign, Step, and Sigmoid) in perceptron models by checking
whether the learning process is slow or has vanishing or exploding gradients.
The neural network can compare the outputs of its nodes with the
desired values using a property known as the delta rule, allowing the
network to alter its weights through training to create more accurate
output values. This training and learning procedure results in gradient descent.
The technique of updating weights in multi-layered perceptron is virtually the
same, however, the process is referred to as back-propagation. In such
circumstances, the output values provided by the final layer are used to alter each
hidden layer inside the network.
Backpropagation
The Back propagation algorithm in neural network computes the gradient of the
loss function for a single weight by the chain rule. It efficiently computes one
layer at a time, unlike a native direct computation. It computes the gradient, but
it does not define how the gradient is used. It generalizes the computation in the
delta rule.
5. Travel back from the output layer to the hidden layer to adjust the weights
such that the error is decreased.
Activation Function
The activation function of a neuron defines its output given its inputs. The
activation function activates the neuron that is required for the desired output,
converts linear input to non-linear output. In neural networks, activation
functions, also known as transfer functions, define how the weighted sum of the
input can be transformed into output via nodes in a layer of networks. They are
treated as a crucial part of neural networks’ design.
1. Sigmoid Function:
Pros: As its range is between 0 and 1, it is ideal for situations where we need to
predict the probability of an event as an output.
Cons: The gradient values are significant for range -3 and 3 but become much
closer to zero beyond this range which almost kills the impact of the neuron on
the final output. Also, sigmoid outputs are not zero-centered (it is centred around
0.5) which leads to undesirable zig-zagging dynamics in the gradient updates for
the weights
Plot:
2. Tanh Function:
Pros: The derivatives of the tanh are larger than the derivatives of the sigmoid
which help us minimize the cost function faster
Cons: Similar to sigmoid, the gradient values become close to zero for wide range
of values (this is known as vanishing gradient problem). Thus, the network
refuses to learn or keeps learning at a very small rate.
Plot:
3. Softmax Function:
Pros: Can handle multiple classes and give the probability of belonging to each
class
4. ReLU Function:
Description: The rectified linear activation function or ReLU for short is a piecewise
linear function that will output the input directly if it is positive, otherwise, it will
output zero. This is the default function but modifying default parameters allows
us to use non-zero thresholds and to use a non-zero multiple of the input for
values below the threshold (called Leaky ReLU). Range: (0,inf)
Pros: Although RELU looks and acts like a linear function, it is a nonlinear function
allowing complex relationships to be learned and is able to allow learning through
all the hidden layers in a deep network by having large derivatives.
Cons: It should not be used as the final output layer for either
classification/regression tasks
Plot:
Loss Functions
The other key aspect in setting up the neural network infrastructure is selecting
the right loss functions. With neural networks, we seek to minimize the error
(difference between actual and predicted value) which is calculated by the loss
function.
Description: MSE loss is used for regression tasks. As the name suggests, this
loss is calculated by taking the mean of squared differences between
actual(target) and predicted values. Range: (0, inf)
Formula:
Pros: Preferred loss function if the distribution of the target variable is Gaussian
as it has good derivatives and helps the model converge quickly
Cons: Is not robust to outliers in the data (unlike loss functions like Mean Absolute
Error) and penalizes high and low predictions exponentially (unlike loss functions
like Mean Squared Logarithmic Error Loss)
Description: BCE loss is the default loss function used for the binary classification
tasks. It requires one output layer to classify the data into two classes and the
range of output is (0–1) i.e. should use the sigmoid function. Range: (0, inf)
Formula:
Pros: The continuous nature of the loss function helps the training process
converged well
Cons: Can only be used with sigmoid activation function. Other loss functions like
Hinge or Squared Hinge Loss can work with tanh activation function
Formula:
Pros: Similar to Binary Cross Entropy, the continuous nature of the loss function
helps the training process converged well
Cons: May require a one hot encoded vector with many zero values if there many
classes, requiring significant memory (should use Sparse Categorical Cross
entropy in this case)
Nothing is perfect in the world. Machine Learning has some serious limitations,
which are bigger than human errors.
1. Data Acquisition
The whole concept of machine learning is about identifying useful data. The
outcome will be incorrect if a credible data source is not provided. The quality of
the data is also significant. If the user or institution needs more quality data, wait
for it. It will cause delays in providing the output. So, machine learning
significantly depends on the data and its quality.
The data that machines process remains huge in quantity and differs greatly.
Machines require time so that their algorithm can adjust to the environment and
learn it. Trials runs are held to check the accuracy and reliability of the machine.
3. Results Interpretations
One of the biggest advantages of Machine learning is that interpreted data that
we get from the cannot be hundred percent accurate. It will have some degree of
inaccuracy. For a high degree of accuracy, algorithms should be developed so that
they give reliable results.
The error committed during the initial stages is huge, and if not corrected at that
time, it creates havoc. Biasness and wrongness have to be dealt with separately;
they are not interconnected. Machine learning depends on two factors, i.e., data
and algorithm. All the errors are dependent on the two variables. Any
incorrectness in any variables would have huge repercussions on the output.
5. Social Changes
With the advancement of machine learning, the nature of the job is changing.
Now, all the work are done by machine, and it is eating up the jobs for human
which were done earlier by them. It is difficult for those without technical
education to adjust to these changes.
8. Highly Expensive
This software is highly expensive, and not everybody can own it. Government
agencies, big private firms, and enterprises mostly own it. It needs to be made
accessible to everybody for wide use.
9. Privacy Concern
As we know that one of the pillars of machine learning is data. The collection of
data has raised the fundamental question of privacy. The way data is collected
and used for commercial purposes has always been a contentious issue. In
India, the Supreme court of India has declared privacy a fundamental right of
Indians. Without the user's permission, data cannot be collected, used, or stored.
However, many cases have come up that big firms collect the data without the
user's knowledge and using it for their commercial gains.
Machine learning is evolving concept. This area has not seen any major
developments yet that fully revolutionized any economic sector. The area requires
continuous research and innovation.
Deep Learning
The deep in deep learning isn’t a reference to any kind of deeper understanding
achieved by the approach; rather, it stands for this idea of successive layers of
representations.
Depth of the model - How many layers contribute to a model of the data is
called the depth of the model.
No. of layers
Modern deep learning often involves tens or even hundreds of successive layers
of representations— and they’re all learned automatically from exposure to
In deep learning, these layered representations are (almost always) learned via
models called neural networks, structured in literal layers stacked on top of each
other. The term neural network is a reference to neurobiology, but although some
of the central concepts in deep learning were developed in part by drawing
inspiration from our understanding of the brain, deep-learning models are not
models of the brain. There’s no evidence that the brain implements anything like
the learning mechanisms used in modern deep-learning models. For our
purposes, deep learning is a mathematical framework for learning representations
from data.
As you can see in figure 1.6, the network transforms the digit image into
representations that are increasingly different from the original image and
increasingly informative about the final result.
The specification of what a layer does to its input data is stored in the layer’s
weights, which in essence are a bunch of numbers. In technical terms, we’d say
that the transformation implemented by a layer is parameterized by its weights
(see figure 1.7). (Weights are also sometimes called the parameters of a layer.)
In this context, learning means finding a set of values for the weights of all layers
in a network, such that the network will correctly map example inputs to their
associated targets. But here’s the thing: a deep neural network can contain tens
of millions of parameters. Finding the correct value for all of them may seem like
a daunting task, especially given that modifying the value of one parameter will
affect the behaviour of all the others!
To control something, first you need to be able to observe it. To control the output
of a neural network, you need to be able to measure how far this output is from
what you expected. This is the job of the loss function of the network, also called
the objective function. The loss function takes the predictions of the network and
the true target (what you wanted the network to output) and computes a distance
score, capturing how well the network has done on this specific example (see
figure 1.8).
Optimizer
The fundamental trick in deep learning is to use this score as a feedback signal
to adjust the value of the weights a little, in a direction that will lower the loss
score for the current example (see figure 1.9). This adjustment is the job of the
optimizer, which implements what’s called the Backpropagation algorithm: the
central algorithm in deep learning.
Trained Network
Initially, the weights of the network are assigned random values, so the network
merely implements a series of random transformations. Naturally, its output is far
from what it should ideally be, and the loss score is accordingly very high. But
with every example the network processes, the weights are adjusted a little in
the correct direction, and the loss score decreases. This is the training loop,
which, repeated a sufficient number of times (typically tens of iterations over
thousands of examples), yields weight values that minimize the loss function. A
network with a minimal loss is one for which the outputs are as close as they can
be to the targets: a trained network.
DL achieved so far?
Definition of CNN
They are specifically designed to process pixel data and are used in image
recognition and processing. CNN specializes in processing data that has a grid-
like topology, such as an image. A digital image is a binary representation of
visual data. It contains a series of pixels arranged in a grid-like fashion that
contains pixel values to denote how bright and what color each pixel should be.
CNN architecture
Convolutional Neural Network consists of multiple layers like the input layer,
Convolutional layer, Pooling layer, and fully connected layers.
The Convolutional layer applies filters to the input image to extract features, the
Pooling layer down samples the image to reduce computation, and the fully
connected layer makes the final prediction. The network learns the optimal filters
through backpropagation and gradient descent.
Convolution Neural Networks or covnets are neural networks that share their
parameters. Imagine you have an image. It can be represented as a cuboid
having its length, width (dimension of the image), and height (i.e the channel as
images generally has red, green, and blue channels).
Now imagine taking a small patch of this image and running a small neural
network, called a filter or kernel on it, with say, K outputs and representing them
vertically. Now slide that neural network across the whole image, as a result, we
will get another image with different widths, heights, and depths. Instead of just
R, G, and B channels now we have more channels but lesser width and height.
This operation is called Convolution. If the patch size is the same as that of the
image it will be a regular neural network. Because of this small patch, we have
fewer weights.
Now let’s talk about a bit of mathematics that is involved in the whole convolution
process.
• Input Layers: It’s the layer in which we give input to our model. In CNN,
Generally, the input will be an image or a sequence of images. This layer
holds the raw input of the image with width 32, height 32, and depth 3.
• Convolutional Layers: This is the layer, which is used to extract the
feature from the input dataset. It applies a set of learnable filters known as
the kernels to the input images. The filters/kernels are smaller matrices
usually 2×2, 3×3, or 5×5 shape. it slides over the input image data and
computes the dot product between kernel weight and the corresponding
input image patch. The output of this layer is referred ad feature maps.
Suppose we use a total of 12 filters for this layer we’ll get an output volume
of dimension 32 x 32 x 12.
• Activation Layer: By adding an activation function to the output of the
preceding layer, activation layers add nonlinearity to the network. it will
apply an element-wise activation function to the output of the convolution
layer. Some common activation functions are RELU: max(0,
x), Tanh, Leaky RELU, etc. The volume remains unchanged hence output
volume will have dimensions 32 x 32 x 12.
• Pooling layer: This layer is periodically inserted in the covnets and its
main function is to reduce the size of volume which makes the computation
fast reduces memory and also prevents overfitting. Two common types of
pooling layers are max pooling and average pooling. If we use a max
pool with 2 x 2 filters and stride 2, the resultant volume will be of dimension
16x16x12.
• Output Layer: The output from the fully connected layers is then fed into
a logistic function for classification tasks like sigmoid or SoftMax which
converts the output of each class into the probability score of each class.
Recurrent Neural Network (RNN) is a type of Neural Network where the output
from the previous step is fed as input to the current step. In traditional neural
networks, all the inputs and outputs are independent of each other, but in cases
when it is required to predict the next word of a sentence, the previous words are
required and hence there is a need to remember the previous words. Thus, RNN
came into existence, which solved this issue with the help of a Hidden Layer. The
main and most important feature of RNN is its Hidden state, which remembers
some information about a sequence. The state is also referred to as Memory State
since it remembers the previous input to the network. It uses the same
parameters for each input as it performs the same task on all the inputs or hidden
layers to produce the output. This reduces the complexity of parameters, unlike
other neural networks.
The Recurrent Neural Network consists of multiple fixed activation function units,
one for each time step. Each unit has an internal state which is called the hidden
state of the unit. This hidden state signifies the past knowledge that the network
currently holds at a given time step. This hidden state is updated at every time
step to signify the change in the knowledge of the network about the past. The
hidden state is updated using the following recurrence relation: -
where:
where:
Yt -> output
These parameters are updated using Backpropagation. However, since RNN works
on sequential data here we use an updated backpropagation which is known as
Backpropagation through time.
4. One can go as many time steps according to the problem and join the
information from all the previous states.
5. Once all the time steps are completed the final current state is used to
calculate the output.
6. The output is then compared to the actual output i.e the target output and
the error is generated.
7. The error is then back-propagated to the network to update the weights
and hence the network (RNN) is trained using Backpropagation through
time.
To overcome the problems like vanishing gradient and exploding gradient descent
several new advanced versions of RNNs are formed some of these areas ;
Use Cases
1. Machine Translation:
RNN can be used to build a deep learning model that can translate text from one
language to another without the need for human intervention. You can, for
example, translate a text from your native language to English.
2. Text Creation:
RNNs can also be used to build a deep learning model for text generation. Based
on the previous sequence of words/characters used in the text, a trained model
learns the likelihood of occurrence of a word/character. A model can be trained
at the character, n-gram, sentence, or paragraph level.
3. Captioning of images:
The process of creating text that describes the content of an image is known as
image captioning. The image's content can depict the object as well as the action
of the object on the image. In the image below, for example, the trained deep
learning model using RNN can describe the image as "A lady in a green coat is
reading a book under a tree.”
4. Recognition of Speech:
Speech recognition technologies that are used on a daily basis by various users
include Alexa, Cortana, Google Assistant, and Siri.
After being trained on historical time-stamped data, an RNN can be used to create
a time series prediction model that predicts the future outcome. The stock market
is a good example.
You can use stock market data to build a machine learning model that can forecast
future stock prices based on what the model learns from historical data. This can
assist investors in making data-driven investment decisions.