+ All Categories
Home > Education > Software engineering

Software engineering

Date post: 14-Aug-2015
Category:
Upload: prakash-poudel
View: 261 times
Download: 0 times
Share this document with a friend
Popular Tags:
40
Software Engineering Unit 1: Introduction What is Software Engineering? Software Engineering is the field of computer science that deals with the building of large or complex software systems by a team of software engineers or programmers. The software systems usually exist in multiple versions and are used for many years. During the lifetime of these softwares, they may have many changes to fix the defects, to enhance the existing features, to remove old features or to be adapted to run in a new environment. Software Engineering is also defined as “multi-person construction of multi-version software”. There is difference between programming and software engineering. A programmer writes a complete program, while a software engineer writes a software component that will be combined with components written by other software engineers to build a complete system. The component written by one software engineer may be modified by other software engineers or it may be used by others to build different versions of the system. Programming is primarily a personal activity, while software engineering is essentially a team activity. History of Software Engineering The term software engineering was introduced in the late 1960s after realizing that all the ideas about programming were not enough to build a better software system. Even the introduction of algorithms and structured programming were not able to solve the major difficulties in building large software systems. An engineering approach was needed to a) clearly define the problem to be solved b) use and develop standard tools and techniques for solving it The problems seen in building large software systems were not well understood and programmer had to spend a lot of time communicating with each other rather than writing codes. Many solutions were proposed like using better management techniques, different team organizations, better programming languages and tools, and use of mathematical approaches.
Transcript
Page 1: Software engineering

Software Engineering

Unit 1: Introduction

What is Software Engineering?

Software Engineering is the field of computer science that deals with the building of large or complex software systems by a team of software engineers or programmers. The software systems usually exist in multiple versions and are used for many years. During the lifetime of these softwares, they may have many changes to fix the defects, to enhance the existing features, to remove old features or to be adapted to run in a new environment.

Software Engineering is also defined as “multi-person construction of multi-version software”. There is difference between programming and software engineering. A programmer writes a complete program, while a software engineer writes a software component that will be combined with components written by other software engineers to build a complete system. The component written by one software engineer may be modified by other software engineers or it may be used by others to build different versions of the system. Programming is primarily a personal activity, while software engineering is essentially a team activity.

History of Software Engineering

The term software engineering was introduced in the late 1960s after realizing that all the ideas about programming were not enough to build a better software system. Even the introduction of algorithms and structured programming were not able to solve the major difficulties in building large software systems. An engineering approach was needed to

a) clearly define the problem to be solvedb) use and develop standard tools and techniques for solving it

The problems seen in building large software systems were not well understood and programmer had to spend a lot of time communicating with each other rather than writing codes. Many solutions were proposed like using better management techniques, different team organizations, better programming languages and tools, and use of mathematical approaches. Finally, it was realized that large and complex software systems should be built just like how engineers build bridges, airplanes, factories etc. The engineering approach required management, organization, tools, theories, methodologies, and techniques and thus the term software engineering was born.

Economics is another reason for software engineering to gain so much importance. Worldwide expenses on software systems have increased from millions to billions in recent years. We can see softwares everywhere in our society; in machines, aircrafts, medical devices, etc. This is also another reason for the rapid development of software engineering.

Page 2: Software engineering

Role of Software Engineering in System Design

Usually a software system is a seen as a component of a much larger system and the software engineering activity is a part of a much larger system design activity in which the software requirements should be matched with the requirements of other systems. For designing a software system for a departmental store, we have to consider the employees attendance, store management, computing facilities, telephones and cables etc. So it is expected that the software system that is to be developed should meet all the requirements of the whole system.

Nowadays software is being used in every other device like television sets to mobile devices, from entertainment to medical devices. So a software engineer needs to know the general problems and requirements of system engineering. For a proper system design, a software engineer need to

a) know the requirements of the whole systemb) understand the application area before starting the interface

The software life cycle

Every software system undergoes a gradual development and evolution from the starting until it is implemented and delivered. In this regard, a software system is said to have a life cycle composed of several phases. Each phase gives either a part of the system or a component associated with the system. A traditional life cycle model called the “waterfall method” has the following phases:

a) Requirement Analysis and Specification:- Requirement analysis is the first phase and is carried out after a feasibility study- Feasibility study defines the cost and benefits of a software system- This phase identifies the exact requirement and the study is carried out by the customer,

developer, marketing manager or by all- A lot of interaction is needed between the user and the developer if the requirements are not

clear

b) System Design and Specification- Once requirement analysis is done, the software engineer starts designing the software system- This phase is divided into two sub-phases

o Architectural or high level design Defines the overall organization of the system in terms of high-level

components and interactions among themo Detailed Design

Components are decomposed to lower level modules with precisely defined interfaces

- Usually answers the what-how questions- Makes clear about what the problem is and how it can be solved

Page 3: Software engineering

c) Coding and Module Testing- The software engineer writes the exact code that is to be delivered to the end user as a

running system- Codes for prototypes and testing may also be written by the developers- All the codes and modules are tested before being delivered to the next phase

d) Integration and System Testing- All the modules developed are integrated and tested as a whole system- If the testing gives positive results, then they are forwarded for the next phase. Otherwise

rollback changes may be carried out and debugging/maintenance of the module is performed

e) Delivery and Maintenance- Once the system passes all the tests, it is delivered to the customer and the system enters into

