cosc 4406 software engineering

37
1 COSC 4406 COSC 4406 Software Engineering Software Engineering Haibin Zhu, Ph.D. Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Dept. of Computer Science and mathematics, Nipissing University, 100 College Dr., North Bay, Nipissing University, 100 College Dr., North Bay, ON P1B 8L7, Canada, ON P1B 8L7, Canada, [email protected] , , http://www.nipissingu.ca/faculty/haibinz http://www.nipissingu.ca/faculty/haibinz

Upload: chloe

Post on 05-Jan-2016

37 views

Category:

Documents


0 download

DESCRIPTION

COSC 4406 Software Engineering. Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Nipissing University, 100 College Dr., North Bay, ON P1B 8L7, Canada, [email protected] , http://www.nipissingu.ca/faculty/haibinz. Lecture 4 Practice and System Engineering Ref. Chapter 5-6. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: COSC 4406 Software Engineering

1

COSC 4406COSC 4406

Software Software EngineeringEngineering

Haibin Zhu, Ph.D.Haibin Zhu, Ph.D.Dept. of Computer Science and mathematics, Nipissing University, Dept. of Computer Science and mathematics, Nipissing University,

100 College Dr., North Bay, ON P1B 8L7, Canada, 100 College Dr., North Bay, ON P1B 8L7, Canada, [email protected], http://www.nipissingu.ca/faculty/haibinz, http://www.nipissingu.ca/faculty/haibinz

Page 2: COSC 4406 Software Engineering

2

Lecture 4Lecture 4Practice and System Practice and System

EngineeringEngineeringRef. Chapter 5-6Ref. Chapter 5-6

Page 3: COSC 4406 Software Engineering

3

What is “Practice”?What is “Practice”?

Practice is a broad array of concepts, principles, Practice is a broad array of concepts, principles, methods, and toolsmethods, and tools that you must consider as that you must consider as software is planned and developed.software is planned and developed.

It represents the detailsIt represents the details—the technical —the technical considerations and how to’s—that are below the considerations and how to’s—that are below the surface of the software process—the things that surface of the software process—the things that you’ll need to actually build high-quality you’ll need to actually build high-quality computer software.computer software.

Page 4: COSC 4406 Software Engineering

4

The Essence of PracticeThe Essence of Practice

George Polya, in a book written in 1945 (!), George Polya, in a book written in 1945 (!), describes the essence of software engineering describes the essence of software engineering practice …practice …

Understand the problemUnderstand the problem (communication and analysis). (communication and analysis). Plan a solutionPlan a solution (modeling and software design). (modeling and software design). Carry out the planCarry out the plan (code generation). (code generation). Examine the result for accuracyExamine the result for accuracy (testing and quality (testing and quality

assurance).assurance).

At its core, good practice is At its core, good practice is common-sense common-sense problem solvingproblem solving

Page 5: COSC 4406 Software Engineering

5

Core Software Engineering Core Software Engineering PrinciplesPrinciples

Provide value to the customer and the Provide value to the customer and the useruser

KIS—keep it simple!KIS—keep it simple! Maintain the product and project Maintain the product and project

“vision”“vision” What you produce, others will consumeWhat you produce, others will consume Be open to the futureBe open to the future Plan ahead for reusePlan ahead for reuse Think!Think!

Page 6: COSC 4406 Software Engineering

6

Software Engineering Software Engineering PracticesPractices

Consider the generic process Consider the generic process frameworkframework CommunicationCommunication PlanningPlanning ModelingModeling ConstructionConstruction DeploymentDeployment

Here, we’ll identifyHere, we’ll identify Underlying principlesUnderlying principles How to initiate the practiceHow to initiate the practice An abbreviated task setAn abbreviated task set

Page 7: COSC 4406 Software Engineering

7

Communication PracticesCommunication Practices PrinciplesPrinciples

ListenListen Prepare before you communicatePrepare before you communicate Facilitate the communicationFacilitate the communication Face-to-face is bestFace-to-face is best Take notes and document decisionsTake notes and document decisions Collaborate with the customerCollaborate with the customer Stay focusedStay focused Draw pictures when things are unclearDraw pictures when things are unclear Move on …Move on … Negotiation works best when both parties Negotiation works best when both parties

