20 - Agile Methods & AOSD - UMass Amherst System Development Methodology (DSDM), Extreme Programming...

34
Lecture 20 - Agile & AOSD; Intro to Process November 21, 05 © Rick Adrion 2005 (except as noted) 1 UNIVERSITY NIVERSITY OF OF M MASSACHUSETTS ASSACHUSETTS AM HERST M HERST D DEPARTMENT EPARTMENT OF OF COMPUTER OMPUTER SCIENCE CIENCE CMP MP SCI CI 520/620 520/620 FA LL A LL 2005 2005 20 - Agile Methods & AOSD General Pekka Abrahamsson, Outi Salo, Jussi Ronkainen, and Juhari Warsta, "Agile software development methods: review and analysis," www.inf.vtt.fi/pdf/publications/2002/P478.pdf Barry Boehm, "Get Ready for Agile Methods, with Care," IEEE Computer, 2002. 35(1): p. 64-69 http://fc- md.umd.edu/projects/Agile/Boehm.pdf XP Extreme Programming Explained, Kent Beck Addison Wesley 1999 Refactoring: Improving the Design of Existing Code, Martin Fowler, Addison Wesley 1999 http://www. extremeprogramming .org http://www.xp2001.org AOP Aspect-Oriented Programming with AspectJ™ Erik Hilsdale, Gregor Kiczales (with Bill Griswold, Jim Hugunin, Wes Isberg, Mik Kersten), UNIVERSITY NIVERSITY OF OF M MASSACHUSETTS ASSACHUSETTS AM HERST M HERST D DEPARTMENT EPARTMENT OF OF COMPUTER OMPUTER SCIENCE CIENCE CMP MP SCI CI 520/620 520/620 FA LL A LL 2005 2005 Agile Methods Agile methods Adaptive Software Development (ASD), Agile Modeling, Crystal Methods, Dynamic System Development Methodology (DSDM), Extreme Programming (XP), Feature Driven Development, Lean Development, and Scrum Plan-Driven Methods include: documented process procedures that involve tasks and milestone plans product development strategies that involve requirements, designs, and architectural plans. Risk-driven spiral methods and frameworks Rational UnifiedProcess (RUP), Model-Based Architecting and Software Engineering (MBASE), and the CMMI

Transcript of 20 - Agile Methods & AOSD - UMass Amherst System Development Methodology (DSDM), Extreme Programming...

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 1

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

20 - Agile Methods & AOSDGeneral

Pekka Abrahamsson, Outi Salo, Jussi Ronkainen, and JuhariWarsta, "Agile software development methods: review and analysis,"www.inf.vtt.fi/pdf/publications/2002/P478.pdf

Barry Boehm, "Get Ready for Agile Methods, with Care," IEEEComputer, 2002. 35(1): p. 64-69 http://fc-md.umd.edu/projects/Agile/Boehm.pdf

XPExtreme Programming Explained, Kent Beck Addison Wesley 1999Refactoring: Improving the Design of Existing Code, Martin Fowler,Addison Wesley 1999

http://www.extremeprogramming.orghttp://www.xp2001.org

AOPAspect-Oriented Programming with AspectJ™ Erik Hilsdale, GregorKiczales (with Bill Griswold, Jim Hugunin, Wes Isberg, Mik Kersten),

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Agile Methods Agile methods

Adaptive Software Development (ASD), Agile Modeling, Crystal Methods,Dynamic System Development Methodology (DSDM), Extreme Programming(XP), Feature Driven Development, Lean Development, and Scrum

Plan-Driven Methods include: documented process procedures that involve tasks and milestone plans product development strategies that involve requirements, designs, and

architectural plans. Risk-driven spiral methods and frameworks

Rational UnifiedProcess (RUP), Model-Based Architecting and SoftwareEngineering (MBASE), and the CMMI

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 2

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Agile Methodsemphasize these values:

individuals and interactions over processes and toolsworking software over comprehensive documentationcustomer collaboration over contract negotiationresponding to change over following a plan

a method is agile when when software development isincremental (small releases with rapid cycles)cooperative (customers and developers work togetherand communicate closely)straightforward (easy to learn and modify)adaptive (changes can be made at last minute)

Highsmith and Cockburn 2001

Abrahamsson, et al 2002

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

XP Process (Abrahamsson, et al)

