40
CS4510: Software Engineering Laurie Williams Graduate Student

CS4510: Software Engineering Laurie Williams Graduate Student

Embed Size (px)

Citation preview

Page 1: CS4510: Software Engineering Laurie Williams Graduate Student

CS4510: Software Engineering

Laurie Williams

Graduate Student

Page 2: CS4510: Software Engineering Laurie Williams Graduate Student

Course Objectives

To further your knowledge of process-based approaches to developing software for high-quality software products (xSP)

– (1-person) Individual based (Personal Software Process)

– (2-person) Collaborative team based (Collaborative Software Process)

– (4-person) Team based (Team Software Process)

To gain further knowledge of important Software Engineering techniques

Your future employer will most likely follow A process which will consist of various combinations of what we will be learning . . . the main lesson here is that it is important to know how to follow a process.

Page 3: CS4510: Software Engineering Laurie Williams Graduate Student

Software Engineering Techniques

Object Oriented Software Engineering– Unified Modeling Language (UML)– Rational Rose tool– CRC Cards

Software Measurements Design and Code Reviews   Quality Management Testing Software Planning and Estimating The Team Software Process (TSP)

NOTE: It is intended that the assignments will not be so big that you end up abandoning these new software engineering techniques “just to get done”

Page 4: CS4510: Software Engineering Laurie Williams Graduate Student

Grade Distribution

(Visual C++) Programming Assignments (40%) (Visual C++) Team Project (20%) Midterm (20%) Final (20%)

Page 5: CS4510: Software Engineering Laurie Williams Graduate Student

General Information Prerequisites

– Quarter sequence: CS354-CS355-CS356 OR

– Semester course: CS3500

Book / Materials– Required: “Adult” PSP Book “A Discipline for Software Engineering”– Required: “Introduction to the Team Software Process”– Arriving in a shrink-wrapped pack to the bookstore any day

Collaboration vs. Individual Work– Class will be curved according to groups, if need be.– The Institutional Review Board (IRB) has looked out for you!

Schedule– Tues. class in this classroom (EMCB 110) – Thurs. class in NT lab (EMCB 210)

» (Mandatory) Free lab time to work on your assignments– (Mandatory) Two hours/week additional lab time . . .we’ll be working out

schedule

Page 6: CS4510: Software Engineering Laurie Williams Graduate Student

It’s All About Motivation

WIIFY– A teacher who’s research is your class and will work to make

everything just right.

– Experience with leading edge software development techniques

– Get to do 1 ½ hour’s worth of homework on class time

– A guaranteed computer in the lab (for two hours) when you get there

WIIFM– Graduation . . . so I can finally be a “real professor” and teach

people like you for the rest of my life

Page 7: CS4510: Software Engineering Laurie Williams Graduate Student

Tidbits/Standard Stuff

Development Language/Environment: Visual C++ Class web page:

– http://www2.cs.utah.edu/classes/cs4510

Class lecture notes linked off the web– Will be there by noon (hopefully 10AM) day of class for you to print

Class mailing list:– subscribe to cs4510

» (majordomo@cs)

Class/lecture philosophy (borrowed from medical school):– “See one, do one, teach one”

My Office Hours TBD TA (Tao Hu) Office Hours TBD

Page 8: CS4510: Software Engineering Laurie Williams Graduate Student

Today’s Lecture

A “Process” Perspective GQM Paradigm Analysis: Use Cases

Page 9: CS4510: Software Engineering Laurie Williams Graduate Student

Process and Profession

Dennis J. Frailey

Page 10: CS4510: Software Engineering Laurie Williams Graduate Student

What Do These Words Mean?

PROCESSPROCESS

PROFESSIONPROFESSION

Regulation

Loss of Creativity

Meddling

“Police”

Doom and Gloom

End of the World

Order

Safety

Responsibility

Organization

Consistency

Reliability

Page 11: CS4510: Software Engineering Laurie Williams Graduate Student

The Way it Was

Protective Cloak of Technology and Nerdliness

Software Developers The Public

Who Cares!

Page 12: CS4510: Software Engineering Laurie Williams Graduate Student

The Way it Is Becoming

Who should we sue for this fiasco?

Why does this software crash all

the time?

My pacemaker has a

computer!

Page 13: CS4510: Software Engineering Laurie Williams Graduate Student

Software Engineering

Black ArtBlack Art ProfessionProfession

Page 14: CS4510: Software Engineering Laurie Williams Graduate Student

Good Things I Have Seen with Process Focus

More Accurate Estimates

Software that does Not Crash (at least not often :-)

Higher Productivity

Page 15: CS4510: Software Engineering Laurie Williams Graduate Student

Bad Things I Have Seen with Process Focus

Overly Prescriptive Interpretations People wanting a Cookbook instead of a Model Dehumanization of Software Development Process Blamed because it is not a “Silver Bullet”

