CS 435/535 ... to summarize Topics SW Development Processes - - PowerPoint PPT Presentation
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
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
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.”
Challenges
- People
– Understanding/knowledge, communication, capability
- Size
– Use cases/Features/Requirements – #people involved, #modules, #classes, #testcases – Diversity: customer, SW/HW environment
- Time
- Change
4
Cartoon
- Prof. Majumdar CS 130 Lecture 1
38
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
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
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
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
Processes
- Waterfall
- Rapid Prototyping
- Iterative Models (Spiral)
- Extreme Programming
10
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
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
7
Extreme Programming (XP)
- XP: like iterative but taken to the extreme
Scope Time Analyze Design Implement Test Waterfall Iterative XP
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
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
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
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
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 . . .
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.
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.
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
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
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)
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
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
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
Use Cases form Basis for Others
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
54
UML Driven Process
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
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
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
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
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
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
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
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)
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
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
Life-cycle of Bug Reports
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
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
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
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
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
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
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
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
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
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
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
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