6 Phases: Exploration, Planning, Iteration, Productionizing,Maintenance, Death

XP Practices: Refactoring, Pair Programming, CollectiveCode Ownership, Continuous Integration, 40-Hour WorkWeek, On-Site Customer

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 3

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Scrum empirical approach, appplying ideas of industrial process control

theory does not specify development techniques, but concentrates on

team members includes three phases: pre-game, development and post-game

30-day “Sprint”

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Crystal family of methodologies, select & tailor to fit

to project “color coded” to represent the “heaviness” of

the methodologyCrystal Clear - small projects (D6)Crystal Orange - medium-size projects (D40)

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 4

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Is Open Source (OSS) Agile?OSS development differs from agile devlopment inphilosophical, economic and team structure aspects(Cockburn 2002)

however, there are some similarityearly and frequent releasesa lack of plan-based development features such asplans, system-level designs, schedules, definedprocesses

Phases (Sharma 2002): problem discovery; findingvolunteers; identifying solutions; code development andtesting; code change review; code commit; releasemanagement

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

The changing OSS environmentlarge companies (e.g., IBM) showing interest in OSSand beginning to serve as mediators (= managers?)

new service industries (e.g., Red Hat) providing supportrepositories (e.g., SourceForge) provide hosting,version control, bug tracking, project management,backups, archives

volunteer hirearchiesproject leaders, developers (senior/core, peripheral,occasional contributors), community input (users,posters)

market forcesdevelopers have to find interest and attract volunteers ina very harsh and competitive OSS environment

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 5

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Is RUP Agile?Contains extensive guidelines for process phases that may

be irrelevant in an agile approachThere are those that argue RUP can be made to be agile.As to the Agile principles, here are a few:

Active Stakeholder ParticipationRUP includes project stakeholders, such as users and customers,

but to be agile project stakeholders need to take on modelingroles

Collective OwnershipRUP supports collective ownership with its strong focus on

configuration management issues, although its changemanagement processes may potentially get in your way

Prove it With CodeAt the end of every iteration, except perhaps for the ones during

the Inception phase, RUP specifically states that you should havea working prototype.

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Rational Method Composerout-of-the-box processes or delivery processes

RUP for small projects, medium-sized projects, andlarge projects (Classic RUP)RUP for COTS (Commercial Off-The-Shelf) orpackaged application developmentRUP for systems engineeringRUP for service-oriented architecture (SOA)RUP for maintenanceRUP for J2EERUP for XP

Will RMC make RUP agile?

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 6

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Agile vs. Plan-Based Methodsplan-based methods not used in practice?

too mechanistictoo hard to learnpotential adopters are skeptical

agile methodsbegan with agile manifestolack of empirical evidencenot applicable to large and/or critical projects?

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Sawyer & Guinan 1998

Microsoft’s S&S ProcessS&S = “Synchronize and Stabilize”Strategy

Parallel development -- team structure parallels codestructureContinually testMetric data for milestone completionCommon developer languageDivide large projects into multiple milestone cyclesUse a vision statement and outline specification offeatures to guide projects

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 7

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Microsoft S&S Process

Vision StatementSpecification DocumentSchedule and Feature Team Formation

1 prog. mgr, 3–8 developers, and3–8 testers (who work in parallel 1:1with developers).

Planning

Development

Stabilization

Feature development in 3 or 4sequential subprojects

Subproject I First 1/3 of features(Most critical features and sharedcomponents)Subproject II Second 1/3 of featuresSubproject III Final 1/3 of features(Least critical)

Internal TestingExternal Testing (OEMs, ISVs, & endusers)Release preparation

Cusumano & Selby 1997

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

S+S Issuesbenefits

breaks down large products into manageable pieceslarge teams to work like small teams, proceeding in parallelbut synchronizing continuouslyfacilitates competition on customer input, product features,and short development timesallows a product team to be very responsive to events in themarketplace by “always” having a product ready to ship

problemsdoesn’t work for teams that are not co-locatedonly works for feature-driven developmentno built-in maintenance or support

planned as future versions of productmust have customer base to drive development decisions

Cusumano & Selby 1997

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 8

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Mary Shaw 2001

Process Model Comparison

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Agile and Other MethodsAgile