... Employees Leaving because they Don’t Like the Climate (i.e.

dropping the class)

Page 16: CS4510: Software Engineering Laurie Williams Graduate Student

Proper Use of Process(and Professionalism)

Education and Understanding are the Keys to Effective and Proper Use

– True professionals in any field always have good processes and practices

» Even if they don’t use that terminology

– They know how to make effective use of good processes and practices

– And they know when the processes and practices do not apply

Page 17: CS4510: Software Engineering Laurie Williams Graduate Student

“Take Aways”

We need to be professionals We need to follow a process

– Could be PSP, CSP . . . or whatever

– Alternative: Ad hoc (Black Art)

Need to understand the process enough to know when it it is prudent to apply and when it is not

– Programmer

– Management

Page 18: CS4510: Software Engineering Laurie Williams Graduate Student

when it it is prudent to apply and when it is not . . .

“I know I should be doing a more thorough design but I really don’t feel like it.”

“I’ve been programming for years now, and I forgot one silly semicolon. It’s really not worth the time to record this defect.”

“Note that any predefined process must be an approximation, so some of the exercises in this book may be more helpful to you than others. After you have practiced them all, you will be able to decide which to use and when. Apply the PSP principles where you feel they will help.”

– It is a PERSONAL software process . . . It presents many useful techniques, try them and then do what works for you

Page 19: CS4510: Software Engineering Laurie Williams Graduate Student

PSP Compile Time Range

0

5

10

15

20

25

30

35

1 2 3 4 5 6 7 8 9 10

Program Number

% o

f T

ota

l T

ime

Max

Avg

Min

Page 20: CS4510: Software Engineering Laurie Williams Graduate Student

(PSP) Defects Found in Test - Range

02040

6080100120140

160180200

1 2 3 4 5 6 7 8 9 10

Program Number

De

fec

ts/K

LO

C

Max

Avg

Min

Page 21: CS4510: Software Engineering Laurie Williams Graduate Student

PSP Productivity Range

01020

3040506070

8090100

1 2 3 4 5 6 7 8 9 10

Program Number

LO

C/H

ou

r

Max

Avg

Min

Page 22: CS4510: Software Engineering Laurie Williams Graduate Student

Goal - Question - Metric (GQM) Paradigm

Define the principle goals for your activity Construct a comprehensive set of questions to help

you achieve these goals Define and gather the data required to answer these

questions

Page 23: CS4510: Software Engineering Laurie Williams Graduate Student

Goals

It’s ALL about

GOAL

WIIFM

What’s standing in your way / What do you need to do to achieve this?

How will you know when you accomplished this?

Page 24: CS4510: Software Engineering Laurie Williams Graduate Student

Question

Make “vague goals” more concrete

For each process goal, where did I start, where am I going now, and where do I want to go?

– How fast can I run now? How fast do I want to run?

What is important about this goal? – WIIFM?

What the best that has been achieved against this goal?

Page 25: CS4510: Software Engineering Laurie Williams Graduate Student

Metrics

To explicitly and efficiently answer the questions (which relate to the goals)

Data gathering takes time . . . It’s all about motivation! The data can effect your performance

– “Hawthorne effect” whereby behavior changes depending on what is measured

– Best if these software measurements can be personal

» In this class, your grade WON’T be based on how fast you code or how many defects you have (as long as you remove them!!)

All I really care about is that you are entering data accurately so that you can learn the lessons of the class

» Ideally, this will be the case in industry too

Page 26: CS4510: Software Engineering Laurie Williams Graduate Student

A GQM Example

Goal: To produce programs that contain no defects Question: How can you produce software of such

quality that no defects will be found later in test? Metrics:

– No way to GUARANTEE that you have produced an error-free product.

– With sufficient data and a suitably controlled process you can improve the likelihood that your program is error-free

– Define a strategy for deciding when a program is of high enough quality to be released, if it should be reappraised, or if it should be scrapped and re-engineered . . . Garbage In, Garbage Out (GIGO)

» # of defects removed in Code Review» # of defects in test

Page 27: CS4510: Software Engineering Laurie Williams Graduate Student
Page 28: CS4510: Software Engineering Laurie Williams Graduate Student

CS 451 L13 - 28

Object Oriented Software Engineering:Requirements Analysis

“How to figure out what it is that you should be doing, before you start doing

what it is that you should be doing.”

Systemengineering

Analysis

Design

Coding

Testing

Maintenance

Planning, estimation, organization, process, management, ...

Configuration control, metrics, defect tracking, reuse, documentation, ...

Page 29: CS4510: Software Engineering Laurie Williams Graduate Student

Goals of Performing Analysis

To understand the problem or problems that the eventual software system should solve

To prompt relevant questions about the problem and the system

To provide a basis for answering questions about specific properties of the problem and system

To decide what the system should do To decide what the system should not do To ascertain that the system will satisfy the needs

