CS 435/535 ... to summarize Topics SW Development Processes - - PowerPoint PPT Presentation

cs 435 535 to summarize topics
SMART_READER_LITE
LIVE PREVIEW

CS 435/535 ... to summarize Topics SW Development Processes - - PowerPoint PPT Presentation

CS 435/535 ... to summarize Topics SW Development Processes Software Evolution Requirements Engineering Verification and Validation Use Cases Software testing UML Error reporting and tracking Patterns


slide-1
SLIDE 1

CS 435/535 ... to summarize

slide-2
SLIDE 2

Topics

  • SW Development Processes
  • Requirements Engineering
  • Use Cases
  • UML
  • Patterns
  • SW Architecture Patterns
  • Design Patterns
  • UI development
  • Software Evolution
  • Verification and

Validation

  • Software testing
  • Error reporting and tracking
  • Concept location
  • Mining SW repositories
slide-3
SLIDE 3

2

What is Software Engineering? “The establishment and use of sound engineering principles in order to obtain economically software that is reliable and works efficiently on real machines.”

  • IEEE Standard 610.12:

“The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software; that is, the application of engineering to software.”

slide-4
SLIDE 4

Challenges

  • People

– Understanding/knowledge, communication, capability

  • Size

– Use cases/Features/Requirements – #people involved, #modules, #classes, #testcases – Diversity: customer, SW/HW environment

  • Time
  • Change

4

slide-5
SLIDE 5

Cartoon

  • Prof. Majumdar CS 130 Lecture 1

38

slide-6
SLIDE 6

40

Problem #1: “How do we know it works?”

  • A specification allows us to:

– Check whether software works – Build software in teams at all

  • Actually checking that software works is hard

– Code reviews – Static analysis tools – Testing and more testing

slide-7
SLIDE 7

52

Problem #2: “How do we code efficiently?”

  • Efficient development requires

– Decomposing system into pieces

  • depends on what it does, how we build it, who does it

– Good interfaces between pieces

  • The pieces should be large

– Don’t try to break up into too many pieces

  • Interfaces are specifications of boundaries

– Must be well thought-out and well communicated

slide-8
SLIDE 8

53

Observation

  • Software engineering boils down to several issues:

– Specification: Know what you want to do – Design: Develop an efficient plan for doing it – Programming: Do it – Validation: Check that you have got what you wanted

  • Specifications are important

– To even define what you want to do – To ensure everyone understands the plan

slide-9
SLIDE 9

2

Software Engineering Layers

  • Process: framework of the required tasks

– e.g., waterfall, extreme programming

  • Methods: technical “how to”

– e.g., design review, code review, testing

  • Tools: automate processes and methods

– Which software engineering tools do you know?

Process Methods Tools

slide-10
SLIDE 10

Processes

  • Waterfall
  • Rapid Prototyping
  • Iterative Models (Spiral)
  • Extreme Programming

10

slide-11
SLIDE 11

5

XP Practices

  • On-site customer
  • The Planning Game

– User stories

  • Small releases
  • Testing

– TDD

  • Simple design

– Just in time design – YAGNI

  • Refactoring
  • Metaphor
  • Pair programming
  • instant, complete code review
  • different point of view
  • Collective ownership
  • Continuous integration
  • 40-hour week
  • Coding standards
slide-12
SLIDE 12

6

XP Process

Multiple short cycles (2 weeks):

  • 1. Meet with client to elicit requirements
  • User stories + acceptance tests
  • 2. Planning game
  • Break stories into tasks, estimate cost
  • Client prioritizes stories to do first
  • 3. Implementation
  • Write programmer tests first
  • Simplest possible design to pass the tests
  • Code in pairs
  • Occasionally refactor the code
  • 4. Evaluate progress and reiterate from step 1
slide-13
SLIDE 13

7

Extreme Programming (XP)

  • XP: like iterative but taken to the extreme

Scope Time Analyze Design Implement Test Waterfall Iterative XP

slide-14
SLIDE 14

Agile Software Development

  • “Agile Manifesto” 2001
  • “Scrum” project management

+ Extreme programming engineering practice

  • Idea: Build software incrementally,

– using short 1-4 week iterations – Keep development aligned with changing needs

50 Outline planning and architectural design Project closure Assess Select Review Develop Sprint cycle

