Docsity

Software Engineering Principles: Data Structures and Algorithms, Slides of Software Engineering

Partial preview of the text

Download Software Engineering Principles: Data Structures and Algorithms and more Slides Software Engineering in PDF only on Docsity!

Chapter One

Introduction to Data Structures

and Algorithms

2

Introduction to Data Structures and

Algorithms

Software Engineering

  • Is the use of engineering principles in order to develop good software.
  • (^) Human creativity + Computer speed & Reliability = Program.
  • There are a number of general principles that apply to many areas, including aspects of software engineering. Software Engineering Principles a) Separation of Concern
    • (^) This is a very important principle that has many applications
    • (^) in Software Engineering. Frequently, we have a large, complex problem with many inter-related aspects.
    • To deal with such problems, separate concerns and look at each concern separately. b) Modularity
    • (^) Every large system must be divided into modules so we can understand it.
    • Each module performs a set of tasks.

Software Engineering Principles....(Continued)

Software Engineering Principles....(Continued) c) Abstraction

  • (^) It is sometimes best to concentrate on general aspects of th e problem while carefully removing detailed aspects. d) Anticipating Change
  • (^) General rule: write all documents and code under the assump tion that they will subsequently be corrected, adapted, or cha nged by somebody else. e) Generality: A general solution is often:
  • (^) Not much harder to write than a special-purpose solution;
  • (^) More likely to be re-used; and
  • (^) Perhaps a little less efficient.
  • (^) Generality needs support from the programming language.
  • (^) Current languages do not support generality well; new OO lan guages may be better (abstract classes, frameworks,.. .).
  • (^) Generalization is related to abstraction.

Software Engineering Principles....(Continued)

  • (^) Formal: R easoning based on a mechanical set of rules (“formal system”).
  • (^) Use rigor as much as possible. Use formality when suitable to ols are available (compilers, parser generators, proof checkers,. ..). Definitions for Software Engineering
  • (^) Product — What we are trying to build.
  • (^) Process — The methods we use to build the product.
  • (^) Method — A guideline that describes an activity. Methods are general, abstract, widely applicable. Example: top-down design.
  • (^) Technique —A precise rule that defines an activity. Techniques are precise, particular, and limited. Example: loop termination proof.
  • (^) Tool — A mechanical/automated aid to assist in the application of a methodology. Examples: editor, compiler,...
  • (^) Methodology — a collection of techniques and tools.

Introduction....(Continued) Software Engineering

  • (^) Is the use of engineering principles in order to develop good software. Good software is:
  • (^) Correct
    • (^) The software performs according to the SRD (Software Requirements Document).
    • (^) The SRD may be too vague (although it should not be) — in this case, conformance to a specification is needed.
  • (^) Reliable
    • (^) This is a weaker requirement than “correct”. E-mail is reliable — messages usually arrive — but probably incorrect.
  • (^) Robust
    • (^) The software behaves well when exercised outside the requirements.
    • (^) For example, software designed for 10 users should not fall apart with 11 users.

Introduction....(Continued)

  • (^) Maintainable
    • (^) Easy to correct or upgrade.
    • (^) Code traceable to design; design traceable to requirements.
    • (^) Clear simple code.
    • (^) Good documentation.
    • (^) Simple interfaces between modules.
  • (^) Reusable
    • (^) We need abstract modules that can be used in many situations.
    • (^) Sometimes, we can produce a sequence of products, each using code from the previous one.
    • (^) Example: Accounting systems.
    • (^) Object-Oriented techniques aid reuse.

Introduction....(Continued)

  • (^) Portable
    • (^) The software should be easy to move to different platforms.
    • (^) This implies few Operating System and hardware dependencies.
    • (^) Recent developments in platform standards (PCs, UNIX,.. .) have aided portability.
    • (^) Portability and efficiency are incompatible.
    • (^) Highly portable systems consist of many layers, each layer hiding local details.
    • (^) Recent achievements in portability depend on fast processors and large memories.
  • (^) Interoperable
    • (^) The software should be able to cooperate with other software (word-processors, spread-sheets, graphics packages,.. .).
  • (^) The way data are organized in a computers memory is said to be Data Structure.
  • (^) The sequence of computational steps to solve a problem is said to be an Algorithm.
  • (^) Therefore, a program is Data structures plus Algorithm. Introduction....(continued)
  • (^) Data structures are used to model the world or

part of the world. How?

1. The value held by a data structure represents

some specific characteristic of the world.

2. The characteristic being modeled restricts the

possible values held by a data structure and

the operations to be performed on the data

structure.

Introduction....(continued)

Introduction....(continued)

  • (^) The model defines an abstract view to the

problem.

  • (^) The model should only focus on problem

related stuff

Abstraction

  • (^) is a process of classifying characteristics as

relevant and irrelevant for the particular purpose at

hand and ignoring the irrelevant ones.

Example: model students of BDU.

  • (^) Relevant:

Char Name[15];

Char ID[11];

Char Dept[20];

int Age, year;

  • (^) Non relevant

float hieght, weight;

Abstract Data Types

  • (^) Consists of data to be stored and operations supported

on them.

  • (^) Is a specification that describes a data set and the

operation on that data.

  • (^) The ADT specifies:

 What data is stored.

 What operations can be done on the data.

  • (^) Does not specify how to store or how to implement the

operation.

  • (^) Is independent of any programming language

Example : ADT employees of an organization:  (^) This ADT stores employees with their

relevant attributes and discarding irrelevant

attributes.

Relevant:- Name, ID, Sex, Age, Salary, Dept, Address Non Relevant :- weight, color, height  (^) This ADT supports hiring, firing, retiring, …

operations.