of its users, and define acceptance criteria To provide a basis for the development of the

system

Page 30: CS4510: Software Engineering Laurie Williams Graduate Student

Visual Modeling (from Terry Quatrani: Visual Modeling with Rational Rose and UML)

A way of thinking about problems using models organized around real-world ideas

– We can visualize them in our head

To promote a better understanding of requirements, cleaner designs, and more maintainable systems

We build models because we cannot comprehend such systems in their entirety

– Focus on the big picture of how a project’s components interact

– Without getting bogged down in the specific details of each component

Page 31: CS4510: Software Engineering Laurie Williams Graduate Student

The Triangle for Success

Notation: Unified Modeling Language (UML)

Tool: Rational RoseProcess: PSP/CSP/TSP

Page 32: CS4510: Software Engineering Laurie Williams Graduate Student

External System Behavior: Use Case Model Complete course of events in the system, from the

user’s perspective Use Cases Model: Illustrates

– (use cases) the system’s intended functions

– (actors) surroundings – external to the system

– (use case diagrams) relationships between use cases and actors

Use Case Model is an important communication vehicle between customers (they can understand it!) and developers

The collection of all use cases is everything that can be done to/with the system

Page 33: CS4510: Software Engineering Laurie Williams Graduate Student

Actors

Are NOT part of the system – they represent anyone or anything that must interact with the system

– Only input information to the system

– Only receive information from the system

– Both input to and receive information from the system

Represented in UML as a stickman

Page 34: CS4510: Software Engineering Laurie Williams Graduate Student

A Case Study: Eastern State University (ESU) Registration Problem: Background

After professors decide which courses they will teach, the Registrar enters in info in the computer

A course catalog is printed and distributed to students Students fill out form with their choices – usually 4 courses Registrar enters this info into computer A batch job is run overnight to assign students to courses In cases of conflict where the students cannot take the classes they

had selected, the registrar contacts the students directly to obtain additional choices.

Once all students have successfully assigned to courses, a hardcopy of the schedule is sent to the student.

Professors obtain student rosters for their classes.

Page 35: CS4510: Software Engineering Laurie Williams Graduate Student

Eastern State University (ESU) Registration Problem: Problem Statement

Professors indicate which courses they will teach on-line. A course catalog is printed Allow students to select on-line four courses (and two

additional choices) for upcoming semester. No course may have more than 10 students (this is not the U!)

or less than 3 students. When the registration is completed, the system sends

information to the billing system. Professors can obtain course rosters on-line. Students can add or drop classes on-line.

Who are the actors??

Page 36: CS4510: Software Engineering Laurie Williams Graduate Student

Use Case

A sequence of transactions performed by a system that yields a measurable result of values for a particular actor

– What are the tasks of each actor?

– Will any actor create, store, change, remove or read information in the system?

– What use cases will create, store, change, remove or read this information?

– Will any actor need to inform the system about sudden, external changes?

– Does any actor need to be informed about certain occurrences in the system?

– What use cases will support and maintain the system?

– Can all functional requirements be preformed by the use cases?

A use case typically represents a major piece of functionality that is complete from beginning to end. A use case must deliver something of value to an actor.

What are the uses cases in the ESU Course Registration System??

Page 37: CS4510: Software Engineering Laurie Williams Graduate Student

Flow of Events for a Use Case Description of the events needed to accomplish the

required behavior of the use case. Written in terms of what the system should do, not how the system does it

– When and how the use case starts and ends– What interaction the use case has with the actors– What data is needed by the use case– The normal sequence of events for the use case– The description of any alternative or exceptional flows

Done in an iterative manner. – First just the normal flow of the use case– More details– Exceptional flows added

Page 38: CS4510: Software Engineering Laurie Williams Graduate Student

Template for Flow of Events

X Flow of Events for the <name> Use Case

X.1 Preconditions

X.2 Main Flow

X.3 Subflows (if applicable)

X.4 Alternative Flows

Where X is a number from 1 to the number of use cases

IMPORTANT: Be flexible – do what’s appropriate for the use case.

Page 39: CS4510: Software Engineering Laurie Williams Graduate Student

UML Relationships

Between Actor and Use Case– Association / Communication– Arrow can be in either or both directions– Arrow indicates who initiates

communication

Between Use Cases (Generalization): – Uses

» Where multiple use cases sharepieces of same functionality

– Extends» Optional behavior» Behavior only run under certain

conditions (such as alarm)» Several different flows run base on

user selection

Page 40: CS4510: Software Engineering Laurie Williams Graduate Student

Stereotypes

Provides the capability to extend the basic modeling elements to create new elements

Allows the UML to have a minimal set of symbols that may be extended where needed to provide the communication artifacts that have meaning for the system under development

Included within << >> and placed along the relationship line

– << Communicates >>

– << Extends >>

– << Uses >>

– Define your own . . .