systems analysis i introduction i introduction. 2systems analysis - introduction contents...

27
Systems Analysis Systems Analysis I introduction I introduction

Upload: julius-hopkins

Post on 16-Jan-2016

282 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

Systems AnalysisSystems Analysis

I introductionI introduction

Page 2: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

2Systems Analysis - Introduction

ContentsContents

IntroductionIntroduction 3 classic phases3 classic phases LiteratureLiterature What is important (Critical Success What is important (Critical Success

Factors)Factors) Some anti-patterns and code smells Some anti-patterns and code smells

Page 3: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

3Systems Analysis - Introduction

3 classic phases in 3 classic phases in software-developmentsoftware-development

0 Background0 Background =knowledge about the subject=knowledge about the subject ==most important phasemost important phase Often neglected or ‘forgotten’ Often neglected or ‘forgotten’

1 Conception1 Conception often called ‘analysis’ often called ‘analysis’ Pointless without stage 0Pointless without stage 0

2 Design/Specification2 Design/Specification Already contains some implementation Already contains some implementation

decisionsdecisions 3 Implementation3 Implementation

Turns out to be more important then we Turns out to be more important then we thought in de 70's and 80's.thought in de 70's and 80's.

Page 4: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

4Systems Analysis - Introduction

Remarks Remarks Unlike what we used to think, the phases do Unlike what we used to think, the phases do

not have to be followed in any strict order. not have to be followed in any strict order. You You shouldshould know realize however, what know realize however, what

phase you are in.phase you are in. Analysis ≠ exact science. IT is still too Analysis ≠ exact science. IT is still too

young. : young. : USEFULNESS is the only reasonable USEFULNESS is the only reasonable measure to evaluate analysis techniques.measure to evaluate analysis techniques.

The Implementation phase The Implementation phase isis important. important. Things can still go awfully wrong in this Things can still go awfully wrong in this phase. Programming is no routine act.phase. Programming is no routine act.

Page 5: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

5Systems Analysis - Introduction

Evolution of Systems Evolution of Systems Analysis:Analysis:

sequencessequencesThe evolution of systems analysis has always been The evolution of systems analysis has always been influenced by influenced by programming languages and programming languages and databasesdatabases, unlike what you might expect. The , unlike what you might expect. The main theme is: main theme is: higher levels of abstraction. higher levels of abstraction.

Electric switchesElectric switches Assembler languageAssembler language

sequential, cryptic, machine dependentsequential, cryptic, machine dependent registersregisters conditional jumpsconditional jumps-> Flow Charts-> Flow Charts

Interpreted sequential languages: e.g. Interpreted sequential languages: e.g. BasicBasic sequential, less cryptic, can be machine independentsequential, less cryptic, can be machine independent global variablesglobal variables conditional jumpsconditional jumps-> Flow Charts-> Flow Charts

Page 6: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

6Systems Analysis - Introduction

Evolution of Systems Evolution of Systems Analysis:Analysis:

functional decompositionfunctional decomposition Procedural languages: e.g. Procedural languages: e.g. Algol 68, Algol 68, PascalPascal procedures and functionsprocedures and functions local variables, parameter passinglocal variables, parameter passing Conditional jumps are replacedConditional jumps are replaced

by if then else statementsby if then else statements by structured loops (for, while)by structured loops (for, while)

-> Structured Techniques: Nassi--> Structured Techniques: Nassi-Schneidermann,Schneidermann,

Jackson SP, etc.Jackson SP, etc.

-> Functional decomposition-> Functional decomposition

Page 7: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

7Systems Analysis - Introduction

Evolution of Systems Evolution of Systems Analysis:Analysis:

datadataNow people started realizing that they Now people started realizing that they

were neglecting an important issue: were neglecting an important issue: DATADATA..

Putting the emphasis on data, turned out Putting the emphasis on data, turned out to be an excellent idea. Suddenly people to be an excellent idea. Suddenly people could look at the bigger picture.could look at the bigger picture.

Data (state) is much more stable than Data (state) is much more stable than functionality (behavior). So systems built functionality (behavior). So systems built a around data are more stable, easier to a around data are more stable, easier to understand, easier to adapt, etc.understand, easier to adapt, etc.

