Development Methodologies Dr. James A. Bednar jbednar@inf.ed.ac.uk - - PowerPoint PPT Presentation

development methodologies
SMART_READER_LITE
LIVE PREVIEW

Development Methodologies Dr. James A. Bednar jbednar@inf.ed.ac.uk - - PowerPoint PPT Presentation

Development Methodologies Dr. James A. Bednar jbednar@inf.ed.ac.uk http://homepages.inf.ed.ac.uk/jbednar Dr. David Robertson dr@inf.ed.ac.uk http://www.inf.ed.ac.uk/ssp/members/dave.htm SAPM Spring 2012: Methodologies 1 Development


slide-1
SLIDE 1

Development Methodologies

  • Dr. James A. Bednar

jbednar@inf.ed.ac.uk http://homepages.inf.ed.ac.uk/jbednar

  • Dr. David Robertson

dr@inf.ed.ac.uk http://www.inf.ed.ac.uk/ssp/members/dave.htm

SAPM Spring 2012: Methodologies 1

slide-2
SLIDE 2

Development Methodologies

A methodology is a system of methods and principles used in a particular “school” of software design. There is a wide variety of published methodologies, and an even larger set of informal and/or company-specific

  • methodologies. The most mature methodologies are often

codified using specialist tools and techniques. All methodologies are controversial, because some people argue that any fixed methodology is an affront to a professional, creative, independent designer, while the rest argue about which methodology is best.

SAPM Spring 2012: Methodologies 2

slide-3
SLIDE 3

Example Methodologies

In this course we will focus on three main methodologies:

  • The Waterfall Model (discussed in many courses)
  • The Unified Process (UP) (partly covered in CS2)
  • Extreme Programming (XP)

(But we will mention many others, such as Cleanroom, DSDM, V-model, Scrum, Crystal, etc.!) We will also discuss open-source design, which is more of a philosophical approach than a methodology like the

  • thers, but which has implications for methodology.

SAPM Spring 2012: Methodologies 3

slide-4
SLIDE 4

Types of Methodologies

XP Milestone development risk−driven models Milestone plan−driven models contract ironbound Agile methods Adaptive SW Inch−pebble Hackers Software CMM CMM

“Cowboy hacking” and micromanaging are at the extremes

  • f a continuum (Boehm 2002).

Basic distinction: agile vs. heavyweight Agile methods are more fashionable to discuss, but it’s hard to tell what people are actually using.

SAPM Spring 2012: Methodologies 4

slide-5
SLIDE 5

Plan-Driven Model: Waterfall

(Royce 1970). Inspired by older engineering disciplines, such as civil and mechanical (e.g. how cathedrals are built). Development of a release is broken into phases, each of which is completed and “signed-off” before moving on. When problems are found, must backtrack to a previous phase and start again with the sign-off procedures. Much time and effort is spent on getting early phases right, because all later phases depend on them.

SAPM Spring 2012: Methodologies 5

slide-6
SLIDE 6

Waterfall Model of One Release

Implementation System test Revalidation Product verification Unit test Verification Verification Validation Validation System feasibility Product design Detailed design Code Integration Plans and requirements Operation and maintenance

This is just one example – actual steps differ for every project!

SAPM Spring 2012: Methodologies 6

slide-7
SLIDE 7

Problems with Waterfall Model (1)

In practice it is rarely possible to go straight through from requirements to design to implementation, without backtracking. There is no feedback on how well the system works, and how well it solves users’ needs, until nearly the very end. Large danger of catastrophic failure:

  • Any error in key user requirements dooms entire process
  • Big chance that the design is not actually feasible
  • Big potential for unacceptable performance

SAPM Spring 2012: Methodologies 7

slide-8
SLIDE 8

Problems with Waterfall Model (2)

In my opinion, the waterfall model is simply a fundamentally flawed metaphor for software development. Design and debugging together account for nearly all

  • f SW development, with almost no construction step

(just compilation!). This is a huge difference from electronic hardware design (where manufacturing and procurement typically dominate the process), or civil engineering (where construction dominates the process).

SAPM Spring 2012: Methodologies 8

slide-9
SLIDE 9

The Unified Process

Typical heavyweight approach. Iterative modification of waterfall model using modeling to forestall backtracking:

  • Component based
  • Uses UML for all blueprints
  • Use-case driven
  • Architecture centric
  • Iterative and incremental

