brief introduction to software engineering

74
Brief Introduction to Software Engineering Gerson Sunyé University of Nantes [email protected] http://sunye.free.fr 1

Upload: gerson-sunye

Post on 21-Jul-2015

193 views

Category:

Software


5 download

TRANSCRIPT

Page 1: Brief Introduction to Software Engineering

Brief Introduction to Software Engineering

Gerson SunyéUniversity of Nantes

[email protected]://sunye.free.fr

1

Page 2: Brief Introduction to Software Engineering

Agenda1. Software Engineering Definition

2. Modern Software Complexity

3. The Software Industry Today

4. Software Modeling

5. Software Development Process

6. Conclusion2

Page 3: Brief Introduction to Software Engineering

Acknowledgements• Jean-Marc Jézéquel, Benoît Combemale, Olivier Barais.

• Université de Rennes 1

• Yves Le Traon

• Université du Luxembourg

• Jean-Marie Mottu, Gilles Ardourel

• Université de Nantes3

Page 4: Brief Introduction to Software Engineering

Goals

• To understand the complexity of modern software systems.

• To have a preview of the recommended solution:

• Separation of concerns.

• Technical continuity: from models to programs.

• Activity continuity: from requirements to delivery and then to evolution.

4

Page 5: Brief Introduction to Software Engineering

Definition

5

Page 6: Brief Introduction to Software Engineering

A Little History

• In 1843, Ada Lovelace translates Frederico Luigi de Menabrea’s paper “Sketch of the Analytical Engine Invented by Charles Babbage”, adding several notes.

• Note G describes an detailed algorithm for computing Bernoulli’s numbers with the analytical engine.

6

Page 7: Brief Introduction to Software Engineering

7

Page 8: Brief Introduction to Software Engineering

First Computer Programmer

• Ada translated well known formulae into an implementable algorithm.

• This activity is the core of the software engineering process.

8

Page 9: Brief Introduction to Software Engineering

Software Engineering Definition

«Software engineering (SE) is the application of a systematic, disciplined, quantifiable approach to the design, development, operation, and maintenance of software, and the study of these approaches; that is, the

application of engineering to software» [SWEBOK]

9

Page 10: Brief Introduction to Software Engineering

Software Engineering Approach

AD Software Engineering Approach

Software Engineering Approach

SoftwareRequirement

UML Activity: systematic, disciplined, and quantifiable approach

10

Page 11: Brief Introduction to Software Engineering

Software Engineering Activities [Meyer]

• Describe: requirements, design, specification, documentation...

• Implement: modeling, programming

• Assess: testing and other V&V techniques

• Manage: plans, schedules, communication, reviews

• Operate: deployment, installation...

11

Requirement Software

Describe Assess

Operate

Software Engineering Approach

ManageImplement

Page 12: Brief Introduction to Software Engineering

A Systematic Approach

An approach that follows a method, with rigor and precision

12

Page 13: Brief Introduction to Software Engineering

A Disciplined Approach

An approach that shows a controlled form of behavior

13

Page 14: Brief Introduction to Software Engineering

A Quantifiable Approach

An approach that can be measured:from the input until the output

14

Page 15: Brief Introduction to Software Engineering

Modern Software Complexity

15

Page 16: Brief Introduction to Software Engineering

Modern Software Complexity

16

Page 17: Brief Introduction to Software Engineering

Critical, Real-Time, Embedded

17

Page 18: Brief Introduction to Software Engineering

Reusable, Durable

18

Page 19: Brief Introduction to Software Engineering

Elasticity

FarmVille 1 million users in 2 months!

Quicken took 10 years to reach this amount !

19

Page 20: Brief Introduction to Software Engineering

Scalability

20

Page 21: Brief Introduction to Software Engineering

Long Term Availability

• Airbus A300 Lifecycle:

• Program started in 1972, production ended in 2007 (35 years).

• Support will last until 2050 (78 years!).

• On board software development for very long lifecycle products.

• From the OPEES ITEA2 project (2009-12).

21