the next phase of maintenance- Any modification after the delivery of the system are usually taken in this step

Relationship of Software Engineering to other areas of computer science and other disciplines

Today software engineering has made its own mark as an important field of computer science and is making an influential presence in other fields as well. The following fields of computer science are related with the software engineering

1. Programming Languages- Programming languages are the central tools for software development and are related

intensely to achieve the software engineering goals- Today most programming languages support the modularity feature, ie, being able to do

separate and independent compilation. This feature largely helps for team development of large software

- Also the introduction of exception-handling in programming languages allows to detect and solve the problems while the software is running

- For starting a new software on any programming languages, proper requirement analysis and design specification is necessary; which are largely influenced by software engineering

2. Operating System- Operating systems were the first large software systems and were the first one to get

engineered. - Most of the software designing ideas were originated from building operating systems- Concepts in large software systems like virtual machines, levels of abstraction and separation of

policies are all initially introduced from operating system- Concepts and techniques from the structures of an operating system are considered while

developing large software systems

Page 4: Software engineering

3. Databases- Databases is another class of large software systems that influenced software engineering - Data independence is the feature of modern databases that influences for developing large

software systems- Data independence allows applications to be written that use data without worrying about the

underlying representations of the data- Another impact of database technology on software engineering is that it allows database

systems to be used as components of large software systems

4. Artificial Intelligence- Many software systems built in the field of artificial intelligence are large and complex systems. - AI based software systems were developed using the idea of exploratory development which is

slightly different than software engineering- In exploratory development, the designer goes through well-defined steps attempting to

produce a complete design before proceeding to coding- AI has given rise to new techniques in dealing with specifications, verification and reasoning

5. Theoretical Models- Theoretical Models based on computer science are also the useful tools of software

engineering- finite state machines provides basis for software specifications and models for software design

and structure- communication protocols and language analyzers use finite-state machines

Software Engineering in other disciplines

1. Management - Any new investment or new project needs estimation, scheduling, human resource planning,

task assignment and tracking- Software engineering concepts and approaches also provides management science about

testing management theories and models

2. System Engineering- System engineering always studies about complex systems and all complex systems is

composed of many components- Software is often a component in many complex systems and software engineering can be

applied in most system engineering designs

Page 5: Software engineering

Unit 2: Tools and Environments

Introduction

Software engineering activity always involves a large number of people performing a set of activities to produce a large number of components. The objective of tools and environment is to support the development, verification, maintenance, and evolution of processes and the components.

A tool supports a particular activity while an environment is the collection of related tools. The tools and environments aims at automating some of the activities involved in software engineering. Sometime tools are necessary to support an activity but at times they only help to make some tasks easier and efficient.

Historical Evolution of tools and environments

The tools and environments of software engineering are influenced by two factors

- Technological developments - Better understanding of software engineering processes

In early days, the software engineering activity was limited to programming and tools available were just the editors and compilers. Later the introduction of file systems enabled to store the programs online and to share with other programmers. The sharing of files led to the need of configuration and version management tools and other tools to support the team activities.

Introduction of graphical displays and graphical user interfaces also influenced the development of new tools to graphically express the designs. The introduction of distributed platforms also influenced the development of new tools for distributed configuration management and teamwork. Groupwares were developed to support teams regardless of their distance and also arranged members to have virtual meetings. Software distribution and deployment tools were also developed eventually.

During the earlier days of software engineering, individual tools were developed to support single activities like compiling and debugging. Later, the integrated environment were introduced that consisted tools that worked together. Development in open environment led to the introduction of tools with public interfaces that allows communication between other tools

Page 6: Software engineering

Classification of tools and environments

Software tools can be classified according to

- The level of formality they enforce- The life cycle phase they support- The interface they provide

Software tools can be classified according to the following criteria

1. Interaction mode- Software tools are categorized as batch oriented or interactive- Batch oriented tools support the application of unit of operations to a collection of documents- Interactive tools are useful to make change and to see the result of the change immediately- It is desirable that tools with support for both interactive and batch modes of operation

2. Interface Format- Software are developed with the objective of supporting the human-machine interface- The initial interfaces were all textual and command based. Then the introduction of graphical

tools brought the GUI- Technologies such as the multimedia interfaces, color, and hypertexts are widely used to make

human-computer interface more easier and productive- Software tools with support for viewing high-level design and details of modules help in quick

browsing of large designs

3. Level of Formality- Software developers produce a variety of documents and modules during the software

development and each document and modules can be written in any language whose syntax and semantics can be defined in more or less formal ways

- The functionality that software tools provide, is highly dependent on the level of formality of the language

- A compiler can be built only for a language whose syntax and semantics are known, while an editor can be built for any language

4. Dependency on phase of life cycle- Software tools are used in different activities and some of them are designed to help in specific

activity that is limited to a certain phase of the software life cycle- Tools can be classified on the basis of the phase they are intended to support- Some tools are used to write requirement specifications, some for specifying modules, some

for editing codes and some for debugging

5. Degree of Standardization- Standardization of an item enhances its applicability but also freezes its evolution- When a method or language is standardized, software producers invest more in developing

support for it.

Page 7: Software engineering

- Using standardized tools guarantees the supply of skilled people and portability of their knowledge from one project to the next