Page 8: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

8Systems Analysis - Introduction

Evolution of Systems Evolution of Systems Analysis:Analysis:

normalized datanormalized dataAn excellent mathematical theory was An excellent mathematical theory was

developed as a theoretical basis for developed as a theoretical basis for databases. databases. Relational Databases:Relational Databases:

can be normalized -> avoid inconsistenciescan be normalized -> avoid inconsistencies Allow a seamless transition from analysis to Allow a seamless transition from analysis to

database implementation:database implementation:

-> E.R. modeling, normalized E.R. models-> E.R. modeling, normalized E.R. models

Page 9: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

9Systems Analysis - Introduction

Evolution of Systems Evolution of Systems Analysis:Analysis:

Object OrientationObject OrientationFull blown object oriented languages have Full blown object oriented languages have

been around since the early seventies. They been around since the early seventies. They took a long time to be widely adopted, even took a long time to be widely adopted, even by analysts. An introduction to OO modeling by analysts. An introduction to OO modeling will be given this semester.will be given this semester. Object Oriented languagesObject Oriented languages

Classes and encapsulation: Classes and encapsulation: State (data) and its behavior are put together in a classState (data) and its behavior are put together in a class of which the instances are called objects. Client code can of which the instances are called objects. Client code can

only change the state of an object indirectly (by using only change the state of an object indirectly (by using methods).methods).

Inheritance:Inheritance: New classes can be created by inheriting code from old New classes can be created by inheriting code from old

ones (without copy pasting )ones (without copy pasting ) Polymorphism:Polymorphism:

The same variable can contain objects of different classes The same variable can contain objects of different classes and a same routine call (=method) can result in different and a same routine call (=method) can result in different behavior depending on the class of the object.behavior depending on the class of the object.

Page 10: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

10Systems Analysis - Introduction

Evolution of Systems Evolution of Systems Analysis:Analysis:

Object OrientationObject OrientationObject Orientation looks like the right thing to Object Orientation looks like the right thing to

do.do.However there are some problems:However there are some problems:

OO is hard. It takes experience to tell the OO is hard. It takes experience to tell the difference between a useful and a useless design.difference between a useful and a useless design.

Unlike E.R. modeling and relational databases, Unlike E.R. modeling and relational databases, OO lacks strict rules, making OO modeling a bit OO lacks strict rules, making OO modeling a bit arbitrary. arbitrary.

Relational databases are ubiquitous and well Relational databases are ubiquitous and well understood. Converting objects to records understood. Converting objects to records remains a challenge. OO databases are not main-remains a challenge. OO databases are not main-stream yet.stream yet.

Page 11: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

11Systems Analysis - Introduction

Important OO works Important OO works ’’50ies en ’60ies: Early works about 50ies en ’60ies: Early works about

Simula , Nygaard & DahlSimula , Nygaard & Dahl phase 3, programming simulationsphase 3, programming simulations First steps to a real OO language, First steps to a real OO language, With SmallTalk, it became the With SmallTalk, it became the

inspiration for OO Analysisinspiration for OO Analysis 1991: Object-Oriented Analysis, 1991: Object-Oriented Analysis,

Coad & YourdonCoad & Yourdon phase 1phase 1 Short & simple but theoretical workShort & simple but theoretical work

Page 12: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

12Systems Analysis - Introduction

Important OO worksImportant OO works

1985: Eiffel, A Language for Software 1985: Eiffel, A Language for Software Engineering, Bertrand MeyerEngineering, Bertrand Meyer Phase 3, but also 1 en 2 (part of the point)Phase 3, but also 1 en 2 (part of the point)

1988: OO Software Construction, 1988: OO Software Construction, Bertrand MeyerBertrand Meyer Phase 1, 2 en 3 Phase 1, 2 en 3 Classic, quite hard, full of humor, very Classic, quite hard, full of humor, very

convincing, Meyer is a real guru.convincing, Meyer is a real guru.

Page 13: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

13Systems Analysis - Introduction

Important OO worksImportant OO works