Adaptive Software Development (ASD), Agile Modeling,Crystal Methods, Dynamic System DevelopmentMethodology (DSDM), Feature Driven Development, LeanDevelopmentSee Pekka Abrahamsson, Outi Salo, Jussi Ronkainen, andJuhari Warsta, "Agile software development methods: reviewand analysis," www.inf.vtt.fi/pdf/publications/2002/P478.pdf

Other “hot” technologyGenerative Programming, Meta Programming, ReflectiveProgramming, Compositional Filtering, AdaptiveProgramming, Subject Oriented Programming, IntentionalProgramming

Other ApproachesDesign by ContractAspect-Oriented Software Development

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 9

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Design by ContractOriginated by Bertram Meyer (Eiffel)

Incorporated in others methods (e.g., JML) and tools(e.g. Parasoft)

methodology for evolving code together with itsspecification.classes define their responsibility precisely.class invariants, method preconditions andpostconditions.compiler instruments code to monitor.

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Preconditions and postconditionsClass to client: “If you promise to call r with pre satisfied,

then I promise to deliver a final state in which post issatisfied …”

A method’s preconditionsays what must be true to call it, I.e., what must hold uponentry to methodbinds the client.

A method’s normal postconditionmethod guarantees it will hold upon exitwhat is true when it returns normally (i.e., without throwing anexception).

A method’s exceptional postconditionwhat is true when a method throws an exception.

//@ signals (IllegalArgumentException e) x < 0;Class Invariants

Global properties of a class.Must be preserved by all exported routines.

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 10

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

DBCThe role of a contract

may monitor at run time - debugging tool.eiffel - by the compiler.other languages - specific tools.

conceptual tool for correctness and robustness.design aid.aid to understandingdocumentation

advantagesclear responsibility for checking.run time violation shows a bug:

Precondition violation -- bug in client.Postcondition violation -- bug in supplier.

simplify codemethod need not check precondition. If precondition is not satisfied, do anything

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Contracts and inheritanceMethodological implications of contracts on inheritance:

Invariants and postconditions may only be strengthened;Preconditions may only be weakened.Eiffel enforces this principle..

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 11

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Aspect-oriented programmingAOP compliments O-O programming, but doesn’treplace it

the problemsome programming tasks cannot be neatlyencapsulated in objects, but must be scatteredthroughout the codeexamples:logging (tracking program behavior to a file)profiling (determining where a program spends its time)tracing (determining what methods are called when)session tracking, session expirationspecial security management

the result is crosscutting code--the necessary code“cuts across” many different classes and methods

The following AOP/AOSD slides adapted from Aspect-Oriented Programming with AspectJ™Erik Hilsdale, Gregor Kiczales (with Bill Griswold, Jim Hugunin, Wes Isberg, Mik Kersten),

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Some examplespublic class SomeBusinessClass extends OtherBusinessClass{  // Core data members

...Log stream ;

...cache update_status ;// Override methods in the base class

public voidperformSomeOperation(OperationInformation info)

{...ensure authorization...ensure info satisfies contract...lock the object – thread safety...ensure cache is up to date

         ...log the start of operation// ==== Perform the core operation ====...log the completion of operation...unlock the object

      }public void save(PersitanceStorage ps) {...}

   public void load(PersitanceStorage ps) {...}}

Logging?Multithreading? DBC? Authentication? Persistence/Caching

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 12

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Breaking modularityGot the picture ?Non-modularization due toclient-server nature ofOOP

Current popular solutionEJB, servlets, dynamicproxies

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

modularityintuitive definition

a concern is implemented1

in a modular way if thecode for the concern is: localized andhas a clear interfacewith the rest of the system

1 coded, designed, modeled …

xml parsing

url pattern matching

loggingcode from org.apache.tomcat

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 13

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

session expiration is not modularized…

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

problems like…

HTTPRequest

HTTPResponse

Servlet

getCookies()getRequestURI()(doc)getSession()getRequestedSessionId()...

getRequest()setContentType(contentType)getOutptutStream()setSessionId(id)...

SessionInterceptor

requestMap(request)beforeBody(req, resp)...

Session

getAttribute(name)setAttribute(name, val)invalidate()...

session tracking is not modularized

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 14

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

crosscutting concerns

HTTPRequest

SessionHTTPResponse

Servlet

getCookies()getRequestURI()(doc)getSession()getRequestedSessionId()...