- Using non standardized software tools or OS, reduces the availability of skilled people and adds overhead of training

6. Language dependency- Some tools are associated with a particular language which are called monolingual, while other

tools are language independent also known as polylingual- For eg, text editors can be used for any programming language while there are specialized

graphical editors for UML diagrams or DFDs- Compilers are typical examples of monolingual tools while OS like UNIX, Windows are

polylingual- In general monolingual tools provide more specialized help but polylingual environment is

more open and portable

7. Static versus dynamic tools- Static tools are applied to create, modify and verify the consistency of objects with respect to

some rules, properties or some constructs.- Eg of static tool is the document or programming language parser that checks the correctness

of syntaxes- A tool that requires execution of the object it operates on is called a dynamic tool- Most simulation programs are examples of dynamic tools- Static tools support the analysis of models while dynamic tools support the simulation of

models

8. Development tools vs end product components- Some tools support the development of end products and doesn’t become part of them- Other tools are part of the software component and also is included as a part of the end

product as well, usually provided as a run time support library

9. Single user vs multiuser tools- Some tools support one user at a time while some support multiple users at a time- Single user tools are used for personal activities while multiuser tools are used for groups

10. Single machine vs network-aware tools- With the introduction of internet, the sharing of resources has spread from users from single

machine to multiple machines across the network- Tools must support the manipulation of objects across the network

Page 8: Software engineering

Representative Tools

Representative tools are the most important classes of software production tools. The common representative tools are

1. Editors- Editors are the fundamental software development tool that support the creation and

modification of documents and modules- They can be either textual or graphical- They can follow a formal syntax or they may be used for writing informal text as well- They can be either monolingual or polylingual- Editors are flexible and easy to integrate with other tools

2. Linkers- Linkers are tools that are used to combine mutual objects into larger objects- Linkers can be both monolingual or polylingual- The concept of linker has more applicability than the programming languages

3. Interpreters- An interpreter executes actions as specified in the input code.- It can be a hardware device that executes the machine code, or it can be a prototype or a

simulator of the end product

4. Code Generators- After the requirement specification, the implementation of the software construction is done

by the code generators- It is performed by the compilers- An optimizer is used as a translator to support the stepwise transformation of specifications

into implementations- Fourth generation tools (that are centered around a database system) are widely used in most

business applications

5. Debuggers- Debuggers are the special types of interpreters and they execute a program with the purpose

of helping to localize and fix errors by applying debugging principles- Debuggers gives the user the following capabilities

o To inspect the execution state in a symbolic wayo To select the execution mode; like selecting a step-by-step execution or setting

breakpointso To select the portion of the execution state and the execution point that will be

inspected without manually modifying the source code

Page 9: Software engineering

Unit 3: Software Specification

Introduction

Specification is a precise statement of the requirements that the system must satisfy. A specification not only specifies the requirements of the final system, but also the components that will be used to make up the system.

Specification can also be viewed as the statement of an agreement between a producer of a service and a consumer of the service or between an implementer and a user.

A requirement specification is an agreement between the end user and the system developer. A design specification is an agreement between the system architect and the implementers. A module specification is an agreement between the programmers using the module and the programmer implementing the module.

The uses of specification

Specification can be used for the following major uses

1. A statement of user requirementThe primary objective of a software product is to meet the user’s requirement and they are not always clearly understood by the developer. A careful analysis with interaction with the user should be done to clarify and prepare a statement of requirement without any misunderstandings.Initially even a user doesn’t have the clear idea about how the product should be and it lacks precise formulation of system functions and performance requirements.Sometimes the requirements are very clear and the specifications are straightforward. The same specification can be used by different producers to produce the same product. Such specification is known as standard specification.

2. A statement of the interface between the machine and the controlled environmentComputers interact with the external environment by receiving the inputs and providing outputs. Any incorrect specification can have serious and undesirable effects. It is necessary to specify the interface between the machine and the controlled environment by describing precise inputs, outputs and the expected relationships.

3. A statement of the requirements for the implementationSpecifications are used as a reference point while the product is being implemented and the ultimate goal of implementation is to build a product that meets the specifications. The specification is used during the design phase to make design decisions and during the verification activity to check that the implementation matches the specifications.

4. A reference point during product maintenance

Page 10: Software engineering

Several kinds of maintenance occur during a product’s life cycle and all involve specifications. In corrective maintenance, only the implementation is changed and specifications are needed to check whether the new implementation corrects the errors contained in the previous version of the product. Adaptive maintenance occurs in case of changes in the requirements and such changes are modifications of the functionality of the product. In perfective maintenance, the functional requirements do not change and the design of the product may be restructured to improve the performance. In all sort of maintenance, specifications act as a reference statement for the developers.

Classification of specification

Specifications can be classified as

- informal - formal - semiformal

Informal Specification are written in natural language and makes use of figures, tables and other notations to provide more structure and help the understanding of the system that is being built. Sometimes they can also be structured in a standard way.

In some specification, a notation has a precise syntax and meaning and it is known as formalism. Formalism is used to create a formal specification.

Semiformal specification use notations without insisting a completely precise semantics.

Specifications can also be classified as

- operational - descriptive

Operational specifications describe the intended system by describing its desired behavior and also provide a model implementation of the system. Descriptive specifications try to state the desired properties of the system in a purely declarative way.