1994: Design Patterns, Gamma & 1994: Design Patterns, Gamma & Helm & Johnson & VlissidesHelm & Johnson & Vlissides Phase 2, also 3Phase 2, also 3 Concentrates on design. Concentrates on design. Structured no nonsense catalog of OO Structured no nonsense catalog of OO

design patterns. Quite difficult but design patterns. Quite difficult but extremely useful work.extremely useful work.

Page 14: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

14Systems Analysis - Introduction

OO LiteratureOO Literature

1999: Refactoring, Improving the Design of 1999: Refactoring, Improving the Design of Existing Code, Martin FowlerExisting Code, Martin Fowler Phase 3, also 2Phase 3, also 2 Is about turning bad code into good code. Is about turning bad code into good code.

Contains lots of recognizable design problems for Contains lots of recognizable design problems for anyone who had to work with existing bad code.anyone who had to work with existing bad code.

The emphasis is on the importance of The emphasis is on the importance of automatic automatic testing. testing.

Others: Kent Beck, Ivar Jacobson, Barbara Others: Kent Beck, Ivar Jacobson, Barbara Liskov, James Rumbaugh, Bjarne Straustrup Liskov, James Rumbaugh, Bjarne Straustrup (C++), …(C++), …

Page 15: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

15Systems Analysis - Introduction

What is important ?What is important ?RespectRespect

What is the difference between a success and What is the difference between a success and failure ?failure ?

Some Critical Success Factors for software Some Critical Success Factors for software engineering:engineering:

Respect forRespect for The clientThe client the technology. the technology. What technology What technology is less importantis less important

procedural programming versus OO programmingprocedural programming versus OO programming relational databases versus OO databases relational databases versus OO databases Java versus VB versus C++ etc.Java versus VB versus C++ etc. bare hand versus RAD-toolsbare hand versus RAD-tools

yourself and the other team members.yourself and the other team members. If you are not motivated, you should find another job If you are not motivated, you should find another job

quickly.quickly.

Page 16: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

16Systems Analysis - Introduction

What is important ?What is important ?CommunicationCommunication

Background knowledge about the Background knowledge about the client’s business & communication client’s business & communication with the client in general with the client in general e.g. knowledge about the requirements: e.g. knowledge about the requirements:

what does the client want ?what does the client want ?

Impressive systems have been developed Impressive systems have been developed that were not wanted nor needed by that were not wanted nor needed by the client.the client.

Page 17: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

17Systems Analysis - Introduction

What is important ?What is important ?CommunicationCommunication

Page 18: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

18Systems Analysis - Introduction

What is important ?What is important ?Automated testsAutomated tests

AutomatedAutomated Tests Tests Enable continuous improvement of code Enable continuous improvement of code

design.design. Tell you whether the code works Tell you whether the code works

according to the specifications.according to the specifications.The important word here is The important word here is automatedautomated. .

This means that the testing code itself This means that the testing code itself ComparesCompares the result of the tested code with the result of the tested code with

the expected result.the expected result. ReportsReports problems. If every test went well, no problems. If every test went well, no

extensive listings are needed. (No screen extensive listings are needed. (No screen staring necessary)staring necessary)

Page 19: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

19Systems Analysis - Introduction

What is important ?What is important ?Project ManagementProject Management

Project ManagementProject Management Charismatic project leader who does Charismatic project leader who does

real work and who is generally real work and who is generally respected.respected.

Project planning: Clear and easily Project planning: Clear and easily verifiable goals.verifiable goals.

Methodology-process: There has to be Methodology-process: There has to be a generally accepted process.a generally accepted process.

Page 20: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

20Systems Analysis - Introduction

What is important ?What is important ?Avoid copy pasting codeAvoid copy pasting code

Avoid Copy-Paste codeAvoid Copy-Paste code Looks like a detail, but it’s really not.Looks like a detail, but it’s really not. Copy-Paste programming is Copy-Paste programming is THETHE cause of cause of

failure in phase 3 when large projects are failure in phase 3 when large projects are involved . It gives enables exponentially involved . It gives enables exponentially growing code: x2, x4, x8, x16, x32 …→ ∞ → growing code: x2, x4, x8, x16, x32 …→ ∞ → not maintainable.not maintainable.