win.win.

Page 8: COSC 4406 Software Engineering

8

Communication PracticesCommunication Practices InitiationInitiation

The parties should be physically close to one anotherThe parties should be physically close to one another Make sure communication is interactiveMake sure communication is interactive Create solid team “ecosystems”Create solid team “ecosystems” Use the right team structureUse the right team structure

An abbreviated task setAn abbreviated task set Identify who it is you need to speak withIdentify who it is you need to speak with Define the best mechanism for communicationDefine the best mechanism for communication Establish overall goals and objectives and define the Establish overall goals and objectives and define the

scopescope Get more detailedGet more detailed

Have stakeholders define scenarios for usageHave stakeholders define scenarios for usage Extract major functions/featuresExtract major functions/features

Review the results with all stakeholdersReview the results with all stakeholders

Page 9: COSC 4406 Software Engineering

9

Planning PracticesPlanning Practices PrinciplesPrinciples

Understand the project scopeUnderstand the project scope Involve the customer (and other stakeholders)Involve the customer (and other stakeholders) Recognize that planning is iterativeRecognize that planning is iterative Estimate based on what you knowEstimate based on what you know Consider riskConsider risk Be realisticBe realistic Adjust granularity as you planAdjust granularity as you plan Define how quality will be achievedDefine how quality will be achieved Define how you’ll accommodate changesDefine how you’ll accommodate changes Track what you’ve plannedTrack what you’ve planned

Page 10: COSC 4406 Software Engineering

10

Planning PracticesPlanning Practices

InitiationInitiation Ask Boehm’s questionsAsk Boehm’s questions

Why is the system begin developed?Why is the system begin developed? What will be done?What will be done? When will it be accomplished?When will it be accomplished? Who is responsible?Who is responsible? Where are they located (organizationally)?Where are they located (organizationally)? How will the job be done technically and managerially?How will the job be done technically and managerially? How much of each resource is needed?How much of each resource is needed?

Page 11: COSC 4406 Software Engineering

11

Planning PracticesPlanning Practices An abbreviated task setAn abbreviated task set

Re-assess project scopeRe-assess project scope Assess risksAssess risks Evaluate functions/featuresEvaluate functions/features Consider infrastructure functions/featuresConsider infrastructure functions/features Create a coarse granularity planCreate a coarse granularity plan

Number of software incrementsNumber of software increments Overall scheduleOverall schedule Delivery dates for incrementsDelivery dates for increments

Create fine granularity plan for first incrementCreate fine granularity plan for first increment Track progressTrack progress

Page 12: COSC 4406 Software Engineering

12

Modeling PracticesModeling Practices

We create models to gain a better understanding We create models to gain a better understanding of the actual entity to be builtof the actual entity to be built

Analysis modelsAnalysis models represent the customer represent the customer requirements by depicting the software in three requirements by depicting the software in three different domains: the information domain, the different domains: the information domain, the functional domain, and the behavioral domain. functional domain, and the behavioral domain.

Design modelsDesign models represent characteristics of the represent characteristics of the software that help practitioners to construct it software that help practitioners to construct it effectively: the architecture, the user interface, effectively: the architecture, the user interface, and component-level detail.and component-level detail.

Page 13: COSC 4406 Software Engineering

13

Analysis Modeling PracticesAnalysis Modeling Practices Analysis modeling principlesAnalysis modeling principles

Represent the information domainRepresent the information domain Represent software functionsRepresent software functions Represent software behaviorRepresent software behavior Partition these representationsPartition these representations Move from essence toward implementationMove from essence toward implementation

Elements of the analysis model (Chapter 8)Elements of the analysis model (Chapter 8) Data modelData model Flow modelFlow model Class modelClass model Behavior modelBehavior model

Page 14: COSC 4406 Software Engineering

14

Design Modeling PracticesDesign Modeling Practices PrinciplesPrinciples

Design must be traceable to the analysis modelDesign must be traceable to the analysis model Always consider architectureAlways consider architecture Focus on the design of dataFocus on the design of data Interfaces (both user and internal) must be designedInterfaces (both user and internal) must be designed Components should exhibit functional independenceComponents should exhibit functional independence Components should be loosely coupledComponents should be loosely coupled Design representation should be easily understoodDesign representation should be easily understood The design model should be developed iterativelyThe design model should be developed iteratively