Verification of specificationSpecifications must be verified before starting the implementation in order to assess their correctness. There are two general ways to verify the specification.

The first one consists of observing the dynamic behavior of the specified system to check whether it matches to the understanding of the general behavior of the ideal system.

The second one consists of analyzing the properties of the specified system that can be deduced from the specification. The properties that are deduced are then checked against the expected properties of the system.

Page 11: Software engineering

Types of Operational Specifications

1. Data Flow Diagrams (DFDs)- Widely used notation for specifying the functions of an information system and shows how

data flow from functions to functions.- They describe system as a collection of functions that manipulate data- Data in DFD are stored in data repositories, they flow in data flows and they are transferred to

and from the external environment- DFDs are expressed in graphical notations are they are easy to use- The basic elements of DFD are

o Functions are represented by bubbleso Data flows are represented by arrows. Arrows going to bubbles represent the input and

outgoing arrows indicate the results of the function.o Data stores are represented by open boxeso Special boxes are used to represent the input and output

Fig: graphical symbols used to build a dfd

Dfd for library information system

Page 12: Software engineering

2. UML (Unified Modeling Language) diagrams - UML is a collection of languages that provide specific notations to specify, analyze, visualize,

construct and document the components of a software system- Such notations are used by the software engineers to produce standard documents that

contains different diagrams that explains certain properties of the software system- UML includes a set of graphical notation techniques to create visual models of software

systems- Use case diagrams, sequence diagrams and collaboration diagrams are the techniques of UML

that are used to mode the dynamic aspects of a software system- Use case diagrams provides a global view of the components of the system and the actions that

the system performs- Use case diagrams describe the overall context of the system by partitioning the system

functionality into transactions that are useful to the components and shows how they interact with the system

Fig: use case diagram for a LMS- Sequence diagrams and collaboration diagrams are the two equivalent notations that can be

used to describe how objects interact by exchanging messages- They provide a dynamic view of a system by graphically displaying scenarios that may occur at

run time when objects interact to accomplish certain task- The sequence diagram visually indicates the progression of time in the vertical direction and

the sequence of messages exchanged between the objects- Collaboration diagrams make the structural properties of the collaboration of the objects more

clear

Page 13: Software engineering

Fig: sequence diagram for LMS

Fig: collaboration diagram for LMS

3. Finite State Machines- Information systems and control systems all have functional and data aspects as well as control

aspects. - FSMs are simple and widely used and formal notation for describing the functional and control

aspects of a system- FSM consists of

o A finite set of states, denoted by Qo A finite set of inputs, denoted by Io A transition function, denoted by ∂: Q x I

- FSM are suitable for describing systems that can be in a finite set of states and can go from one state to another as a result of some event, modeled by an input

fig: FSM illustration of a lamp

Page 14: Software engineering

4. Petri nets - Also known as place/transition net or P/T net is a mathematical modeling language for

analyzing and specifying a software system- A petri net is a specialized graph in which the nodes represent the transitions (events that

occur, represented by the bars)and places (conditions represented by circles)- Petri nets offer a graphical notation for stepwise processes that include choice, iteration, and

concurrent execution. - Petri nets have an exact mathematical definition of their execution semantics, with a well-

developed mathematical theory for process analysis.- A petri net is defined by a quadruple (P, T, F, W) where

o P is a finite set of placeso T is a finite set of transitionso P U T ≠ø

o F {P X T} U {T X P} is the flow relationo W: F N-{0} is the weight function which is a non-zero value to each element of P.

If no weight value is associated with the flow, the default value 1 is assumed for the function

P1 T1 P2 T2 P3

T6 T3

P6 T5 P5 T4 P4

Fig: simple illustration of Petri Net

Page 15: Software engineering

Unit 4: Software Development Process

Introduction

The process that is used to build, and deploy the software product from the initial state to the delivery and final retirement of the system is called the software development process. The goal of every development process is to satisfy customers by delivering quality products on time and within budget by making the products profitable and production reliable, predictable and efficient. By defining a model of the software development process, we can get some advantages of standardized processes.

Software Development Process Models

The code-and-fix model

In early days of software development, it only consisted of coding the application in some low level language and the model used in those days was called the code-and-fix model. The code-and-fix model consists of two steps

1. Write the code2. Fix the detected errors

This model had many difficulties and deficiencies because the structure of the code becomes messy on multiple changes and other changes are harder to apply and the results are less reliable.

Shrink-wrapped model

As the computing technology expanded, the need for new softwares also increased. People with little or no knowledge of computers and programming became the basic users of the software applications. So a new software development model called the shrink-wrapped software is developed on request from a customer for the general market usage or sometimes as embedded in other consumer products.

Boehm states the goals of structured software development process models are to

1. Determine the order of stages involved in the software development2. Establish a transition criteria for progressing from one stage to another

A software development process model addresses the following questions

Page 16: Software engineering

1. What shall we do next?2. How long shall we continue to do it?

The process models provides

1. Guidance to the software engineers about the technical activities to be carried out during a project2. A framework for managing the development and maintenance, estimation of resources, defines

milestones and monitors progress

The well-known software development process models are

1. Waterfall model- The most popular model for most software engineering and industrial practices- The waterfall method is a structured process in which the activities are in linear phases- The output of one phase acts as an input to another phase- The phases of waterfall method are