slide-15
SLIDE 15

Chapter 2 Software Processes

Software specification (or requirements engineering) The process of establishing what services are required and the constraints on the system’s operation and development. Requirements engineering process

  • Feasibility study
  • Is it technically and financially feasible to build the system?
  • Requirements elicitation and analysis
  • What do the system stakeholders require or expect from the system?
  • Requirements specification
  • Defining the requirements in detail
  • Requirements validation
  • Checking the validity of the requirements

15

Sommerville: Ch 2.2.1, p36ff

slide-16
SLIDE 16

Chapter 2 Software Processes

The requirements engineering process

Feasibility study Requirements elicitation and analysis Requirements specification Requirements validation Feasibility report System models User and system requirements Requirements document

16

slide-17
SLIDE 17

Chapter 2 Software Processes

Outcome

  • An agreed requirements document that

specifies a system satisfying stakeholder requirements.

  • Two level of details

User requirements:

  • End-users and customers need a high-level

statement of the requirements.

System Requirements:

  • System developers need a more detailed system

specification.

17

slide-18
SLIDE 18

Summary of Requirements Gathering

  • Find out what users/clients need

– Not necessarily what they say they want

  • Use

– Interviews – User stories – Straw man documents – Rapid prototyping – As appropriate . . .

slide-19
SLIDE 19

Requirement vs. Specification

  • User Requirements

– Statements in natural language plus diagrams of the services the system provides and its operational constraints. Written for customers.

  • System Specifications

– A structured document setting out detailed descriptions of the system’s functions, services and operational constraints. Defines what should be implemented so may be part of a contract between client and contractor.

  • The distinction is often glossed over

– Sommerville sees this as two levels of detail in the requirements document, the system requirements are a “functional specification” Ch 4, p83.

slide-20
SLIDE 20

Specifications: theory & practice

  • In principle, specifications should be:

– Unambiguous:

  • Only one way to interpret the spec

– Complete

  • Include descriptions of all facilities required.

– Consistent

  • There should be no conflicts or contradictions in the

descriptions of the system facilities.

  • In practice, it is almost impossible to produce a

complete and consistent requirements document.

slide-21
SLIDE 21

Requirements

  • How to write up requirements?

– Informal, semi-formal, structured, formal

  • Requirements: functional vs non-functional
  • Goals vs verifiable non-func requirements
  • Requirements document vs design document
  • Structure of a requirements document

21

slide-22
SLIDE 22

Use Case

What it is:

 Text story  Widely used to discover and record (mostly functional)

requirements

 What is it about:  Some actor(s) using a system to meet specific goals  Answering questions:  Who is using the system, what are their typical

scenarios of use, and what are their goals? What it is NOT: Not object-oriented

 Not a diagram  UML use cases diagrams are “secondary-value” artifacts

Focus: use cases, not use case diagrams Historical: feature list (lacked context) -> use case

slide-23
SLIDE 23

Use Case Format

Brief

Succinct one-paragraph summary usually the main success scenario done during early requirements analysis should take only a couple of minutes

Casual

informal paragraph format multiple paragraphs covering various scenarios

Fully dressed

details all steps and variations includes supporting sections such as preconditions and success guarantees mainly done after many use cases are identified and during early requirements workshop for high-value and high-risk requirements (e.g., core architectural)

slide-24
SLIDE 24

Take an Actor and Actor-Goal Perspective

Use case definition by Jacobson:

“A set of use-case instances, where each instance is a sequence of actions a system performs that yields an

  • bservable result of value to a particular actor”

Write requirements focusing

 on the users/actors of a system,  asking about their goals and typical situations  and what they consider a valuable result

slide-25
SLIDE 25

How to Find Use Cases?

Choose the system boundary

what you are building? who will be using the system? what else will be used that you are not building?

Find primary actors and their goals

brainstorm the primary actors first who starts and stops the system? who gets notified when there are errors or failures?

Define use cases that satisfy user goals

prepare an actor-goal list (and not actor-task list) in general, one use case for each user goal name the use case similar to the user goal

slide-26
SLIDE 26

What Tests Can Help Find Useful Use Cases?

Rather than asking

 ”What is a valid use case?”

More practical question:

 “What is a useful level of focus to express use