Elements of the design modelElements of the design model Data designData design Architectural designArchitectural design Component designComponent design Interface designInterface design

Page 15: COSC 4406 Software Engineering

15

Construction PracticesConstruction Practices

Preparation principles:Preparation principles: Before you write Before you write one line of code, be sure you:one line of code, be sure you:

Understand of the problem you’re trying to solve (see Understand of the problem you’re trying to solve (see communicationcommunication and and modelingmodeling))

Understand basic design principles and concepts.Understand basic design principles and concepts. Pick a programming language that meets the needs of Pick a programming language that meets the needs of

the software to be built and the environment in which the software to be built and the environment in which it will operate.it will operate.

Select a programming environment that provides tools Select a programming environment that provides tools that will make your work easier.that will make your work easier.

Create a set of unit tests that will be applied once the Create a set of unit tests that will be applied once the component you code is completedcomponent you code is completed.

Page 16: COSC 4406 Software Engineering

16

Construction PracticesConstruction Practices

Coding principles: Coding principles: As you begin writing code, be As you begin writing code, be sure you:sure you:

Constrain your algorithms by following structured Constrain your algorithms by following structured programming [BOH00] practice.programming [BOH00] practice.

Select data structures that will meet the needs of the design.Select data structures that will meet the needs of the design. Understand the software architecture and create interfaces Understand the software architecture and create interfaces

that are consistent with it.that are consistent with it. Keep conditional logic as simple as possible.Keep conditional logic as simple as possible. Create nested loops in a way that makes them easily testable.Create nested loops in a way that makes them easily testable. Select meaningful variable names and follow other local Select meaningful variable names and follow other local

coding standards.coding standards. Write code that is self-documenting.Write code that is self-documenting. Create a visual layout (e.g., indentation and blank lines) that Create a visual layout (e.g., indentation and blank lines) that

aids understanding.aids understanding.

Page 17: COSC 4406 Software Engineering

17

Construction PracticesConstruction Practices

Validation Principles: Validation Principles: After you’ve After you’ve completed your first coding pass, be completed your first coding pass, be sure you:sure you:

Conduct a code walkthrough when Conduct a code walkthrough when appropriate.appropriate.

Perform unit tests and correct errors you’ve Perform unit tests and correct errors you’ve uncovered.uncovered.

Refactor the code. Refactor the code.

Page 18: COSC 4406 Software Engineering

18

Construction PracticesConstruction Practices

Testing PrinciplesTesting Principles All tests should be traceable to All tests should be traceable to

requirementsrequirements Tests should be plannedTests should be planned The Pareto Principle applies to testingThe Pareto Principle applies to testing Testing begins “in the small” and moves Testing begins “in the small” and moves

toward “in the large”toward “in the large” Exhaustive testing is not possibleExhaustive testing is not possible

Page 19: COSC 4406 Software Engineering

19

Deployment PracticesDeployment Practices

PrinciplesPrinciples Manage customer expectations for each Manage customer expectations for each

incrementincrement A complete delivery package should be A complete delivery package should be

assembled and testedassembled and tested A support regime should be establishedA support regime should be established Instructional materials must be provided to end-Instructional materials must be provided to end-

usersusers Buggy software should be fixed first, delivered Buggy software should be fixed first, delivered

laterlater

Page 20: COSC 4406 Software Engineering

20

System EngineeringSystem Engineering

Elements of a computer-based Elements of a computer-based systemsystem SoftwareSoftware HardwareHardware PeoplePeople DatabaseDatabase DocumentationDocumentation ProceduresProcedures

SystemsSystems A hierarchy of macro-elementsA hierarchy of macro-elements

Page 21: COSC 4406 Software Engineering

21

The The HierarchyHierarchy

World view

Business orProduct Domain

Domain of interest

Domain view

System element

Element view

Detailed view

Page 22: COSC 4406 Software Engineering

22

System ModelingSystem Modeling

define the processes that serve the needs of the define the processes that serve the needs of the view under consideration.view under consideration.

