+ All Categories
Home > Documents > Ch3: Software Engineering Principles 1 What is a principle? Definition: Goals of accounting...

Ch3: Software Engineering Principles 1 What is a principle? Definition: Goals of accounting...

Date post: 20-Dec-2015
Category:
View: 221 times
Download: 2 times
Share this document with a friend
Popular Tags:
33
Ch3: Software Engineering Principles
Transcript
Page 1: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

Ch3: Software Engineering Principles

Page 2: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

2

What is a principle?

Definition:

Goals of accounting principles:

Goals of software engineering principles?

Page 3: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

3

Why are software engineering principles needed?

Characteristics of target software

Summary:

Page 4: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

4

Outline

Principles involve software engineering process and product

Seven important principles used in all phases of software development

Cornerstone principle:

Page 5: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

5

Rigor and formality: Motivation

Problem statement:Write a program that computes the square root of a number

What is wrong/missing in this simple problem statement?

Page 6: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

6

Rigor and formality: Motivation

More rigorous problem statement:

Write a program to compute the square root of a given number. The program accepts positive and negative numbers as well as zero as input. If the input is a positive number, then the output should be both positive and negative square roots of the number. If the inputis zero, then the output should be zero. If the input is a negative number, then the program should print an error message and exit.

Can you find anything lacking in this problem statement?

Page 7: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

7

Rigor and formality: Motivation

What is formality?

SquareRoot(x)

Output = + sqrt(x), if x > 0 = 0 if x = 0 = “Error” if x < 0

Input x;

Page 8: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

8

Rigor and formality

Software engineering is a creative design activity:

Why is rigor necessary?

What is formality?

Page 9: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

9

Rigor and formality (contd..)

Who should practice rigor and formality?

When should rigor and formality be practiced?

Influence of rigor and formality on other software qualities

Page 10: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

10

Examples of rigor and formality

Product:

Process:

Page 11: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

11

Separation of concerns

Problem statement:Positive input:Negative input:Zero:Response time:

Different concerns:

Address different concerns separately:

Page 12: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

12

Separation of concerns

Divide and conquer strategy:

Master complexity by:

Identify the different aspects of problem:

Page 13: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

13

Separation of concerns (contd..)

Advantages of separation of concerns supports:

Page 14: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

14

Examples

Go through phases one after the other (as in waterfall)

Keep product requirements separate

Page 15: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

15

Modularity: Motivation

Problem statement:Write a program to compute the square root of a given number. The program accepts positive and negative numbers as well as zero as input. The program accepts input from an ASCII file. If the input is a positive number, then the output should be both positive and negative square roots of the number. If the input is zero, then the output should be zero. The output should be written to a file.

Should the code for input and output be embedded with the codethat computes square root, or should the code be in separate modules?

Page 16: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

16

Modularity: Motivation

Monolithic application

File i/pSquare rootFile o/p

Modular application

File i/p Square root File o/p

Page 17: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

17

Modularity

Definition:

Two-phase application of separation of concerns

Methodological approaches:

Is modularity unique to software engineering?

Page 18: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

18

Modularity (contd..)

Four benefits of modularity

Key supporting concepts: Cohesion and coupling Cohesion:

Coupling:

Page 19: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

19

Modularity (contd..)

Modularity supported in programming languages:

C++:

Ada95/Java:

Page 20: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

20

Abstraction: Motivation

•For a module, which uses the square root program, the only relevant information is the input it accepts and the output it provides.

•Thus, the user of the square root program is only concerned with itsinput/output behavior and may ignore the details of the implementation.

Page 21: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

21

Abstraction

Definition:

Goals of advances in design and programming

Type of abstraction to apply depends on purpose

Page 22: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

22

Abstraction (contd..)

Abstraction yields models:

Page 23: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

23

Example

Programming language semantics described through an abstract machine that ignores details of the real machines used for implementation

Abstractions in process

Page 24: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

24

Anticipation of change: Motivation

Problem Statement:Consider the square root program. In addition to accepting input and writing output to a file, the program should also accept input from a terminal and provide output to a terminal.

File i/p Square root File o/p

Terminal i/p Terminal o/p

What if a combination of file and terminal I/p and o/p is desired?

Page 25: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

25

Anticipation of change: Motivation

Another example:

Initially, the user wants an error message if the input is negative.Later, he changes his mind, and wants the complex root as output.

Page 26: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

26

Anticipation of change

Why is this necessary?

Is anticipation of change unique to computing?

Can future products be predicted? Is planning cycle 5 or more years?

Page 27: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

27

Generality: Motivation

Square root routine is being written for use in an application where itsinput will never be negative.

Later, a new application needs square root computation. But this, time, the output should be a complex root, if input is negative.

Page 28: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

28

Generality

Why generality?

Advantages and drawbacks of generality

Some examples of generality

Page 29: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

29

Generality (contd..)

Domain and organization specific reuse What products will company develop in the future? Leverage additional short-term effort with long-term

gains with respect to maintenance, reuse, etc.

Page 30: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

30

Generality (contd..)

Domain-Independent20% Domain-Specific

65%

Application-Specific15%

Three classes of software

in a typical software application

Page 31: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

31

Incrementality: Motivation

To provide a quick solution, we may first write a program that acceptspositive numbers as input, and provides positive square root as output.

Later, we can add the capability to accept negative numbers as input.Depending on the experience of the user in using the original program,upon receiving a negative input, he may choose to: - Print an error message - Produce complex root

Page 32: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

32

Incrementality

Accepted practice across disciplines

Incrementality in software:

Page 33: Ch3: Software Engineering Principles 1 What is a principle?  Definition:  Goals of accounting principles:  Goals of software engineering principles?

33

Incrementality (contd..)

Advantages of incrementality:

Difficulty in constructing solutions to complex computing problems:


Recommended