Page 22: Brief Introduction to Software Engineering

Distributed Data Processing

http://googletesting.blogspot.com/search/label/Copeland Source:

• Google.com: 300,000 servers, distributed on more than twenty data centers, responding to more than 1 billion queries per day, each one interrogating 8 billions web pages in less than a fifth of a second

22

Page 23: Brief Introduction to Software Engineering

Large-Scale Development

• Google.com: 6,000 developer / 1,500+ projects, Each product has custom release cycles few days to few weeks, 1(!!) code repository, no binary releases, everything builds from HEAD, 20+ code changes per minute, 50% of the code changes every month

23

Page 24: Brief Introduction to Software Engineering

Ubiquity

• Autonomic Computing• Cloud Computing• SaaS, IoS, IoT

24

Page 25: Brief Introduction to Software Engineering

The Software Industry Today

25

Page 26: Brief Introduction to Software Engineering

The Software Industry Today

• New actors

• Separation of concerns

• Modeling

26

Page 27: Brief Introduction to Software Engineering

Actor Evolution

Scientist

Programmer

User

Software Engineers

Users

Time27

Page 28: Brief Introduction to Software Engineering

Actors at Present Time

end userscomponent developers

architects

assemblers

standardization organization

tool vendors

application testers

site administrators

component testers

middleware providers

28

Page 29: Brief Introduction to Software Engineering

Several Actors, Different Concerns

• Different:

• Concerns.

• Jobs and tasks.

• Competences.

• Tools.

• Software artifacts.29

Page 30: Brief Introduction to Software Engineering

Residents

Plumbers

Electricians

Architects

LandscapeArchitects

Cadastre

Insurers

Firefighters

Notaries

PropertyDevelopers

System

Separation of Concerns

30

Page 31: Brief Introduction to Software Engineering

OwnerPlumber

Electrician

BricklayerArchitect

Cadastre

System

Separation of Concerns

31

Page 32: Brief Introduction to Software Engineering

In Short

• Issues:

• Growing software complexity.

• Separation of concerns

• New software actors

• Requirement diversity

• Heterogeneous platforms

• Permanent evolution

• Etc.

• Question: Is using code to represent complex systems the correct solution?

32

Page 33: Brief Introduction to Software Engineering

Software Modeling

33

Page 34: Brief Introduction to Software Engineering

Different Models of a System• Models for :

• Firefighters• Property developers• Residents• Plumbers• Electricians• Landscape architects• Architects• Notaries• Insurers• Cadastre

System

34

Page 35: Brief Introduction to Software Engineering

Different Models of a System

Design Model

Code Model

Deployment

Fault tolerance

Security

Functional behaviorUse case model

PlatformModel

«subsystem»ATM

Withdraw

Deposit

Print Receipt

Check Balance

Login

Client

0..1

1

1

1

0..1

0..1

35

Page 36: Brief Introduction to Software Engineering

Modeling in Science & Engineering

• A Model is a simplified representation of an aspect of the World for a specific purpose.

• Specificity of Engineering: Model something inexistent (in order to build it).

The world

Modeling space

Is re

pres

ente

d by

36

Page 37: Brief Introduction to Software Engineering

Models rather than Code• A model is a simplification (abstraction) of the reality.

• We build models to better understand a system behavior.

• We need to model complex systems because we are unable to understand them globally.

• The code does not simplify the reality.37

Page 38: Brief Introduction to Software Engineering

Why modeling? To master complexity

• Modeling, in the broadest sense, is the cost-effective use of something in place of something else for some cognitive purpose. It allows us to use something that is simpler, safer or cheaper than reality instead of reality for some purpose.

• A model represents reality for the given purpose; the model is an abstraction of reality in the sense that it cannot represent all aspects of reality. This allows us to deal with the world in a simplified manner, avoiding the complexity, danger and irreversibility of reality.

Jeff Rothenberg, «The Nature of Modeling», 1989.38

Page 39: Brief Introduction to Software Engineering

Why Modeling?• To think:

• Abstract representation, Separation of concerns.