Remedy: Collect common code,Remedy: Collect common code, call itcall it OR put it in a common class to which you delegateOR put it in a common class to which you delegate OR put it in a superclassOR put it in a superclass

Page 21: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

21Systems Analysis - Introduction

Some anti-patterns en code Some anti-patterns en code smells. I Anti-patternssmells. I Anti-patterns

Anti-pattern: common bad solutionAnti-pattern: common bad solution

Code smell: suspect code (Fowler, Code smell: suspect code (Fowler, Beck)Beck)

Page 22: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

22Systems Analysis - Introduction

Anti-patterns Anti-patterns

Anti-patternsAnti-patternsSome Anti Patterns ( Brown, Malveau,…):Some Anti Patterns ( Brown, Malveau,…):

The Blob: monolithic (non partitioned) huge The Blob: monolithic (non partitioned) huge procedure or classprocedure or class

Lava Flow: gradually degrading structure, Lava Flow: gradually degrading structure, due to new programmers that are non due to new programmers that are non willing to read the old code.willing to read the old code.

Golden Hammer: wanting to do everything Golden Hammer: wanting to do everything with 1 sacred tool. Example: everything in with 1 sacred tool. Example: everything in Excel macro’s, everything with XML.Excel macro’s, everything with XML.

Page 23: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

23Systems Analysis - Introduction

Anti-patterns Anti-patterns Spaghetti-code (too much dependence, Spaghetti-code (too much dependence,

goto)goto) Cut & paste programming (see above)Cut & paste programming (see above) Vendor Lock-InVendor Lock-In Design by committee:Design by committee:

Lack of leadership -> messy designLack of leadership -> messy design Reinvent the WheelReinvent the Wheel

Not knowing off the shelf productsNot knowing off the shelf products Analysis ParalysisAnalysis Paralysis

Lost touch with realityLost touch with reality Arguing about unimportant detailsArguing about unimportant details

Page 24: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

24Systems Analysis - Introduction

Code smells (phase 2 & Code smells (phase 2 & 3)3)

Code SmellsCode Smells

(Words used by Kent Beck & Martin (Words used by Kent Beck & Martin Fowler)Fowler) Duplicate code (copy paste, see above)Duplicate code (copy paste, see above) Too much parametersToo much parameters Too many properties in a class (data-Too many properties in a class (data-

fields)fields) Too much code in 1 classToo much code in 1 class Too many similar procedures or classesToo many similar procedures or classes

Page 25: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

25Systems Analysis - Introduction

Code smellsCode smells Data-classes: no methods or only get/set-Data-classes: no methods or only get/set-

methods.methods. method-classes: no data-fields or hardly used method-classes: no data-fields or hardly used

data-fields. (OK for design-level classes, but data-fields. (OK for design-level classes, but not for classes retained from analysis)not for classes retained from analysis)

Cryptic namingCryptic naming Lots of documentation (needed ?) -> Lots of documentation (needed ?) ->

probable design flawprobable design flaw

Cause: Unconscious IncompetenceCause: Unconscious Incompetencehttp://c2.com/cgi/wiki?UnconsciousIncompetencehttp://c2.com/cgi/wiki?UnconsciousIncompetence

Page 26: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

26Systems Analysis - Introduction

The handbookThe handbookThis semester we will focus on traditional This semester we will focus on traditional

proven techniques. A special course on OO proven techniques. A special course on OO Analysis is given in the third year.Analysis is given in the third year.

Our book for this year is:Our book for this year is:

TitleTitle: : Systems Analysis and Design Systems Analysis and Design Methods, Sixth EditionMethods, Sixth Edition

AuthorsAuthors:: Whitten-Bentley-DittmanWhitten-Bentley-Dittman PublisherPublisher: McGraw-Hill, 2003,: McGraw-Hill, 2003, ISBNISBN: 0-07-121521-2: 0-07-121521-2Slide handouts will be made available. Slide handouts will be made available.

Page 27: Systems Analysis I introduction I introduction. 2Systems Analysis - Introduction Contents Introduction Introduction 3 classic phases 3 classic phases

27Systems Analysis - Introduction

EvaluationEvaluation

Group assignment: 40%Group assignment: 40% Theory: 30 %Theory: 30 % Exercises: 30%Exercises: 30%