o Feasibility studyo Requirement analysiso Designo Coding and module testingo Integration and system testingo Delivery, deployment and maintenance

Fig: the waterfall model

2. Waterfall model with explicit feedback loop- The waterfall model states that the software development process should be subjected, to

discipline, planning and management- It also states that the implementation of the product should be postponed until the objectives

are well understood- The waterfall model is based on the assumption that the software development process is a

linear activity that starts from analysis and goes to coding. But this cannot happen in real world case and the process considers a disciplined form of feedback loops

Page 17: Software engineering

- The feedback loop is to minimize the rework involved of previous phases

fig: waterfall model with feedback loop3. Evolutionary Model

- The stages of evolutionary model consists of increments of an operational software product, with the direction of evolution being determined by operational experience

- The increment means the updates and new changes on an existing software product- Increments may be delivered to the customer as they are developed and this is called

evolutionary or sometimes also called incremental delivery- This model gets an additional value of early user feedback- The development strategy behind an evolutionary model is

o Develop something for the usero Measure the added value to the user in all critical dimensionso Adjust the design and the objectives based on observed realities

4. Transformation Model- The transformation model views the software development process as a sequence of steps that

gradually transforms a specification into an implementation- Initially the requirements are analyzed and functions are also specified possibly in an

incremental manner- Then the development process starts and transforms it into a more detailed description- As the process continues, the description becomes executable and it can also be viewed as a

prototype- Further transformation may occur to make the executable description more efficient

5. Spiral model- The spiral model provides a framework for designing processes including the risk levels

associated with them- It is also known as metamodel and can accommodate any other development model within it- It provides a view of the production process that supports the risk management

Page 18: Software engineering

Fig: spiral model

- A spiral model is cyclic unlike that of waterfall model which is linear. It involves the rapid generation of subsequent phases during the software development process

- The spiral model allows checking the robustness and correctness of the phases. After each cycle of the spiral, the requirements are checked as part of the robustness of the application

Organizing the process (need more with figures)

Organizing the software development process is a critical activity that involves the management of people to the management of all other products and components associated with the software development life cycle. It also involves the definition of appropriate methods and their combinations. The various methodologies for organizing the software development process are

1. Structured Analysis/Structured Design (SA/SD)- This method addresses the two phases of software development; the analysis and the design- In requirement and analysis phase, the SA/SD uses three conceptual tools

o Data flow diagrams (DFD)o Data dictionary

It is a centralized collection of definitions of all data flowing among functions and to or from the data stores

It helps to remove the duplication and inconsistencieso Structured English

It is highly constrained subset of natural language to describe the data transformation performed by each part of the DFD

2. Jackson's System Development and Structured Programming (JSD/JSP)- It is a popular design method adopted by many organizations for business data processing- It is a technique that represents a mixture of descriptive approaches based on object oriented

design and functional decomposition - According to JSD, the software development goes through a sequence of three stages

o The modeling stageo The network stageo The implementation stage

Page 19: Software engineering

- In the modeling stage, the real world is analyzed and represented in terms of entities and actions that may affect them

- In network stage, each entity is modeled as a process and the entire system is viewed as a network of interconnected and communicating processes

- In implementation stage, the network of processes is transformed into an implementation. That is, the concurrent network of processes is transformed into a sequential system that is executable by a general computer

3. The unified software development process (UP)- It is an industrial standard that uses the unified modeling language (UML) throughout the

software life cycle - Using rich collection of languages of UML, the unified software development process aims to

develop an object oriented system in an iterative and incremental process model- The principle is that any software system should be broken into controlled iterations or

miniprojects that provide the increment of the system- The UP life cycle consists of a sequence of cycles from the project's initiation to its termination

and after end of each cycle it has product releases. The subsequent cycles also results the product releases in an incremental manner

Unit 5: Software Engineering Principles

Introduction

Software Engineering Principles are the general and abstract statements that describe the desirable properties of software processes and products. Such principles deal with the process of software development and the final product. The principles developed and used are enough throughout the software construction and management.

To apply any principles, the software engineer must have appropriate methods and specific techniques to associate the desired properties into the final software product. Methods are general guidelines that govern the execution of some activity while techniques are more technical and have restricted applicability. The methods and techniques are sometimes packaged to form a methodology. Tools are developed finally to support the application of methods, techniques and methodologies.

Rigor and Formality

Rigor is always defined as precision and exactness, is a necessary component for creativity in every engineering activity. It is only through rigorous approach that we can continuously produce reliable products, control their costs and increase the confidence in the reliability of the system. The principle of rigor doesn't always limit and constrain the creativity but it can be used as a tool to enhance the creativity. A software engineer can be more confident of the results of a creative process after performing a rigorous assessment of those results.

In any development process, various degrees of rigor can be achieved. The highest degree of rigor is called formality and formality is a stronger requirement than rigor. Formality requires the software process to be driven and evaluated by mathematical laws.

Page 20: Software engineering

A software engineer must be able to identify and understand the level of rigor and formality that should be achieved depending on the conceptual difficulty and criticality of the task. The level may be different for different parts of the system. For example, kernel of OS and security of e-commerce requires formal description and approach (formality), while well understood parts may require simple approaches (rigor)

Modularity

A complex system may be divided into simpler pieces called modules and such system is called a modular system. The main benefit of modularity is that it allows the principles of separation of components to be applied in two phases