cases for application requirements analysis?” Rules of thumb

 The Boss Test  The EBP Test  The size test

slide-27
SLIDE 27

Use Cases form Basis for Others

slide-28
SLIDE 28

9

UML: Unified Modeling Language

  • r “Union of all Modeling Languages”?
  • We discuss

– Use Case Diagrams for functional models – Class Diagrams – Object Diagrams – Sequence Diagrams – Activity Diagrams for dynamic models – State Diagrams

  • This is a subset of UML

– But probably the most used subset for structural models

slide-29
SLIDE 29

54

UML Driven Process

slide-30
SLIDE 30

65

Opinions about UML: What’s Good

  • A common language

– Makes it easier to share requirements, specs, designs

  • Visual syntax is useful, to a point

– A (good) picture is worth 1000 words – For the non-technical, easier to grasp simple diagrams than simple pseudo-code

  • To the extent UML is precise, it forces clarity

– Much better than natural language

  • Commercial tool support

– Something natural language could never have

slide-31
SLIDE 31

66

Opinions On UML: What’s Bad

  • Hodge-podge of ideas

– Union of most popular modeling languages – Sublanguages remain largely unintegrated

  • Visual syntax does not scale well

– Many details are hard to depict visually

  • Ad hoc text attached to diagrams

– No visualization advantage for large diagrams

  • 1000 pictures are very hard to understand
slide-32
SLIDE 32

Software architecture

  • Architectural Design:

– Design Process for

  • identifying the sub-

systems making up a system and

  • the framework for sub-

system control and communication

– Output of this design process:

  • description of the

software architecture

  • An early stage of the system

design process

  • Represents the link between

specification and design processes

  • Often carried out in parallel with

some specification activities

  • It involves identifying major

system components and their communications

slide-33
SLIDE 33

Common architectural styles (patterns) Garlan & Shaw:

  • Pipe-and-filter
  • Object-oriented

architectures

  • Event based systems

(implicit invocation)

  • Layered systems
  • Repositories
  • Table Driven Interpreters

Sommerville

  • Model View Controller
  • Layered systems
  • Repositories
  • Client-Server
  • Pipe-and-filter
slide-34
SLIDE 34

Software Design Patterns from CS 301 1.Iterator 2.Observer 3.Strategy 4.Composite 5.Decorator 6.Template 7.Singleton

34

also in Horstmann’s book

  • Adapter
  • Command
  • Factory
  • Proxy
  • Visitor
slide-35
SLIDE 35

Software Design Patterns in CS 435 1.Iterator 2.Observer 3.Strategy 4.Composite 5.Decorator 6.Template 7.Singleton

35

also in Horstmann’s book

  • Adapter
  • Command
  • Factory
  • Proxy
  • Visitor
slide-36
SLIDE 36

Version Control Systems: SVN, GIT

  • Enabling technology for productivity
  • must support parallelization
  • must support communication
  • Documentation as preserved communication
  • must support management of tasks & people
  • What needs to be done? When? By whom?
  • What has been done? By whom?

36

slide-37
SLIDE 37

Workflows: Director and Lieutenants

Image from http://git-scm.com/book/en/Distributed-Git-Distributed-Workflows

  • Supported by CVS and

SVN using branches

  • More easily supported by

distributed version control systems

  • Generally used by huge

projects (e.g., Linux kernel)

slide-38
SLIDE 38

Github Issue Tracker

  • Filter by open and closed issues, assignees, labels, and milestones.
  • Sort by issue age, number of comments, and update time.
  • Milestones / labels
slide-39
SLIDE 39

Software Evolution

  • Software development and evolution should be a single iterative process
  • Lehman’s Laws describe a number of insights into system evolution
  • Types of Maintenance (corrective, adaptive, perfective)
  • Process of evolution driven by change requests from system stakeholders
  • Software re-engineering is concerned with re-structuring and re-

documenting software to make it easier to change

  • The business value of a legacy system and its quality should determine

the evolution strategy that is used

39

slide-40
SLIDE 40

Life-cycle of Bug Reports

slide-41
SLIDE 41

Verification and Validation

 Verification: Are we building the product right?

– To which degree is the implementation consistent with its (formal or semi-formal) specification? – Testing, inspections, static analysis, …

 Validation: Are we building the right product?