represent the behavior of the processes and the represent the behavior of the processes and the assumptions on which the behavior is based.assumptions on which the behavior is based.

explicitly define both exogenous and endogenous explicitly define both exogenous and endogenous input to the model.input to the model. exogenous inputs link one constituent of a given view with exogenous inputs link one constituent of a given view with

other constituents at the same level of other levels; other constituents at the same level of other levels; endogenous input links individual components of a endogenous input links individual components of a constituent at a particular view.constituent at a particular view.

represent all linkages (including output) that will represent all linkages (including output) that will enable the engineer to better understand the view.enable the engineer to better understand the view.

Page 23: COSC 4406 Software Engineering

23

Business Process Business Process EngineeringEngineering uses an integrated set of procedures, uses an integrated set of procedures,

methods, and tools to identify how methods, and tools to identify how information systems can best meet the information systems can best meet the strategic goals of an enterprisestrategic goals of an enterprise

focuses first on the enterprise and then on focuses first on the enterprise and then on the business areathe business area

creates enterprise models, data models creates enterprise models, data models and process modelsand process models

creates a framework for better creates a framework for better information management distribution, and information management distribution, and controlcontrol

Page 24: COSC 4406 Software Engineering

24

System ArchitecturesSystem Architectures

Three different architectures must be analyzed and Three different architectures must be analyzed and designed within the context of business objectives and designed within the context of business objectives and goals:goals:

data architecturedata architecture applications architectureapplications architecture technology infrastructuretechnology infrastructure

data architecturedata architecture provides a framework for the information provides a framework for the information needs of a business or business functionneeds of a business or business function

application architectureapplication architecture encompasses those elements of a encompasses those elements of a system that transform objects within the data architecture system that transform objects within the data architecture for some business purposefor some business purpose

technology infrastructuretechnology infrastructure provides the foundation for the provides the foundation for the data and application architecturesdata and application architectures

Page 25: COSC 4406 Software Engineering

25

The BPE The BPE HierarchyHierarchy Information strategy planning (ISP)Information strategy planning (ISP)

strategic goals definedstrategic goals defined success factors/business rules identifiedsuccess factors/business rules identified enterprise model createdenterprise model created

Business area analysis (BAA)Business area analysis (BAA) processes/services modeledprocesses/services modeled interrelationships of processes and datainterrelationships of processes and data

Application EngineeringApplication Engineering a.k.a ... software engineeringa.k.a ... software engineering modeling applications/procedures that address modeling applications/procedures that address

(BAA) and constraints of ISP(BAA) and constraints of ISP Construction and deliveryConstruction and delivery

using CASE and 4GTs, testingusing CASE and 4GTs, testing

Page 26: COSC 4406 Software Engineering

26

Information Strategy Information Strategy PlanningPlanning Management issuesManagement issues

define strategic business define strategic business goals/objectivesgoals/objectives

isolate critical success factorsisolate critical success factors conduct analysis of technology conduct analysis of technology

impactimpact perform analysis of strategic systemsperform analysis of strategic systems

Technical issuesTechnical issues create a top-level data modelcreate a top-level data model cluster by business/organizational cluster by business/organizational

areaarea refine model and clusteringrefine model and clustering

Page 27: COSC 4406 Software Engineering

27

Defining Objectives and Defining Objectives and GoalsGoals

ObjectiveObjective—general statement of —general statement of directiondirection

GoalGoal—defines measurable objective: —defines measurable objective: “reduce manufactured cost of our “reduce manufactured cost of our product”product” SubgoalsSubgoals::

decrease reject rate by 20% in first 6 monthsdecrease reject rate by 20% in first 6 months gain 10% price concessions from suppliersgain 10% price concessions from suppliers re-engineer 30% of components for ease of re-engineer 30% of components for ease of

manufacture during first yearmanufacture during first year Objectives tend to be strategic while Objectives tend to be strategic while

goals tend to be tacticalgoals tend to be tactical

Page 28: COSC 4406 Software Engineering

28

Business Area Business Area AnalysisAnalysis define “naturally cohesive groupings of define “naturally cohesive groupings of

business functions and data” (Martin)business functions and data” (Martin) perform many of the same activities as ISP, perform many of the same activities as ISP,