• To communicate:

• Graphical representation, document generation.

• To automate the development:

• Code generation, Quality evaluation, Migration

• To validate

• Model validation and verification: simulation, model-checking, model-based testing.

39

Page 40: Brief Introduction to Software Engineering

Model and Reality in Software

• Sun Tse: Do not take the map for the reality

• William James: The concept 'dog' does not bite

• Software Models: from contemplative to productive

[Magritte]

40

Page 41: Brief Introduction to Software Engineering

Modeling in Software Engineering• From software design to requirement specification.

• business modeling, testing, runtime adaptation, maintenance, quality assessment, code generation, etc.

• And also documentation, transformation, evolution, migration.

• Any other suggestion?41

Page 42: Brief Introduction to Software Engineering

42

design, documentation

analysis ... detailed design

requirement management,

systems engineering ...

V&V, (code, test) generation.

... DSML, transformation/composition ... maintenance ...

runtime.

State of the practice in Industry

AnalysisDesignDevelopmentTestDeployment

RuntimeMaintenance

?

Page 43: Brief Introduction to Software Engineering

The UML

• The Unified Modeling Language

• Several diagrams (concerns), one model.

• Several actors and processes, one syntax.

43

Page 44: Brief Introduction to Software Engineering

UML: one model, 4 main dimensions, multiple views

Device

start()stop()

Operator<<Actor>>

0..*1

controls

Static

: Operator

: Device

start( )

stop( )

Dynamic

Usage

: Operator

ControllingSite RemoteSite

TCP/IP : Device

Deployment

: Operator

44

Page 45: Brief Introduction to Software Engineering

The X diagrams of UML• Modeling along 4 main viewpoints:

• Static Aspect (Who?)

• Describes objects and their relationships (Class & Object Diagrams)

• Structuring with packages

• User view (What?)

• Use cases Diagram

• Dynamic Aspects (When?)

• Sequence Diagram

• Collaboration Diagram

• State Diagram

• Activity Diagram

• Deployment Aspects (Where?)

• Component Diagram & deployment diagram

45

Page 46: Brief Introduction to Software Engineering

Example: Modeling a simplified GPS device

• Gets position, heading and speed by receiving signals from a set of satellites

• Notion of Estimated Position Error (EPE): receives from more satellites to reduce EPE.

• User may choose a trade-off between EPE & saving power

• Best effort mode

• Best route (adapt to speed/variations in heading)

• Power Saving

(Case Study borrowed from N. Plouzeau, K. Macedo, and JP. Thibault)46

Page 47: Brief Introduction to Software Engineering

Use Case Diagram

47

Page 48: Brief Introduction to Software Engineering

Class diagramknows

readsFrom

route

48

Page 49: Brief Introduction to Software Engineering

Sequence Diagram: Configuring Decoders

49

Page 50: Brief Introduction to Software Engineering

Sequence Diagram: Interrupt Driven Architecture

Many more sequence diagrams needed…50

Page 51: Brief Introduction to Software Engineering

Modeling a (simplified) GPS device

• Targeting multiple products with the same (business) model

• Hand held autonomous device

• Plug-in device for Smart Phone

• Plug-in device for laptop (PCMCIA/USB)

• May need to change part of the software after deployment

• We choose a component based delivery of the software51

Page 52: Brief Introduction to Software Engineering

Component Diagram

«component»Decoder

DecoderI

DataIDataI

ReceiverI

52

Page 53: Brief Introduction to Software Engineering

Component DiagramInstance Level

53

Page 54: Brief Introduction to Software Engineering

Software Development Processes

54

Page 55: Brief Introduction to Software Engineering

Software Engineering Activities

• Domain/Business analysis: understanding the user environment.

• Requirement specification: specifying the user needs.

• Software design: describing the foreseen solution.

• Implementation: solution coding, realization.

• Validation/Verification: evaluation of the solution.

• Deployment: distribution, delivery.

• Maintenance: resolving errors and evolving the solution according to new needs.

55