1. When dealing with the details of each module in isolation and ignoring details of other modules2. When dealing with the overall characteristics of all modules and their relationships to integrate

them into a coherent system

If the above two phases are executed in a sequence by concentrating on modules and then on their composition, then the system is said to be designed in bottom-up approach. When we decompose modules first and then concentrate on individual module design then the system is said to be designed in top-down approach.

Modularity provides four main benefits in software development process

1. The capability of decomposing a complex system into simpler pieces2. The capability of composing a complex system from existing modules3. The capability of understanding the system in terms of its pieces4. The capability of modifying a system by modifying only a small number of its pieces

Abstraction

- It is a fundamental technique for understanding and analyzing complex problems - In abstraction, the important aspects of a software process are identified and the details are

sometimes ignored. - So abstraction can be said as a special case of separation of concerns where the important aspects

are separated and concern of less important details are ignored- Abstraction is nowadays practiced by engineers of all fields for mastering complexity

Anticipation of change

- All software undergoes changes on a regular basis and the changes occur due to the need for repairing the software errors and for the need of supporting new requirements

- This quality is identified as the maintainability of the software process- It always require a special effort to anticipate how and where changes are likely to occur and

designers can try to identify them and take special care to make these changes easy to apply- Software should be designed such that any changes can be associated into the application

smoothly and safely

Page 21: Software engineering

- Softwares are designed without fully understanding the requirements and on the basis of users feedback the applications evolve from old requirement to new requirements. Thus anticipation of change is a principle that we can use to achieve evolvability

Generality

- The principle of generality states that every time when we have to solve a problem then try to discover more general problem that may be hidden behind the current problem to be solved

- The generalized problem may be less complex and easier to solve than the original problem and the solution of the generalized problem may also be reused to get the final solution of the original problem

- But the generalized solution may be more costly in terms of execution, memory requirements, and development time. So it is necessary to evaluate the importance of the generalized solutions with respect to their cost and efficiency

Unit 6: Software Design

The software design activity and its objectives

Designing is a fundamental human activity and it provides a structure to any complex architecture. It decomposes a system into parts and assigns responsibilities to each part, ensuring that the parts fit together to achieve all the goals of the system.

The design activity is a fundamental phase in the software development process and it progressively transforms the system requirements through a number of intermediate stages into a final product. In software engineering the design is defined as system decomposition into modules. Usually, a software architecture is produced to guide the software design. The architecture shows the structure and organization of the system to be defined.

The software architecture includes a description of the main components of the system, the relationships among these components and the reason for the decomposition of the system into components. The objective of the software design activity is the definition of the software design according to the guidelines of software architecture.

- The software design is a process in which the views of the system are described through steps of increasing details. The architecture is developed first on the basis of system requirements. Then, a high level design is produced on the basis of the architecture and then a low level design is derived on the basis of the high level design.

- The modularity principle plays an important role in the design of the software system. A modular system is accomplished in several ways.

Page 22: Software engineering

Modularization techniques

The modularization techniques can be viewed according to two aspects of software design:

1. The process that addresses the problem of defining the overall structure of the architecture in terms of relationships among the modules

2. The process that deals with the design of each module

These two aspects are known as architectural design and detailed design respectively

Modules are itself a well-defined components of a software system. It is a collection of routines, data, data type definitions or a mixture of all. Generally we can view a module as a provider of computational resources and services.

Mathematically the modular structure of a system can be expressed as

S={M1, M2, M3, ………Mn)

Where S is the software system and M is the module

A relation r on S defines that if two modules Mi and Mj are on S then we can say that Mi r Mj.

A relation on modules are in hierarchy and produces a directed acyclic graph (DAG) that is there are no cycles in the graph of the relation between modules

Modularization can be achieved by using two types of relations among the modules: USES and IS_COMPONENT_OF

The USES Relation

The USES relation is one of the useful relations for describing the modular structure of the software system. For any two modules Mi and Mj, we say that Mi USES Mj. It means that Mi needs the presence of Mj and Mj provides the resources for Mi. In such case Mj is called a server.

The IS_COMPONENT_OF Relation

IS_COMPONENT_OF is another relation among the modules that is useful for describing designs in a software system. This relation allows designers to describe an architecture in terms of a module that is composed of other modules that may be composed of other modules and so on.

Object Oriented Design

Object Oriented Design is a technique that uses the design approach based on abstract data types and this design was popular because of the development of object oriented programming like C++, JAVA etc.

Page 23: Software engineering

In OO design, there is only one type of module used, the abstract data-type module and we call such modules as classes. A class uses the operations that may be used to manipulate its instances and such operations are defined by procedures called the methods.

OO design insists on identifying classes and relations among the classes and Unified Modeling Language (UML) notations are widely used for describing the OO designs

Handling Anomalies

Designing the software products can be complex even if we use a systematic design approach followed by rigorous and disciplined implementation techniques. The designer should always anticipate failure and should plan to avoid or tolerate them and must employ a defensive design. A robust system should be built that could continue to behave reasonably even in unexpected circumstances.

In software engineering, a module is said to be anomalous if it fails to provide a service as expected and specified in its interface.

Unit 7: Software Verification and Validation

Introduction

Even though software engineers adopt the latest technology and thoughtful design techniques, the software design process always have some errors and they never can be avoided. So each software design process must be verified against its requirements throughout the development process.