We just give an overview; see Jacobson et al. (1998) for details.

SAPM Spring 2012: Methodologies 9

slide-10
SLIDE 10

Relatives of The Unified Process

The IBM Rational Unified Process (RUP) is a commercial product and toolset, superseding:

  • The Objectory Process
  • The Booch Method
  • The Object Modeling Technique

The Unified Software Development Process (UP) is a published, non-proprietary method based on the RUP , but without specific commercial tools or proprietary methods.

SAPM Spring 2012: Methodologies 10

slide-11
SLIDE 11

Phases of UP Design

Each software release cycle proceeds through a series of phases, each of which can have multiple modeling iterations: Inception : Produces commitment to go ahead (business case feasibility and scope known) Elaboration : Produces basic architecture; plan of construction; significant risks identified; major risks addressed Construction : Produces beta-release system Transition : Introduces system to users

SAPM Spring 2012: Methodologies 11

slide-12
SLIDE 12

Waterfall Iterations Within Phases

WORKFLOWS Inception Elaboration Construction Transition PHASES ITERATIONS 1 2 3 4 5 6 7 8 9 Implementation Test Design Analysis Requirements

  • Each phase can have

multiple iterations (Project proceeds top to bottom, then left to right)

  • Each iteration can

include all workflows, but some are more heavily weighted in different phases

  • Still relatively hard to change

requirements once implementation underway

SAPM Spring 2012: Methodologies 12

slide-13
SLIDE 13

UP vs. Waterfall Cycle

WORKFLOWS Inception Elaboration Construction Transition PHASES ITERATIONS 1 2 3 4 5 6 7 8 9 Implementation Test Design Analysis Requirements WORKFLOWS Inception Elaboration Construction Transition PHASES ITERATIONS Implementation Test Design Analysis Requirements

SAPM Spring 2012: Methodologies 13

slide-14
SLIDE 14

The Product: A Series of Models

Analysis model Design model Deployment model Implementation model Test model Use−Case model specification realisation distribution implementation verification

SAPM Spring 2012: Methodologies 14

slide-15
SLIDE 15

Use Cases

“A use case specifies a sequence of actions, including variants, that the system can perform and that yields an

  • bservable result of value to a particular actor.”

These drive:

  • Requirements capture
  • Analysis and design of how system realizes use cases
  • Acceptance/system testing
  • Planning of development tasks
  • Traceability of design decisions back to use cases

SAPM Spring 2012: Methodologies 15

slide-16
SLIDE 16

UP Example: 1

Initial use-case diagram:

Customer Withdraw money Deposit money accounts Transfer between

SAPM Spring 2012: Methodologies 16

slide-17
SLIDE 17

UP Example: 2

Analysis classes for withdrawing money:

Withdraw money Withdraw money ANALYSIS MODEL USE−CASE MODEL Dispenser Cashier interface Withdrawal Account

SAPM Spring 2012: Methodologies 17

slide-18
SLIDE 18

UP Example: 3

Collaboration diagram for withdrawing money:

Customer Cashier interface Dispenser Withdrawal Account validate and withdraw identify request authorise dispense

SAPM Spring 2012: Methodologies 18

slide-19
SLIDE 19

UP Example: 4

Design classes introduced for analysis classes:

Cashier interface Display Key pad Card reader Dispenser sensor Dispenser feeder Cash counter Withdrawal Account Dispenser Withdrawal Account ANALYSIS MODEL DESIGN MODEL Client manager Transaction manager Account manager

SAPM Spring 2012: Methodologies 19

slide-20
SLIDE 20

UP Example: 5

Class diagram which is part of the realization of the design model:

Customer Display Key pad Card reader Client manager Dispenser sensor Cash counter Dispenser feeder Transaction manager Account manager Account Withdrawal

SAPM Spring 2012: Methodologies 20

slide-21
SLIDE 21

UP Example: 6

Sequence diagram for part of the realization:

Card reader Customer Display Key pad Client manager Cash counter Transaction manager Insert card Card inserted Ask for PIN code Show request Specify PIN code PIN code Request for validation Ask amount Show request Specify amount Amount Request cash available Request withdrawal

SAPM Spring 2012: Methodologies 21

slide-22
SLIDE 22

Assumptions of UP