– To which degree does the software fulfill its (informal) requirements? – Usability, feedback from users, …

6

slide-42
SLIDE 42

Approaches to Verification

Testing: run software to try and generate

failures

Static verification: identify (specific)

problems by looking at source code, that is, considering all execution paths statically

Inspection/review/walkthrough:

systematic group review of program text to detect faults

Formal proof: proving that the program

text implements the program specification

10

slide-43
SLIDE 43

Comparison

 Testing

– Purpose: reveal failures – Limits: small subset of the domain (=> risk of inadequate test set)

 Static verification

– Purpose: consider all program behaviors (and more) – Limits: false positives, may not terminate

 Review

– Purpose: systematic in detecting defects – Limits: informal

 Proof

– Purpose: prove correctness – Limits: complexity/cost (requires a formal spec)

11

slide-44
SLIDE 44

3

SW Faults, Errors & Failures

  • Software Fault : Static defect in the software (i.e., defect, bug)
  • Software Error : Incorrect internal state that is the manifestation of

some fault

  • Software Failure : External, incorrect behavior with respect to the

requirements or other description of the expected behavior

  • Three conditions necessary for a failure to be observed
  • Execution/Reachability: The location or locations in the

program that contain the fault must be reached

  • Infection: The state of the program must be incorrect
  • Propagation: The infected state must propagate to cause some
  • utput of the program to be incorrect

PIE model

slide-45
SLIDE 45

Testing

  • Two purposes:
  • 1. Find bugs

– Find important bugs

  • 2. Elucidate the specification

– When testing the prototype or straw man

11

  • No proof by example:

“Program testing can be a very efgective way to show the presence of bugs but is hopelessly inadequate for showing their absence” [Dijkstra]

  • Testing:

– Only validation technique for non-functional requirements – Should be used in conjunction with static verification to provide full V&V coverage

slide-46
SLIDE 46

Testing

  • Variants: black box, white box, unit, integration,

validation, functional/system, acceptance, alpha/beta, regression, security, performance, stress

  • Input selection: Input partitioning
  • Coverage: statement, branch, path, data-flow
  • Oracle Problem
  • Special topics: fuzz testing, symbolic execution,

concolic testing, hybrid concolic testing

46

slide-47
SLIDE 47

Error/Issue tracking

  • Reporting bugs:

– check for duplicates, – precise system and usage description, – expected and

  • bserved behavior

– reproducibility – symptoms vs suspected causes

  • Issues with trackers

47

slide-48
SLIDE 48

Concept Location Approaches

Software Reconn SPR ASDGs LSI NLP Cerberus PROMESIR SITIR SNIAFL DORA FCA

Static Textual Dynamic

Dit, Revelle, Gethers and Denys Poshyvanyk. “Feature Location in Source Code: A Taxonomy and Survey.” Submission to Journal of Software Maintenance and Evolution: Research and Practice.

SUADE

slide-49
SLIDE 49

Mining SW Repositories

  • Key idea:

– developers who changed this also changed that

  • Coincidence vs causality
  • ROSE approach:

– derive set of rules from historical changes – recognize entities that are frequently change together – Rule: support vs confidence – Quality of recommendation system: precision vs recall

49

slide-50
SLIDE 50

UI design

  • Principles:

– Familiarity, Consistency, Minimal Surprise, Recoverability from Errors, User Guidance

  • Golden Rules:

– Place the user in control – Reduce the user’s memory load – Be consistent

  • Patterns

– often deal with the organization of too much information for too little space / human capability

50

slide-51
SLIDE 51

UI Patterns: Overview of Examples

  • Two panel selector
  • One window drill down
  • Extras on demand
  • Step by step instructions
  • Progress indicator
  • Visual Framework
  • Clear Entry Points
  • Center Stage

51

  • Titled sections
  • Card stack
  • Closable panels
  • Movable panels
  • Diagonal balance
  • Progressive enabling
slide-52
SLIDE 52

Topics

  • SW Development

Processes

  • Requirements Engineering
  • Use Cases
  • UML
  • SW Architecture Patterns
  • Design Patterns
  • Software Evolution
  • Verification and

Validation

  • Software testing
  • Error reporting and

tracking

  • Concept location
  • Mining SW repositories
  • UI development