getAttribute(name)setAttribute(name, val)invalidate()...

getRequest()setContentType(contentType)getOutptutStream()setSessionId(id)...

SessionInterceptor

requestMap(request)beforeBody(req, resp)...

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Non-modularizationSymptoms

Code tanglingCode scattering

Duplicated code blocksComplementary code blocks

ConsequencesRedundant code

Same fragment of code in many placesDifficult to reason about

Non-explicit structureThe big picture of the tangling isn’t clear

Difficult to changeHave to find all the code involved... ...and be sure to change it consistently ...and be sure not to break it by accident

Inefficient when crosscuting code is not needed

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 15

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

the AOP ideacrosscutting is inherent in complex systemscrosscutting concerns

have a clear purposehave a natural structuredefined set of methods, module boundary crossings, pointsof resource utilization, lines of dataflow…

so, let’s capture the structure of crosscutting concernsexplicitly...in a modular waywith linguistic and tool support

aspects arewell-modularized crosscutting concerns

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

If we just could…

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 16

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

How does AOP do it ?

AOP development stages

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

AspectJTM

AspectJ is a small, well-integrated extension to Java Based on the 1997 PhD thesis by Christina Lopes, A

Language Framework for Distributed Programming AspectJ modularizes crosscutting concerns

That is, code for one aspect of the program (such astracing) is collected together in one place

The AspectJ compiler is free and open source AspectJ works with JBuilder, Forté, Eclipse, probably

others

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 17

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

What is a Concern ?concern is a particular goal, concept, or area of interestconcerns are the primary motivation for organizing anddecomposing software into manageable andcomprehensible parts

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

TerminologyA join point is a well-defined point in the program flowA pointcut is a group of join pointsAdvice is code that is executed at a pointcutIntroduction modifies the members of a class and therelationships between classes

An aspect is a module for handling crosscuttingconcernsAspects are defined in terms of pointcuts, advice, andintroductionAspects are reusable and inheritable

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 18

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

a simple figure editor

operations thatmove elements

factory methodsDisplay

*

2Point

getX()getY()setX(int)setY(int)moveBy(int, int)

Line

getP1()getP2()setP1(Point)setP2(Point)moveBy(int, int)

Figure

makePoint(..)makeLine(..)

FigureElement

moveBy(int, int)

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

a Line

a Point

join points

returning orthrowing

dispatch

dispatch

key points in dynamic call graph

a method callreturning or throwinga method execution

returning or throwinga method execution

imagine l.moveBy(2, 2)

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 19

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Join points A join point is a well-defined point in the program flow

We want to execute some code (“advice”) each timea join point is reached

We do not want to clutter up the code with explicitindicators saying “This is a join point”

AspectJ provides a syntax for indicating these joinpoints “from outside” the actual code

A join point is a point in the program flow “wheresomething happens” Examples:

When a method is called When an exception is thrown When a variable is accessed

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

join point terminology

several kinds of join points method & constructor call method & constructor execution field get & set exception handler execution static & dynamic initialization

a Line

dispatch

method calljoin points

methodexecutionjoin points

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 20

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

join point terminology

a Point

a Line

all join points on this slide arewithin the control flow of

this join point

a Point

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

nameno parameters

PointcutsPointcut definitions consist of a left-hand side and aright-hand side, separated by a colonThe left-hand side consists of the pointcut name and thepointcut parameters (i.e. the data available when theevents happen)The right-hand side consists of the pointcut itself

Example pointcut: pointcut setter(): call(void setX(int));

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 21

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Example pointcut designatorsWhen a particular method body executes:

execution(void Point.setX(int))When a method is called:

call(void Point.setX(int))When an exception handler executes:

handler(ArrayOutOfBoundsException)When the object currently executing (i.e. this) is of type

SomeType:this(SomeType)

When the target object is of type SomeTypetarget(SomeType)

When the executing code belongs to class MyClasswithin(MyClass)

When the join point is in the control flow of a call to a Test'sno-argument main methodcflow(call(void Test.main()))

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Pointcut designator wildcardsIt is possible to use wildcards to declare pointcuts:

execution(* *(..))Chooses the execution of any method regardless of returnor parameter types

call(* set(..))Chooses the call to any method named set regardless ofreturn or parameter type