but narrow scope to individual business areabut narrow scope to individual business area identify existing (old) information systems / identify existing (old) information systems /

determine compatibility with new ISP modeldetermine compatibility with new ISP model define systems that are problematic define systems that are problematic defining systems that are incompatible with new defining systems that are incompatible with new

information modelinformation model begin to establish re-engineering prioritiesbegin to establish re-engineering priorities

Page 29: COSC 4406 Software Engineering

29

The BAA The BAA ProcessProcess

salesacct

manufacturing

QC

eng’ring

distribution

admin.

DataModel

ProcessDecomposition

DiagramMatrices

e.g.,entity/process

matrix

Process Flow

Models

Page 30: COSC 4406 Software Engineering

30

Product Product EngineeringEngineeringSystem analysis

(World view)

The completeproduct

capabilities

Componentengineering

(Domain view)

Processing requirement

Analysis & DesignModeling

(Element view)

Construction&

Integration(Detailed view)

software

function

SoftwareEngineering

programcomponent

hardware

data behavior

Page 31: COSC 4406 Software Engineering

31

Product Architecture Product Architecture TemplateTemplate

user interface processing

inputprocessing

outputprocessing

maintenance and self-test

process and controlfunctions

Hartley-Pirbhai Model

Page 32: COSC 4406 Software Engineering

32

Architecture Flow Architecture Flow DiagramDiagram

bar codereader

subsystem

bar codedecoding

subsystem

data baseaccess

subsystem

shuntcontrol

subsystem

reportformating

subsystem

diagnosticssubsystem

operatorinterface

subsystem

shuntcontroller

mainframecommunications

driver

operator requests CLSS queries, reports, displays

shunt control statusbar code acquisition request

bar code

pulse tach input

linespeed

bar codereader status

sensor status

raw barcode data

partnumber

reportrequests

binlocation

key

sort records

formatedreporting data

sorting reports

shunt commands

CLSS reports

BCR statusshunt status

communications status

timing/location data

operatorinterface

data acquisitioninterface diagnostic interface output interface

CLSS processing & control

sensor dataacquisitionsubsystem

Page 33: COSC 4406 Software Engineering

33

System Modeling with UMLSystem Modeling with UML

Deployment diagramsDeployment diagrams Each 3-D box depicts a hardware element that is Each 3-D box depicts a hardware element that is

part of the physical architecture of the systempart of the physical architecture of the system Activity diagramsActivity diagrams

Represent procedural aspects of a system Represent procedural aspects of a system elementelement

Class diagramsClass diagrams Represent system level elements in terms of the Represent system level elements in terms of the

data that describe the element and the operations data that describe the element and the operations that manipulate the datathat manipulate the data

These and other UML models will be discussed laterThese and other UML models will be discussed later

Page 34: COSC 4406 Software Engineering

34

Deployment DiagramDeployment Diagram

CLSS processor

Sorting subsystem

Sensor dataacquisition subsystem

Operator display

shunt controller

Conveyor Pulse tach

Bar code reader Shunt actuator

Page 35: COSC 4406 Software Engineering

35

Activity DiagramActivity Diagram

get conveyor speed

send shunt

control data

get shunt status read bar code

start conveyor line

determine bin location

valid bar code

set for reject bin

conveyor in motion

read bar code

get conveyor status

produce report entry

conveyor stopped

invalid bar code

Page 36: COSC 4406 Software Engineering

36

Class DiagramClass Diagram

Box

barcode forwardSpeed conveyorLocation height width depth weight contents

readBarcode() updateSpeed() readSpeed() updateLocation() readLocation() getDimensions() getWeight() checkContents()

class name

attributes note use of capital letter for multi-word attribute names

operations (parentheses at endof name indicate the list of attributes that theoperation requires)

Page 37: COSC 4406 Software Engineering

37

SummarySummary

PracticesPractices CommunicationCommunication PlanningPlanning ModelingModeling ConstructionConstruction Deployment Deployment

System EngineeringSystem Engineering Computer-based systemsComputer-based systems System Engineering HierarchySystem Engineering Hierarchy Business Process engineeringBusiness Process engineering Product engineeringProduct engineering System modelingSystem modeling