UP (and other heavyweight methodologies) concentrate

  • n carefully controlled, up-front, well-documented thinking.

Based on assumption that cost of making changes rises exponentially through the development stages. To minimize backtracking, UP establishes rigorous control

  • ver each stage.

At each stage of UP , a model acts as a proxy for the whole system, helping to bring out problems as early as possible (before they are set in code).

SAPM Spring 2012: Methodologies 22

slide-23
SLIDE 23

Problems with UP

Heavy training, documentation, and tools requirements — learning and using UML, modeling, process, tools, techniques. UML is not a native language for customers, and so it can be hard for them to provide good feedback until system is implemented. Requirements are very difficult to change at late stages, if needed to match changes in business world, address new competition, or fix mistakes in requirements capture.

SAPM Spring 2012: Methodologies 23

slide-24
SLIDE 24

Extreme Programming (XP)

What if it were possible to make the cost of change constant across all stages, so that design and requirements can be changed even at late stages? XP tries to prevent backtracking by keeping the system continuously flexible, eliminating the need for determining the final correct requirements and design before implementation. XP started the trend toward “agile” processes (like Scrum and Crystal), focusing on closely knit, fast moving design/coding teams and practices (Beck 1999).

SAPM Spring 2012: Methodologies 24

slide-25
SLIDE 25

UP Cycle vs. XP Development

WORKFLOWS Inception Elaboration Construction Transition PHASES ITERATIONS 1 2 3 4 5 6 7 8 9 Implementation Test Design Analysis Requirements WORKFLOWS Inception PHASES 1 2 3 4 5 6 7 8 Implementation Test Design Analysis Requirements Maintenance Development RELEASES

SAPM Spring 2012: Methodologies 25

slide-26
SLIDE 26

XP is Controversial

An IBM Java poll on XP from

www.xprogramming.com said roughly this:

  • “I’ve tried it and loved it” (51%)
  • “I’ve tried it and hated it” (8%)
  • “It’s a good idea but it could never work” (25%)
  • “It’s a bad idea - it could never work” (16%)

Of course, the UP is widely resented as well...

SAPM Spring 2012: Methodologies 26

slide-27
SLIDE 27

How XP Imposes Control

Through a set of “practices” to which designers adhere (using whatever other compatible methods and tools they prefer). See: www.extremeprogramming.org/rules.html Not strongly influenced by a particular design paradigm (unlike UP). Does require a strongly held (“extreme”) view of how to approach design. We consider some key practices in the following slides.

SAPM Spring 2012: Methodologies 27

slide-28
SLIDE 28
  • 1. The Planning Process

An XP project starts with a “Planning Game”. The “customer” defines the business value of desired “user stories”. The programmers provide cost estimates for implementing the user stories in appropriate combinations. No one is allowed to speculate about producing a total system which costs less than the sum of its parts.

SAPM Spring 2012: Methodologies 28

slide-29
SLIDE 29

User Stories vs. Use Cases

A user story meets a similar need as a use case, but is textual, not graphical, and is something that any customer can do without training in UML. A user story deliberately does not include all the possible exceptions, variant pathways, etc. that go into use cases. Short example: “A bank customer goes up to an ATM and withdraws money from her account.”

SAPM Spring 2012: Methodologies 29

slide-30
SLIDE 30
  • 2. On-site customer

Someone who is knowledgeable about the business value

  • f the system sits with the design team.

This means there is always someone on hand to clarify the business purpose, help write realistic tests, and make small scale priority decisions. The customer acts as a continuously available source of corrections and additions to the requirements.

SAPM Spring 2012: Methodologies 30

slide-31
SLIDE 31
  • 3. Small Releases

Put a simple system into production early, implementing a few important user stories. Re-release it as frequently as possible while adding significant business value (a set of important user stories) in each release. E.g., aim for monthly rather than annual release cycles. The aim is to get feedback as soon as possible.

SAPM Spring 2012: Methodologies 31

slide-32
SLIDE 32
  • 4. Continuous Testing

Write the tests before writing the software. Customers provide acceptance tests. Continuously validate all code against the tests. Tests act as system specification.

SAPM Spring 2012: Methodologies 32

slide-33
SLIDE 33
  • 5. Simple Design