The software design and development process must be verified just like any other engineering activity. Verification or validation is the activities that are undertaken to check whether the software being developed meets its objectives or not. These activities include testing, mathematical proofs, and informal reasoning as well.

Importance of verification

Every software development process must be verified

- To check whether it meets the objectives of the requirements or not- To ascertain whether the software has the critical requirements to be met or not- To see whether the results if the code match our expectations or not

The importance of verification in any software development process can be considered with the following reasons

Page 24: Software engineering

1. The designed software without any verification cannot gain absolute confidence in the correctness in the performance

2. Even if it provides such confidence in performance, it could not have the trust. The software might perform poorly sometime or the documentation may be inadequate, may not have any effective use.

Performing verification only after running the code makes it very difficult to repair any defects. So the verification activity should start from the very beginning following the rigorous principles and suitable techniques.

White-Box TestingAlso called the structural testing, the white-box testing is the technique of testing small individual modules. This technique uses the internal structure of the program to derive the test data. The white-box testing strategy tries to execute all the program statements in a sequence at least once and this strategy is known as statement-coverage criterion.

Example code

While x=!y, loopif x>y, thenx=x-yelse, y=y-xend ifend loop

In the code above, the program tries to ensure that all of the statements are checked once and tries to execute accordingly. The program first checks the condition of while loop, then the loop begins for x and y in case the given condition matches. A possible test set of x=2, y=2; x=5, y=1 and x=2, y=7 can be used to test all statements of the program.

Black-Box TestingAlso called functional testing, the black-box testing is based on the objective of the program and what the program is intended to do. The black-box testing is usually based on the program's specification rather than the structure.

For example, for a billing system, the black-box testing can be done by forwarding the following queries

1. Prepare a bill with the current date2. Show a bill with the specified bill number3. Provide a report from December 21-2011 to January 3-20124. Show all the transaction in the month of January 2009,2010,2011 and 2012 with the sales of

keyboard sold by the salesman john

DebuggingA bug is an error in a program and can finally cause failure in the whole program. The goal of any testing,

Page 25: Software engineering

analysis and verification of a software product is to find such bugs and to correct them. Debugging is an activity of finding and correcting such errors and subsequent failures. The debugging activity starts as soon as the program finds errors and failures in its execution. But debugging itself is the least understood activity of software engineering. So a rigor principle and care must be used to locate and fix the errors.

A failure is an activity that doesn't match the program specification. So a software engineer should first analyze the specifications. Furthermore, an error may not always be in the implementation, but it can be caused by the combination of several errors. So a software engineer must locate all the possible errors and fix them using the various techniques of programming.

Symbolic Execution

Symbolic execution is a verification technique that can be classified as testing and analysis. It is a combination of experimental and analytical approaches to software verification. For example in the pseudo code below

Read (a,b)x=a +bwrite (x)In the above code, the computer needs to read the values for the given input to produce the desired output. But for humans, doing the same thing requires a different approach such as "let's assume a and b be the input values and x be the desired output which is calculated by summing up a and b".

In both of the cases, the assumption of a and b are the symbolic notations for computing the sum x. This kind of reasoning has many advantages than using the actual numeric computations. The symbols used can represent any actual values for the input and the output variables.

Validation Techniques

Validation is the process of ensuring that a program operates on clean, correct and useful data and other resources to produce an intended output.

The validation process involves two basic steps:

1. Validation checkUses one or more computational rule to determine whether the resources used are valid or not

2. Post-check actionSends feedback to help enforce the validation

The other techniques used for resources validation are

1. Character checkingChecks whether the allowed characters are present or not. For example, some numeric field like telephone number can consist only numbers between 0-9 but no fractions and names should not consist characters like < and >.

Page 26: Software engineering

2. Batch ToolsBatch tools are used to check the missing records. Some batch tools are also used to combine numerical fields.

3. Cardinality checkChecks whether the database has the valid records or not. For example if the contact record is classified as a customer then it should have at least one valid order (ie cardinality>0) and in a payroll system if a person is marked as "former employee" then it should not have salary values after the date of resignation (ie cardinality=0)

4. Consistency checksChecks the consistencies in data fields in relation to other fields. For example, if tilte=Mr. then gender=Male

5. Data type checksChecks the data type of the input and give an error message if the input data does not match with the chosen data type, e.g., In an input box accepting numeric data, if the letter 'O' was typed instead of the number zero, an error message would appear.

Some other validation techniques includeCross system consistency checks, file existence checks, data format check, logic checks, and spelling and grammar checks etc.

Unit 8: Software Qualities

Software quality and Software Quality factors

The software quality is defined as the requirement of a software product that meets the desired objectives of the users in terms of its usefulness, dependability and durability. It promotes the awareness of crucial role of quality management in software development process for effective and efficient development of software products.

In software engineering, the software qualities are considered on two essential factors

1. The software functional quality that ensures how well the software product complies or conforms to the given design. That attribute can also be described as the fitness for purpose of a piece of software or how it compares to competitors in the marketplace as a worthwhile product.

2. The software structural quality that refers how it meets the non-functional qualities like robustness, maintainability, durability etc.

Page 27: Software engineering

Software Quality AssuranceSoftware quality assurance (SQA) is a technique of monitoring the software engineering processes and methods used to ensure quality. There is variety of techniques that can be used to ensure the quality of the software process, like the ISO 9000 and CMMI (Capability Maturity Model Integration)