In case of overloading there may be more than one suchset method; this pointcut picks out calls to all of them

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 22

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

whenever a Line receives a “void setP1(Point)” or “void setP2(Point)” method call

or

a “void Line.setP2(Point)” call

a “void Line.setP1(Point)” call

call(void Line.setP1(Point)) || call(void Line.setP2(Point));

pointcut compositiona pointcut is a kind of predicate on join points that:

can match or not match any given join point andoptionally, can pull out some of the values at that joinpoint

pointcuts compose like predicates, using &&, || and !

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Display

Figure FigureElement*

Point LinegetX()

getY()getP1

setP1

DisplayTrackingsetX(int)

setY(int)

setP1(Point)

setP2(Point)

2

Crosscutting Concern - ExampleNotify ScreenManager if a figure element moves

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 23

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Figure Editor

class Point {

private int x = 0, y = 0;

int getX() { return x; } int getY() { return y; }

void setX(int x) { this.x = x; Display.update(); } void setY(int y) { this.y = y; Display.update(); }}

class Line { private Point p1, p2;

Point getP1() { return p1; } Point getP2() { return p2; }

void setP1(Point p1) { this.p1 = p1; Display.update(); } void setP2(Point p2) { this.p2 = p2; Display.update(); }}

no locus of “display updating”evolution is cumbersomechanges in all classeshave to track & change allcallers

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

class Point { void setX(int x) { DisplayTracker.updatePoint(this); this.x = x;

}}