Do the simplest thing that could possibly work. Don’t design for tomorrow — you might not need it. Extra complexity added “just in case” will fossilize your design (e.g. your class hierarchies) and get into the way of the changes you will need to make tomorrow.

SAPM Spring 2012: Methodologies 33

slide-34
SLIDE 34
  • 6. Refactoring

When tomorrow arrives, there will be a few cases where you actually have to change the early simple design to a more complicated one. Change cannot occur only through small, scattered changes, because over time such changes will gradually turn the design into spaghetti. To keep the design modifiable at all stages, XP relies on continuous refactoring: improving the design without adding functionality.

SAPM Spring 2012: Methodologies 34

slide-35
SLIDE 35
  • 7. Collective Ownership

Anyone is allowed to change anyone else’s code modules, without permission, if he or she believes that this would improve the overall system. To avoid chaos, collective ownership requires a good revision control (configuration management) tool, but those are now widely available.

SAPM Spring 2012: Methodologies 35

slide-36
SLIDE 36
  • 8. Coding Standard

Since XP requires collective ownership (anyone can adapt anyone else’s code) the conventions for writing code must be uniform across the project. This requires a single coding standard to which everyone adheres.

SAPM Spring 2012: Methodologies 36

slide-37
SLIDE 37
  • 9. Continuous Integration

Integration and full-test-suite validation happens no more than a day after code is written. This means that individual teams don’t accumulate a library of possibly relevant but obscure code. Moreover, it enables everyone to freely modify code at any time, because they know that they have access to the latest design.

SAPM Spring 2012: Methodologies 37

slide-38
SLIDE 38
  • 10. Pair Programming

All code is written by a pair of people at one machine.

  • One partner is doing the coding
  • The other is considering strategy (Is the approach

going to work? What other test cases might we need? Could we simplify the problem so we don’t have to do this? Etc.) This is unpalatable to some but appears vital to the XP method, because it helps make collective code ownership work.

SAPM Spring 2012: Methodologies 38

slide-39
SLIDE 39
  • 11. 40-Hour week

XP is intense so it is necessary to prevent “burnout”. Designers are discouraged from working more than 40 hours per week (which is low compared to the rest of the software world!). If it is essential to work harder in one week then the following week should drop back to normal (or less).

SAPM Spring 2012: Methodologies 39

slide-40
SLIDE 40

Problems with XP (1)

Published interfaces (e.g. APIs): some code is not practical to refactor, because not all uses can be known, so that code must anticipate all reasonable tomorrows. Many programmers resist pair programming or other XP guidelines; teams are often spread geographically, and even at one site sharing a computer is often awkward. The customer isn’t always available or willing, and may not be able to agree to an open-ended process. Over time XP has become more heavy weight, trying to incorporate new realizations, just as UP did.

SAPM Spring 2012: Methodologies 40

slide-41
SLIDE 41

Problems with XP (2)

XP is deliberately ‘low ceremony’ — will not normally produce documents describing its architecture, for

  • example. Needs special care to ‘wrap up’ properly when

the team is disbanded — all crucial information must be visible in the code, tests or other durable deliverables. If this is not arranged, long-term support and maintenance

  • f an XP-developed product can be problematic.

SAPM Spring 2012: Methodologies 41

slide-42
SLIDE 42

Summary

  • Methodologies: principled ways to manage large projects
  • Waterfall model works in other disciplines, where most
  • f the work is on the physical implementation, but in

SE nearly all work is conceptual

  • Unified Process constructs gradually more elaborate

models to uncover risks and solidify requirements and design as early as possible

  • Extreme Programming relies on continuous customer

involvement, testing, and refactoring to deliver code early and continuously, minimizing risk of complete failure.

  • We have done overviews only – you will need to read

more to actually implement any process!

SAPM Spring 2012: Methodologies 42

slide-43
SLIDE 43

References

Beck, K. (1999). Extreme Programming Explained. Reading, MA: Addison-Wesley. Boehm, B. (2002). Get ready for agile methods, with care. IEEE Com- puter, pp. 64–69. Jacobson, I., Booch, G., & Rumbaugh, J. (1998). The Unified Software Development Process. Reading, MA: Addison-Wesley. Royce, W. W. (1970). Managing the development of large software sys-

  • tems. In Proceedings of IEEE WESCON (pp. 1–9).

SAPM Spring 2012: Methodologies 42