SQA encompasses the entire software development process, which includes processes such as requirements definition, software design, coding, source code control, code reviews, change management, configuration management, testing, release management, and product integration. SQA is organized into goals, commitments, abilities, activities, measurements, and verifications.

SQA defines the quality in software in terms of two factors

1. Quality of Design 2. Quality of Conformance

SQA Activities

SQA is an essential process in any software development activity and to ensure the desire qualities, the SQA may encompass the following activities

1. Pre-Project ActivitiesThis is an initial activity that focuses on assessment and analysis of the requirements of a software system. The pre-project activities consists of following analysis

a. Review of Requirementsb. Development Planc. Quality Plan

2. Development and Maintenance ActivitiesThe assessed requirements are written down as codes of the program and subsequent maintenance activities are also performed on the system that is being developed. It further consists of following steps

a. Formal Technical Reviewsb. Code inspectionc. Module Testing, Integration Testing

3. Error Reduction FrameworkTo ensure an error free infrastructure, the SQA team should focus of factors like

a. Well known work proceduresb. Good use of templates and checklistsc. Staff trainingsd. Preventive actionse. Configuration and documentation control activities

4. QA ManagementThe management of the software development team should have a directed goal towards the quality assurance. It can be achieved by

Page 28: Software engineering

- reviewing the project progress- analyzing the budget and risk factors- considering quality metrics and the cost involved

5. SQA System ImplementationSQA can be implemented in software development process by following the globally known quality management standards like the ISO, SEI CMMI (Software Engineering Institute) etc

6. SQA Unit In a software development organization, a separate SQA unit should be implemented just like a research and development unit. The SQA unit forwards the metrics and plans for other SQA activities.

Software Quality StandardsAccording to the IEEE (Institute of Electrical and Electronic Engineers) Software Engineering Committee, a standard is a measurement of comparison that defines or represents the magnitude of a unit. It is a characterization that establishes the allowable tolerances or constraints for categories of items. Sometimes a software standard is also referred to as the level of required excellence.

Some of the widely known computer engineering standards are ISO, IEEE, SEI, ANSI, IEC (International Electrotechnical Commission) etc.

ISOFormed in 1947, the international organization for standardization (ISO)) is an international standards setting organization which is composed of representatives from various national standard organizations. The ISO formulates worldwide proprietary, industrial and commercial standards. The ISO is a voluntary organization whose members are the recognized authorities on standards, each one representing one country. It further consists of the technical committee, sub committees and the working groups.

Technical reports are issued when a technical committee or subcommittee has collected data of a different kind from that normally published as an International Standard such as references and explanations. Such reports are given a RFC (request for comment) number which are forwarded to the higher authority of the ISO. A draft standard is created if the report has positive aspects and becomes a known standard if it matches what it proposes. A permanent RFC number is assigned to the proven standard. Some of the standards related to computer science and software engineering are

Page 29: Software engineering

- ISO/IEC TR 17799:2000 Code of Practice for Information Security Management- ISO/TR 19033:2000 Technical product documentation — Metadata for construction

documentation- ISO 9000-3 for Quality Management and Quality Assurance Standard Part 3: Guidelines for the

application of 9001 to the development, supply, installation and maintenance of computer software

- ISO/IEC WD 15288 System Life Cycle Processes

SEISoftware Engineering Institute (SEI) is a federally funded research and development center headquartered on the campus of Carnegie Mellon University in Pennsylvania, United States. The SEI operates with major funding from the U.S. Department of Defense and works closely with industry and academic institutions through research collaborations. The SEI program of work is conducted in several principal areas: acquisition, process management, risk, security, software development, and system design.

The SEI CMMI (Capability Maturity Model Integration)

CMMI is a process improvement approach and can be used to guide process improvement across a project, a division, or an entire organization. Processes are rated according to their maturity levels, which are defined as: Initial, Managed, Defined, Qualitatively Managed, Optimizing.

CMMI addresses three areas of interest:

1. Product and service development — CMMI for Development (CMMI-DEV)2. Service establishment, management, — CMMI for Services (CMMI-SVC)3. Product and service acquisition — CMMI for Acquisition (CMMI-ACQ)

Software Reviews

Page 30: Software engineering

Software reviews are a filter for the software engineering process and are applied at different points of software development process to uncover errors that can be removed.

Any review is a process of using the diversity of people's mind to:

1. Point out the needed improvements in the product2. Confirm that the parts of a software product are whether needed or not

There are many types of reviews like:

1. An informal meeting to discuss the technical problems2. Formal presentation of the software with the customers, management and the technical team

Cost Impact of Software Defects

The cost impact on software defects are larger on post detection of errors; that is when the errors detected after the completion of the software product. The cost for correcting errors early before the finalization is much lesser.

The technical team must therefore try to uncover defective parts and errors early in the software development process.

Defect Amplification and Removal

The defect amplification and removal model can be used to illustrate the generation and detection of errors during the preliminary design, detailed design, and coding. The defect amplification and removal model is shown below

The whole box represents any software development step and during the step, errors may be generated without any notice. Software reviews may fail to uncover newly generated errors from previous steps resulting in some of the errors may pass to next steps. In some cases errors passed through from previous steps are amplified by the amplification factor x.


Recommended