class DisplayTracker { static void updatePoint(Point p) {

this.display(p);....

} static void updateLine(Line l) {

this.display(l);....

}

Display

Figure FigureElement*

Point LinegetX()

getY()getP1

setP1

setX(int)

setY(int)

setP1(Point)

setP2(Point)

2

DisplayTracker

class Line { void setP1(Point p1 {

DisplayTracker.updateLine(this); this.p1 = p1;

}}

Example: Display Tracking

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 24

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

after advice

action to take aftercomputation under join points

a Line

aspect DisplayUpdating {

pointcut move(FigureElement fe): target(fe) && (call(void FigureElement.moveBy(int, int)) || call(void Line.setP1(Point)) || call(void Line.setP2(Point)) || call(void Point.setX(int)) || call(void Point.setY(int)));

after(FigureElement fe) returning: move(fe) { Display.update(fe); }}

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

clear display updatingmoduleall changes in single aspectevolution is modular

Figure Editor with AspectJaspect DisplayUpdating { pointcut move(): call(void FigureElement.moveBy(int, int) || call(void Line.setP1(Point)) || call(void Line.setP2(Point)) || call(void Point.setX(int)) || call(void Point.setY(int));

after() returning: move() { Display.update(); }}

class Line { private Point p1, p2;

Point getP1() { return p1; } Point getP2() { return p2; }

void setP1(Point p1) { this.p1 = p1; } void setP2(Point p2) { this.p2 = p2; }}

class Point {

private int x = 0, y = 0;

int getX() { return x; } int getY() { return y; }

void setX(int x) { this.x = x; } void setY(int y) { this.y = y; }}

class Point {

private int x = 0, y = 0;

int getX() { return x; } int getY() { return y; }

void setX(int x) { this.x = x; Display.update(); } void setY(int y) { this.y = y; Display.update(); }}

class Line { private Point p1, p2;

Point getP1() { return p1; } Point getP2() { return p2; }

void setP1(Point p1) { this.p1 = p1; Display.update(); } void setP2(Point p2) { this.p2 = p2; Display.update(); }}

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 25

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

AspectJ adviceBefore

advice runs as a join point is reached, before the programproceeds with the join point

Afteradvice on a particular join point runs after the programproceeds with that join pointreturning

advice is executed after a method returns normallythrowing

advice is executed after a method returns by throwing anexception

anyadvice is executed after a method returns, regardless of whether it

returns normally or by throwing an exceptionAround

advice on a join point runs as the join point is reached, andhas explicit control over whether the program proceeds withthe join point

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Concluding remarksAspect-oriented programming (AOP) is a new paradigm--a

new way to think about programmingAOP is somewhat similar to event handling, where the

“events” are defined outside the code itselfAspectJ is not itself a complete programming language, but

an adjunct to JavaAspectJ does not add new capabilities to what Java can do,

but adds new ways of modularizing the codeAspectJ is free, open source softwareLike all new technologies, AOP may--or may not--catch on in

a big way

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 26

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Myths and realities of AOPThe program flow in an AOP-based system is hard tofollow

AOP doesn’t solve any new problemsAOP promotes sloppy designAOP is nice, but a nice abstract OOP interface is allyou need

AOP compiler simply patches the core implementationAOP breaks the encapsulationAOP will replace OOP

TrueTrue

False

True, but ..

FalseFalse

False

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

means of … join points

add, compose (and remove)members

signatures w/ patterns, whole class ops

membersHyper/J

add memberssignaturesclass members static JPM

Demeter traversals

Composition Filters

AspectJ dynamic JPM

Join Point Model

when traversal reachesobject or edge

message sends &receptions

points in execution call, get, set…

join points

class & edge names

signature & propertybased object queries

signatures w/ patterns, static & dynamic props of JPs

identifying

define visit method

wrappers declarative (filters) imperative (~ advice)

advice declarative & imperative composition of code

specifying semantics at

some AOP languages

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 27

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Software ProcessesSoftware processes are:

the set of activities, methods, and practices that are used inthe production and evolution of software

devices for creating, modifying, analyzing, understandingsoftware artifacts and products

Hypothesis: Processes are software Improve quality by improving processes

Build in quality in, don’t “test in” quality (manufacturing)Use processes to manage complex activitiesMany observed “process errors”

Proposed approachUse computers to help perform processesAnalyze processes to determine and eliminate defectsUse demonstrably superior processes to identify risks,mitigate their consequences, demonstrate quality

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Software Process as SoftwareSoftware processes should be developed using a(Software development process) development processProcess RequirementsKey to designing suitable processBasis for evaluation and improvement of process

Process Specification/Modeling/DesignHelps conceptualization, communication, visualizationCan be management aid

Process CodeProvides rigor and complete detailsBasis for execution/tool support and integration

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 28

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Software Process CodeProvides details and elaborations upon process designTries to include details omitted from model/designSupports more detailed, precise, definitive reasoningVehicle for meshing process control with product dataat arbitrarily low levels of detail

Provides superior visibility enabling better controlBasis for better predictabilityBasis for process enaction/executionBlueprint for tool integration

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Software Process as SoftwareSoftware processes should be developed using a (Software

development process) development processProcess Measurements and EvaluationResults of Static Analysis and Dynamic Measurement ⇒Basis for Process Maintenance (i.e., Process Improvement)

OTHER INSTANCESOF THE PRODUCT

PRODUCT

OBJECT

MANUALS

PROCESSEXECUTIONDATA

QUALITYCONTROLDATA

PROCESSDOCUMENTATION Software

Practioner

APPL INSTANCE

USER

swproduct

templateSoftwareProcess

Developer

process____________________________code

Softwareprocessdesign

Softwareprocess

requirements Softwareexecutio

nhistories

&analyses

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 29

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Software Process FormalismsTechniques

Languages procedural rule-based object-oriented

Modeling formalisms Data flow diagrams Petri Nets Flow graphs

Key considerationsconcurrencyexception handlingresource specificationself-modification/long lifetimeconstraint managementartifact specification/managementreal-timevisualizability

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Language-based FormalismsMore traditional coding languages:

Procedural (Sutton's Appl/A)Rule-based (Kaiser's Marvel)Functional Hierarchy (Katayama’s HFSP)Law based (Minsky)Object Oriented (schema definition languages)

Key issue: developing abstractions to facilitate processdefinition

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 30

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

HFSP design model(a) JSD(Real_World | Design_Spec) =>(1)Develop_Spec(Real_World_Desc |System_Spec_Diagram)(2)Develop_Impl(System_Spec_Diagram |System_Impl_Diagram)(3)Where Real_World_Desc = Interview(Users, Developers,Real_World)(4) Design_Spec = union(System_Spec_Diagram, System_Impl_Diagram)Second_level(b) Develop_Spec(Real_World_Desc |System_Spec_Diagram) =>

(1)Develop_System_Model(Real_World_Desc |Real_World_Model,Init_System_Spec_Diagram)

(2)Develop_System_Func(Real_World_Model, Init_System_Spec_Diagram|System_Spec_Diagram)

Third_level(c) Develop_System_Model(Real_World_Desc|Real_World_Model, Init_System_Spec_Diagram) =>

(1)Model_Reality(Real_World_Desc |Real_World_Model)(2)Model_System(Real_World_Model |Init_System_Spec_Diagram)

(d) Develop_System_Func(Real_World_Model,Init_System_Spec_Diagram |System_Spec_Diagram)

(1)Define_Func(Real_World_Model, Init_System_Spec_Diagram |System_Function,Function_Process)

(2)Define_Timing(Init_System_Spec_Diagram, System_Function |Timing)(3)Where System_Spec_Diagram =is_composed_of(Init_System_Spec_Diagram, System_Function, Function_Process, Timing)

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

HFSP design model(a) JSD(Real_World | Design_Spec) =>(1)Develop_Spec(Real_World_Desc |System_Spec_Diagram)Second_level(b) Develop_Spec(Real_World_Desc |System_Spec_Diagram) =>

(1)Develop_System_Model(Real_World_Desc |Real_World_Model, Init_System_Spec_Diagram)Third_level(c) Develop_System_Model(Real_World_Desc|Real_World_Model, Init_System_Spec_Diagram) =>

(1)Model_Reality(Real_World_Desc |Real_World_Model)(2)Model_System(Real_World_Model |Init_System_Spec_Diagram)Fourth_level(e)Model_Reality(Real_World_Desc | Real_World_Model) =>

(1)Identify_Entity_Action(Real_World_Desc | Entity_Action_List)(2)Draw_Entity_Structure(Entity_Action_List | Entity_Structure_List)Where Real_World_Model = is(Entity_Structure_List) Real_World_Process = is(Entity_Structure)

(f) Model_System(Real_World_Model | Init_System_Spec_Diagram) =>(1)Identify_Model_Process(Real_World_Model | M_Proc_Name_List)(2)Connect(Real_World_Model, M_Proc_Name_List | Connection_List)(3)Specify_Model_Process(Connection_List, Real_World_Model, M_Proc_Name_List

|Model_Process_List)(4)Where Init_System_Spec_Diagram = is(Model_Process_List)(5)Connection = is(State_Vector) or is(Data_Stream)

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 31

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Software Process FormalismsTechniques

Languagesproceduralrule-basedobject-oriented

Modeling formalismsData flow diagramsPetri NetsFlow graphs

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

IDEF 0Integration definition forfunction modelingAdapted from SADTVery widespread usage inindustryOverburdened DFDOverly constrainedvisualization

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 32

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

IDEF 0 Course Scheduling

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Other “DFD”’sMany different adaptations of the basic ideaAdd control flow inAdd various annotations onAdd timing informationEtc.

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 33

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Petri Net-like representationsParticularly effective for showing concurrency inprocesses

Weak in dealing with artifactsWeak in dealing with exception flow

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Interview

Develop Spec

Develop Implementation

DevelopersReal World

Users

RW_Desc

Sys_Spec_Diag

Sys_Impl_Diag +Sys_Spec_Diag

Design_Spec

JSD

Petri net-like formalisms

Requirements specification process

Lecture 20 - Agile & AOSD; Intro to Process November 21, 05

© Rick Adrion 2005 (except as noted) 34

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Init_Sys_Spec_Diagram

Model_System

RW_Model

RW_Model

Identify_Model_Process

Model_Process_ Name_List

Connect

Connection_List +Model_Process_Name_List

Specify_Model_Process

Model_Process_List

RW_Model

Decomposition

Develop Spec

RW_Desc

Sys_Spec_Diag

UUNIVERSITYNIVERSITY OFOF M MASSACHUSETTS ASSACHUSETTS AAMHERSTMHERST •• D DEPARTMENTEPARTMENT OF OF CCOMPUTER OMPUTER SSCIENCE CIENCE •• CCMPMPSSCI CI 520/620520/620 FFALL ALL 20052005

Req_Spec

Req_Spec

Identify_Object

Objects States

Identify_Operations

Operations Objects States

Establish_Visibility

Operations

Objects States

VisibilityEstablish_Interface

Interface

Create_Implementation

Implementation InterfaceCreate_Design_Spec

Design_Spec

Design_Spec

BOOD

Design Process Petri net

Develop Implementation

Sys_Spec_Diag

Sys_Impl_Diag +Sys_Spec_Diag