Page 56: Brief Introduction to Software Engineering

Software Processes• A sequence of activities required to produce a software system.

• Different processes, all involving (at least):

1. Specification: what the system should do.

2. Design: how the system should be organized.

3. Implementation: realization of the system as a program.

4. Validation: check that the system does what it is supposed to do.

5. Evolution: changes according to user new needs.

56

Page 57: Brief Introduction to Software Engineering

Software Process Models• Abstract representation of a process.

• Examples:

1. Waterfall model.

2. Spiral model.

3. Iterative and incremental model.57

Page 58: Brief Introduction to Software Engineering

The Waterfall ModelI

|

I '

I I

:i] .

~ '

l l

e ~$

~ ~

i

n |~

~ u

8(

I I

.. I

s""

O0 0@'

0 O° ~ d

p@@@@@@~S.

I w

R

I.L.

338

[Royce, 1970]58

Page 59: Brief Introduction to Software Engineering

Issues• Industrial organization inherited from the 19th century: reassuring for

managers, but inefficient.

• Antinomy: Coplien’s organizational pattern “Architects also Implement”.

• Implicit linearity

• Document approval time may have a buffering effect.

• Final document modification cost.

• Unrealistic for risky, innovative projects.

59

Page 60: Brief Introduction to Software Engineering

The Spiral Development Model

2 CMU/SEI-2000-SR-008

applications discussed in [Bernstein 00] and [DeMillo 00] use a complementary best practiceas their anchor point milestones: the AT&T/Lucent/Telcordia Architecture Review Board pro-cess [AT&T 93]. Xerox’s Time-to-Market process uses the anchor point milestones as hard-ware-software synchronization points for its printer business line [Hantos 00].

Several successful large aerospace spiral projects were also discussed. The best documentedof these is the CCPDS-R project discussed in [Royce 98]. Its Ada Process Model was thepredecessor of the Rational Unified Process and USC MBASE approach, which have bothbeen used on a number of successful spiral projects [Jacobson 99, Boehm 98], as has the SPCEvolutionary Spiral Process [SPC 94]. Further successful large aerospace spiral projectswere presented by SAIC and TRW [Kitaoka 00, Bostelaar 00].

RQTS PLANLIFE CYCLE PLAN

CONCEPT OFOPERATION

EMULATIONS MODELS BENCHMARKS

REVIEW

COMMITMENTPARTITION

RISK ANALYSIS

RISKANAL.

RISK ANALYSIS

RISK ANALYSIS

PROTO-TYPE1

PROTOTYPE3

OPERATIONALPROTOTYPE

EVALUATEALTERNATIVESIDENTIFY,RESOLVE RISKS

PROGRESSTHROUGHSTEPS

CUMMULATIVECOST

DETERMINEOBJECTIVES,ALTERNATIVES,CONSTRAINTS

DEVELOP-MENT PLAN

INTEGRATIONAND TEST

PLANDESIGN VALIDATIONAND VERIFICATION

REQUIREMENTSVALIDATION

SOFTWAREPRODUCTDESIGN

DEVELOP, VERIFYNEXT LEVEL PRODUCT

SOFTWARERQTS

IMPLEMEN-TATION

ACCEPT-ANCE TEST

INTEGRA-TION AND

TEST

UNITTEST

CODE

DETAILEDDESIGN

PROTOTYPE2

PLAN NEXTPHASES

Figure 1: Original Diagram of Spiral Development[Bohem 1988, 2000]60

Page 61: Brief Introduction to Software Engineering

Issues• Well-adapted for innovative projects.

• Tangible progress: delivery of running software, not only tons of papers.

• Can be stopped at any time (for instance, before creating a money pit).

• Difficult to manage and to control. Improvements become code hacking.

• Increments obey to 2 among 3 rules:

• Period (e.g. weekly).

• Functionalities (e.g. Use Cases).

• Quality level (Software testing, quality factors, etc.)

61

Page 62: Brief Introduction to Software Engineering

Iterative and Incremental Model

62

Page 63: Brief Introduction to Software Engineering

Phases1. Inception: The idea for the project is stated. The development team determines if

the project is worth pursuing and what resources will be needed.

2. Elaboration: The project's architecture and required resources are further evaluated. Developers consider possible applications of the software and costs associated with the development.

3. Construction: The project is developed and completed. The software is designed, written, and tested.

4. Transition:The software is released to the public. Final adjustments or updates are made based on feedback from end users.

Inception Elaboration Construction Transition

Time63

Page 64: Brief Introduction to Software Engineering

Iterations

Preliminary Iteration

Architect. Iteration

Architect. Iteration

Devel. Iteration

Devel. Iteration

Devel. Iteration

Transition Iteration

Transition Iteration

Inception Elaboration Construction Transition

An iteration is a distinct sequence of activities with an established plan and evaluation criteria, resulting in an executable release.

64

Page 65: Brief Introduction to Software Engineering

Phases and IterationsExamples

(No. of Iterations)

Inception Elaboration Construction Transition Project Length

Iteration Length

e-business 0.2 1 3 1 3-4 months 2-3 weeks

infrastructure 1 3 3 2 9-12 months 5-7 weeks

65

Page 66: Brief Introduction to Software Engineering

Best Practices• Develop software iteratively

• Manage requirements

• Use component-based architectures

• Visually model software

• Verify software quality

• Control changes to software66

Page 67: Brief Introduction to Software Engineering

Software Process Engineering

• Supports the creation of flexible process models.

• OMG related standard: Software & Systems Process Engineering Meta-Model Specification (SPEM).

• Main elements: Roles, Activities, Work Product.

Functional Analyst Interface Designer Technical Designer

DefineRequirements

DesignProcess Model

UserRequirements

User WorkProcesses

Draft UserInterface

Refine UserInterface

User InterfaceDraft

User Interfacerefined

Define Techn.Requierements

BuildApplication

https://code.google.com/p/spem4omnigraffle/67

Page 68: Brief Introduction to Software Engineering

Software Modeling and the Software Development Process

• The Unified Modeling Language (and other languages) may be applied on different activities.

• One syntax, different semantics:

• Reduces the learning curve, but

• Increases misinterpretation and confusion.68

Page 69: Brief Introduction to Software Engineering

Requirements Problem Analysis Design Implementation Validation Deployment

Use Case ++ ++

Classes + ++ ++ ++ ++

Components ++ + + +

Iteration + ++ + + ++

States + ++ ++ + +

Activities + ++ ++ ++ +

Deployment + + + ++69

Page 70: Brief Introduction to Software Engineering

Conclusion

70

Page 71: Brief Introduction to Software Engineering

Why do projects fail?• Unrealistic or unarticulated project

goals• Inaccurate estimation of needed

resources• Badly defined system requirements• Poor reporting of the project's status• Unmanaged risks• Poor communication among

customers, developers, and users

• Use of immature technology• Inability to handle the project's

complexity• Sloppy development practices• Poor project management• Stakeholder politics• Commercial pressures

71

Page 72: Brief Introduction to Software Engineering

72

Page 73: Brief Introduction to Software Engineering

Conclusion• Software Systems are becoming bigger and more complex: real-

time, distributed, critical, embedded, pervasive, dynamic, adaptive, scalable, elastic, etc.

• New actors on software development: tools vendors, middleware providers, testers, etc.

• Software engineering is more than writing code: different activities, languages, processes.

• Modeling allows developers to master complexity.73

Page 74: Brief Introduction to Software Engineering

References

• “Software Engineering”, Ian Somerville. Addison-Wesley. 9th edition. 2009.

• “Rational Unified Process—Best Practices for Software Development Teams”. Rational Software White Paper.

• “Rational Unified Process—An Introduction”. Philippe Kruchten. Addison-Wesley, 1999.

• Boehm, B. (n.d.). Spiral Development: Experience, Principles, and Refinements. Spiral Development Workshop. Retrieved from http://www.sei.cmu.edu/reports/00sr008.pdf

74