Software Engineering Notes
Software Engineering Notes
Semester-3
BCA 301
Software Engineering
(According to Purvanchal University Syllabus)
Unit – 1
Introduction
Introduction to Software Engineering–
Software engineering is an engineering branch associated with
development of software product using well-defined scientific principles,
methods and procedures. The outcome of software engineering is an
efficient and reliable software product.
Software project management has wider scope than software engineering
process as it involves communication, pre and post delivery support etc.
Software is more than just a program code. A program is an executable
code, which serves some computational purpose. Software is considered to
be collection of executable programming code, associated libraries and
documentations. Software, when made for a specific requirement is
called software product.
Engineering on the other hand, is all about developing products, using well-
defined, scientific principles and methods.
Importance of Software–
Talking about Software than it plays a major role in daily life. It is an
application which gives a helping hand to the organization to manage data,
resources, performance, and also manages all the internal task and
communication for fruitful result.
Operational
Transitional
Maintenance
Well-engineered and crafted software is expected to have the following
characteristics:
Operational
This tells us how well software works in operations. It can be measured on:
Budget
Usability
Efficiency
Correctness
Functionality
Dependability
Security
Safety
Transitional
This aspect is important when the software is moved from one platform to
another:
Portability
Interoperability
Reusability
Adaptability
Maintenance
This aspect briefs about how well software has the capabilities to maintain itself
in the ever-changing
changing environment:
Modularity
Maintainability
Flexibility
Scalability
Communication
This is the first step where the user initiates the request for a desired software
product. He contacts the service provider and tries to negotiate the terms. He
submits his request to the service providing organization in writing.
Requirement Gathering
This step onwards the software development team works to carry on the project.
The team holds discussions with various stakeholders from problem domain and
tries to bring out as much information as possible on their requirements. The
requirements are contemplated and segregated into user requirements, system
requirements and functional requirements. The requirements are collected using
a number of practices as given -
System Analysis
At this step the developers decide a roadmap of their plan and try to bring up the
best software model suitable for the project. System analysis includes
Understanding of software product limitations, learning system related problems
or changes to be done in existing systems beforehand, identifying and addressing
the impact of project on organization and personnel etc. The project team
analyzes the scope of the project and plans the schedule and resources
accordingly.
Software Design
Next step is to bring down whole knowledge of requirements and analysis on the
desk and design the software product. The inputs from users and information
gathered in requirement gathering phase are the inputs of this step. The output
of this step comes in the form of two designs; logical design and physical design.
Engineers produce meta-data and data dictionaries, logical diagrams, data-flow
diagrams and in some cases pseudo codes.
Coding
This step is also known as programming phase. The implementation of software
design starts in terms of writing program code in the suitable programming
language and developing error-free executable programs efficiently.
Testing
An estimate says that 50% of whole software development process should be
tested. Errors may ruin the software from critical level to its own removal.
Software testing is done while coding by the developers and thorough testing is
conducted by testing experts at various levels of code such as module testing,
program testing, product testing, in-house testing and testing the product at
user’s end. Early discovery of errors and their remedy is the key to reliable
software.
Integration
Software may need to be integrated with the libraries, databases and other
program(s). This stage of SDLC is involved in the integration of software with
outer world entities.
Implementation
This means installing the software on user machines. At times, software needs
post-installation configurations at user end. Software is tested for portability and
adaptability and integration related issues are solved during implementation.
how to operate the software and how to keep the software operational. The
software is maintained timely by updating the code according to the changes
taking place in user end environment or technology. This phase may face
challenges from hidden bugs and real-world unidentified problems.
Disposition
As time elapses, the software may decline on the performance front. It may go
completely obsolete or may need intense up gradation. Hence a pressing need to
eliminate a major portion of the system arises. This phase includes archiving data
and required software components, closing down the system, planning
disposition activity and terminating system at appropriate end-of-system time.
Unit – 2
Software Requirement Specification
Software Process–
In software engineering, a software development process is the process of
dividing software development work into distinct phases to improve design,
product management, and project management. It is also known as a
software development life cycle.
Implementation − With inputs from the system design, the system is first
developed in small programs called units, which are integrated in the next
phase. Each unit is developed and tested for its functionality, which is referred
to as Unit Testing.
Increment Model–
In the Iterative Increment model, iterative process starts with a simple
implementation of a small set of the software requirements and iteratively
enhances the evolving versions until the complete system is implemented
and ready to be deployed.
Iterative process starts with a simple implementation of a subset of the
software requirements and iteratively enhances the evolving versions until
the full system is implemented.
Identification
This phase starts with gathering the business requirements in the baseline
spiral. In the subsequent spirals as the product matures, identification of
system requirements, subsystem requirements and unit requirements are
all done in this phase.
This phase also includes understanding the system requirements by
continuous communication between the customer and the system analyst.
At the end of the spiral, the product is deployed in the identified market.
Design
The Design phase starts with the conceptual design in the baseline spiral
and involves architectural design, logical design of modules, physical
product design and the final design in the subsequent spirals.
Construct or Build
Metrics
A Metric is a quantitative measure of the degree to which a system, system
component, or process possesses a given attribute.
Metrics can be defined as “STANDARDS OF MEASUREMENT”.
Software Metrics are used to measure the quality of the project. Simply,
Metric is a unit used for describing an attribute. Metric is a scale for
measurement.
Measurement
Measurement is the quantitative indication of extent, amount, dimension,
capacity, or size of some attribute of a product or process.
Test measurement example: Total number of defects.
Problem Analysis–
Problem analysis is the process of understanding real-world problems and
user's needs and proposing solutions to meet those needs.
The goal of problem analysis is to gain a better understanding,
before development begins, of the problem being solved.
To identify the root cause, or the problem behind the problem, ask the
people directly involved.
Identifying the actors on the system is a key step in problem analysis.
Requirement Specification –
A software requirements specification (SRS) is a document that captures
complete description about how the system is expected to perform. It is
usually signed off at the end of requirements engineering phase.
Qualities of SRS:
Correct
Unambiguous
Complete
Consistent
Ranked for importance and/or stability
Verifiable
Modifiable
Traceable
Types of Requirements:
The below diagram depicts the various types of requirements that are captured
during SRS.
Unit – 3
Software Design
Design Principles–
Once the requirements document for the software to be developed is
available, the software design phase begins. While the requirement
specification activity deals entirely with the problem domain, design is the
first phase of transforming the problem into a solution. In the design phase,
the customer and business requirements and technical considerations all
come together to formulate a product or a system.
Developing design is a cumbersome process as most expansive errors are
often introduced in this phase. Moreover, if these errors get unnoticed till
later phases, it becomes more difficult to correct them. Therefore, a
number of principles are followed while designing the software. These
principles act as a framework for the designers to follow a good design
practice.
how the design model satisfies all the requirements represented by the analysis
model.
2. Choose the right programming paradigm: A programming paradigm
describes the structure of the software system. Depending on the nature and type
of application, different programming paradigms such as procedure oriented,
object-oriented, and prototyping paradigms can be used. The paradigm should be
chosen keeping constraints in mind such as time, availability of resources and
nature of user's requirements.
3. Software design should be uniform and integrated: Software design
is considered uniform and integrated, if the interfaces are properly defined
among the design components. For this, rules, format, and styles are established
before the design team starts designing the software.
4. Software design should be flexible: Software design should be flexible
enough to adapt changes easily. To achieve the flexibility, the basic design
concepts such as abstraction, refinement, and modularity should be applied
effectively.
5. Software design should ensure minimal conceptual (semantic)
errors: The design team must ensure that major conceptual errors of design
such as ambiguousness and inconsistency are addressed in advance before
dealing with the syntactical errors present in the design model.
6. Software design should be structured to degrade gently: Software
should be designed to handle unusual changes and circumstances, and if the need
arises for termination, it must do so in a proper manner so that functionality of
the software is not affected.
7. Software design should represent correspondence between the
software and real-world problem: The software design should be
structured in such away that it always relates with the real-world problem.
8. Software reuse: Software engineers believe on the phrase: 'do not reinvent
the wheel'. Therefore, software components should be designed in such a
way that they can be effectively reused to increase the productivity.
9. Designing for testability: A common practice that has been followed is to
keep the testing phase separate from the design and implementation phases.
That is, first the software is developed (designed and implemented) and then
handed over to the testers who subsequently determine whether the software is
fit for distribution and subsequent use by the customer. However, it has become
apparent that the process of separating testing is seriously flawed, as if any type
Structured Approach–
The structured design approach helps developers deal with the size and
complexity of large scale projects. The structured approach is a process oriented
approach, aiming to break a large complex project into a series of smaller, more
manageable modules.
The Structured approach is usually associated with projects that have the
following characteristics:
Large budgets: Large projects will involve a large number of people and will
employ them over a long time scale. The budget, consequently, will be large. New
hardware and software is often required for completion of the project, elevating
the cost of the project - though the amount spent upon personnel is usually the
highest cost factor.
The steps of the structured approach are as follows:
Defining the problem: In this stage, the requirements for the software are
gathered and analyzed, to produce a complete and unambiguous specification of
what the software is required to do. The problem will need careful analysis so
that the "true" issues involved are identified. For example, if your car won't start,
your "problem" is "My car is not working". However, this is merely an analysis of
the "symptoms". Deeper analysis may reveal that there is no petrol in the car, or
the battery is flat or some other problem. Until the true cause of the problem is
discovered, a useable solution cannot be developed. This stage is sometimes
called Requirements Analysis.
Building: This is the Code and Test phase, in which each component of the
software is coded and tested to verify that it faithfully implements the detailed
design outlined in the previous phase. Finally, once all of the modules have been
coded and tested the software is integrated. Progressively larger groups of tested
software components are integrated and tested until the software works as a
whole. This process is sometimes called Software Integration.
Checking the solution: This involves Acceptance Testing, where tests are
applied and witnessed to validate that the software faithfully implements the
specified requirements. Real data may be used and this is compared to outputs
from a previous system. The system may also be tested under full load. A program
may work well for a small data set, but have problems when thousands or millions
of records and transactions are required of it. Beta testing may be used during
application software development. Users are also involved in this process to
ensure that their expectations of the system are fulfilled. In addition to the
feedback that the development team receives, users also benefit by being able to
use the system. In addition to checking that the program can process the data
correctly, the user interface is evaluated for ease of use and intuitive design.
FOD: Functions are grouped together by which a higher level function is Page on
obtained. an eg of this technique is SA/SD.
OOD: Functions are grouped together on the basis of the data they operate since
the classes are associated with their methods.
FOD: It views system as Black Box that performs high level function and later
decomposes it detailed function so to be mapped to modules.
OOD: Object-oriented design is the discipline of defining the objects and their
interactions to solve a problem that was identified and documented during
object-oriented analysis.
Design Verification
Verification Testing can be defined as a method of confirmation by
examining and providing evidence that the design output meets the design
input specifications. An essential process during any product development
that ensures the designed product is same as the intended use.
Design input is any physical and performance requirement that is used as
the basis for designing purpose. Design output is the result of each design
phase and at the end of total design effort. The final design output is a basis
for device master record.
better management control and early detection of project issues and caring
out appropriate corrective action to address those issues.
Cohesiveness–
The literary meanings of word "cohesion" are consistency and organization
of different units. In computer science and software
engineering, cohesion refers to the level of strength and unity with which
different components of a software program are inter-related with each
other.
Coupling–
Coupling is a measure that defines the level of inter-dependability among
modules of a program. It tells at what level the modules interfere and
interact with each other. The lower the coupling, the better the program.
Common coupling- When multiple modules have read and write access to
some global data, it is called common or global coupling.
Stamp coupling- When multiple modules share common data structure and
work on different part of it, it is called stamp coupling.
Data coupling- Data coupling is when two modules interact with each
other by means of passing data (as parameter). If a module passes data
structure as parameter, then the receiving module should use all its
components.
4GT TOOLS
• Currently, a software development environment that supports the 4GT
paradigm includes some or all of the following tools:
Requirements gathering
• Like other paradigms, 4GT begins with a requirements gathering step. •
Ideally, the customer would describe requirements and these would be
directly translated into an operational prototype. But this is unworkable. • The
customer may be unsure of what is required, may be ambiguous in specifying
facts that are known, and may be unable or unwilling to specify information in
a manner that a 4GT tool can consume.
Design
• For small applications, it may be possible to move directly from the
requirements gathering step to implementation using a nonprocedural fourth
generation language(4GL) or a model composed of a network of graphical
icons. • However, for larger efforts, it is necessary to develop a design strategy
for the system, even if a 4GL is to be used.
Implementation
• Implementation using a 4GL enables the software developer to represent
desired results in a manner that leads to automatic generation of code to
create those results. • Obviously, a data structure with relevant information
must exist and be readily accessible by the 4GL.
• Data collected from companies that use 4GT indicates that the time
required producing software is greatly reduced for small and intermediate
applications and that the amount of design and analysis for small applications
is also reduced.
• However, the use of 4GT for large software development efforts demands as
much or more analysis, design, and testing (software engineering activities) to
achieve substantial time savings that result from the elimination of coding.
Functional Independence–
The concept of functional Independence is a direct outgrowth of modularity
and the concepts of abstraction and information hiding.
Design software so that each module addresses a specific sub-function of
requirements and has a simple interface when viewed from other parts of
the program structure.
Software Architecture–
The architecture of a system describes its major components, their
relationships (structures), and how they interact with each other. Software
architecture and design includes several contributory factors such as
Business strategy, quality attributes, human dynamics, design, and IT
environment.
We can segregate Software Architecture and Design into two distinct
phases: Software Architecture and Software Design. In Architecture,
nonfunctional decisions are cast and separated by the functional
requirements. In Design, functional requirements are accomplished.
Unit – 4
Coding
Top Down & Bottom Up Programming–
All designs contain hierarchies, as creating a hierarchy is a natural way to
manage complexity. Most design methodologies for software also produce
hierarchies. The hierarchy may be of functional modules, as is the case with
the structured design methodology where the hierarchy of modules is
represented by the structure chart. Or, the hierarchy may be an object
hierarchy as is produced by object-oriented design methods and,
frequently, represented by object diagrams. The question at coding time is:
given the hierarchy of modules produced by design, in what order should
the modules be built-starting from the top level or starting from the
bottom level?
In a top-down implementation, the implementation starts from the top of
the hierarchy and proceeds to the lower levels. First, the main module is
implemented, then its subordinates are implemented, and their
subordinates, and so on. In a bottom-up implementation, the process is the
reverse. The development starts with implementing the modules at the
bottom of the hierarchy and proceeds through the higher levels until it
reaches the top.
Top-down and bottom-up implementation should not be confused with
top-down and bottom-up design. Here, the design is being implemented,
and if the design is fairly detailed and complete, its implementation can
proceed in either the top-down or the bottom-up manner, even if the
design was produced in a top-down manner. Which of the two is used,
mostly affects testing.
Structured Programming–
Structured coding practices translate a structured design into well-
structured code. PDL statements come in four different categories:
sequence, selection (IF-THEN-ELSE, CASE), iteration (WHITE, REPEAT-UNTIL,
FOR), and parallelism. Data statements included structure definitions and
Information Hiding–
A software solution to a problem always contains data structures that are
meant to represent information in the problem domain. That is, when
software is developed to solve a problem, the software uses some data
structures to capture the information in the problem domain. With the
problem information represented internally as data structures, the required
functionality of the problem domain, which is in terms of information in
that domain, can be implemented as software operations on the data
structures. Hence, any software solution to a problem contains data
structures that represent information in the problem domain.
If the information hiding principle is used, the data structure need not be
directly used and manipulated by other modules. All modules, other than
the access functions, access the data structure through the access
functions.
Information hiding can reduce the coupling between modules and make
the system more maintainable.
Programming Style
Why is programming style important? A well written program is more easily
read and understood both by the author and by others who work with that
program. Not even the author will long remember his precise thoughts on a
program. The program itself should help the reader to understand what it
does quickly because only a small fraction of the developers if any, are
maintaining the program they wrote. Others will, and they must be able to
understand what the program does. Bad programming style makes
program difficult to understand, hard to modify, and impossible to maintain
over a long period of time, even by the person who coded it originally.
Internal Documentation
This is the phase, which provides help to the programmer for further review
of the software and existing systems. In the coding phase, the output
document is the code itself. However, some amount of internal
documentation in the code can be extremely useful in enhancing the
understandability of programs. Internal documentation of programs is done
by the use of comments.
All languages provide a means for writing comments in programs.
Comments are textual statements that are meant for the program reader
and are not executed. Comments, if properly written and kept consistent
with the code, can be invaluable during maintenance.
Early Testing:
Defects detected in early phases of SDLC are less expensive to fix. So
conducting early testing reduces the cost of fixing defects.
Defect Clustering:
Defect Clustering in software testing means that a small module or
functionality contains most of the bugs or it has the most operational
failures.
Pesticide Paradox:
Pesticide Paradox in software testing is the process of repeating the same
test cases again and again, eventually, the same test cases will no longer
find new bugs. So to overcome this Pesticide Paradox, it is necessary to
review the test cases regularly and add or update them to find more
defects.
Levels of Testing–
Levels of testing include different methodologies that can be used while
conducting software testing. The main levels of software testing are −
Functional Testing
Non-functional Testing
Functional Testing–
This is a type of black-box testing that is based on the specifications of the
software that is to be tested. The application is tested by providing input
and then the results are examined that need to conform to the
functionality it was intended for. Functional testing of a software is
conducted on a complete, integrated system to evaluate the system's
compliance with its specified requirements.
There are five steps that are involved while testing an application for
functionality.
Steps Description
application.
III The output based on the test data and the specifications of
the application.
An effective testing practice will see the above steps applied to the testing
policies of every organization and hence it will make sure that the organization
maintains the strictest of standards when it comes to software quality.
Structural Testing–
Structural or White-box testing is the detailed investigation of internal logic
and structure of the code. White-box testing is also called glass
testing or open-box testing. In order to perform white-box testing on an
application, a tester needs to know the internal workings of the code.
The tester needs to have a look inside the source code and find out which
unit/chunk of the code is behaving inappropriately.
The following table lists the advantages and disadvantages of white-box testing.
Advantages Disadvantages
As the tester has knowledge of the Due to the fact that a skilled tester is
source code, it becomes very easy to find needed to perform white-box testing, the
out which type of data can help in testing costs are increased.
the application effectively.
Extra lines of code can be removed which It is difficult to maintain white-box testing,
can bring in hidden defects. as it requires specialized tools like code
analyzers and debugging tools.
Test Plane–
A test plan outlines the strategy that will be used to test an application, the
resources that will be used, the test environment in which testing will be
performed, and the limitations of the testing and the schedule of testing
activities. Typically the Quality Assurance Team Lead will be responsible for
writing a Test Plan.
A test plan includes the following −
Furthermore, test cases are written to keep track of the testing coverage of
a software. Generally, there are no formal templates that can be used
during test case writing. However, the following components are always
available and included in every test case −
Test case ID
Product module
Product version
Revision history
Purpose
Assumptions
Pre-conditions
Steps
Expected outcome
Actual outcome
Post-conditions
Many test cases can be derived from a single test scenario. In addition,
sometimes multiple test cases are written for a single software which are
collectively known as test suites.
Reliability assessment–
Software Reliability is the probability of failure-free software operation for
a specified period of time in a specified environment. Software Reliability is
also an important factor affecting system reliability. ... Measurement
in software is still in its infancy.
Software Reliability Assessment by Statistical Analysis of Operational
Experience. Statistical testing represents a well-founded approach to the
estimation of software reliability. ... The execution of a test case does not
influence the outcome of further test cases.
Leave time for fixing: Setting aside time for testing is pointless if there is no
time set aside for fixing. Once problems are discovered, developers required time
to fix them and the company needs time to retest the fixes as well. With a time
and plan for both, then testing is not very useful.
Discourage passing the buck: The same way that testers could fall short in
their reports, developers could also fall short in their effort to comprehend the
reports. One way of minimizing back and forth conversations between
developers and testers are having a culture that will encourage them to hop on
the phone or have desk-side chat to get to the bottom of things. Testing and
fixing are all about collaboration. Although it is important that developers should
not waste time on a wild goose chase, it is equally important that bugs are not
just shuffled back and forth.
Manual testing has to be exploratory: A lot of teams prefer to script manual
testing so testers follow a set of steps and work their way through a set of tasks
that are predefined for software testing. This misses the point of manual testing.
If something could be written down or scripted in exact terms, it could be
automated and belongs in the automated test suite. Real-world use of the
software will not be scripted, thus testers must be free to probe and break things
without a script.
Encourage clarity: Reporting bugs and asking for more information could
create unnecessary overhead costs. A good bug report could save time through
avoiding miscommunication or a need for more communication. In the same way,
a bad bug report could lead to a fast dismissal by a developer. These could create
problems. Anyone reporting bugs should make it a point to create bug reports
that are informative. However, it is also integral for a developer to out of the way
to effectively communicate as well.
Test often: The same as all other forms of testing, manual testing will work best
when it occurs often throughout the development project, in general, weekly or
bi-weekly. This helps in preventing huge backlogs of problems from building up
and crushing morale. Frequent testing is considered the best approach.
Testing and fixing software could be tricky, subtle and political even.
Nevertheless, as long as one is able to anticipate and recognize common
issues, things could be kept running smoothly.
Unit Testing–
This type of testing is performed by developers before the setup is handed
over to the testing team to formally execute the test cases. Unit testing is
performed by the respective developers on the individual units of source
code assigned areas. The developers use test data that is different from the
test data of the quality assurance team.
The goal of unit testing is to isolate each part of the program and show that
individual parts are correct in terms of requirements and functionality.
Limitations of Unit Testing
Testing cannot catch each and every bug in an application. It is impossible
to evaluate every execution path in every software application. The same is
the case with unit testing.
There is a limit to the number of scenarios and test data that a developer
can use to verify a source code. After having exhausted all the options,
there is no choice but to stop unit testing and merge the code segment
with other units.
Integration Testing–
Integration testing is defined as the testing of combined parts of an
application to determine if they function correctly. Integration testing can
be done in two ways: Bottom-up integration testing and Top-down
integration testing.
1 Bottom-up integration
This testing begins with unit testing, followed by tests of
progressively higher-level combinations of units called
modules or builds.
2 Top-down integration
Getting the feedback, the project team can fix the problems before
releasing the software to the actual users.
The more issues you fix that solve real user problems, the higher the
quality of your application will be.
Having a higher-quality application when you release it to the general
public will increase customer satisfaction.
Unit – 5
Software Project Management
Software is said to be an intangible product. Software development is a
kind of all new stream in world business and there’s very little experience
in building software products. Most software products are tailor made to
fit client’s requirements. The most important is that the underlying
technology changes and advances so frequently and rapidly that
experience of one product may not be applied to the other one.
The Process -
Every project may has a unique and distinct goal.
Project is not routine activity or day-to-day operations.
Project comes with a start time and end time.
Project ends when its goal is achieved hence it is a temporary phase in the
lifetime of an organization.
Project needs adequate resources in terms of time, manpower, finance,
material and knowledge-bank.
The Project-
A Software Project is the complete procedure of software development
from requirement gathering to testing and maintenance, carried out
according to the execution methodologies, in a specified period of time to
achieve intended software product.
Cost estimation –
This might be considered as the most difficult of all because it depends on
more elements than any of the previous ones. For estimating project cost,
it is required to consider -
o Size of software
o Software quality
o Hardware
o Additional software or tools, licenses etc.
o Skilled personnel with task-specific skills
o Travel involved
o Communication
o Training and support
Project scheduling-
Project Scheduling in a project refers to roadmap of all activities to be done
with specified order and within time slot allotted to each activity. Project
managers tend to define various tasks, and project milestones and they
arrange them keeping various factors in mind.
They look for tasks lie in critical path in the schedule, which are necessary
to complete in specific manner (because of task interdependency) and
strictly within the time allocated. Arrangement of tasks which lies out of
critical path are less likely to impact over all schedule of the project.
For scheduling a project, it is necessary to -