Incremental Change of Software Taxonomy of Evolution Changes - - PowerPoint PPT Presentation

incremental change of software taxonomy of evolution
SMART_READER_LITE
LIVE PREVIEW

Incremental Change of Software Taxonomy of Evolution Changes - - PowerPoint PPT Presentation

Incremental Change of Software Taxonomy of Evolution Changes Incremental change (IC) adds substantial new functionality Refactoring (restructuring) preserves the functionality Replacement substitute one functionality


slide-1
SLIDE 1

Incremental Change of Software

slide-2
SLIDE 2

Taxonomy of Evolution Changes

  • Incremental change (IC)

– adds substantial new functionality

  • Refactoring (restructuring)

– preserves the functionality

  • Replacement

– substitute one functionality by another – example: replacing buggy code

  • Retracting

– deletes a functionality

slide-3
SLIDE 3

Strategies for IC

  • Anticipated change

– information hiding, parametrization – localize change within one class

  • Many changes cannot be anticipated

– process of learning during development

  • Microsoft: 70% of requirements predicted
  • Ford project: 30% predicted

– examples of unexpected changes

  • company mergers, introduction of Euro
slide-4
SLIDE 4

Unanticipated IC

  • The Software was not prepared/designed for it
  • Very common situation in practice
  • A substantial part of software engineering
slide-5
SLIDE 5

The Mini-process of IC

  • Initiation
  • IC design
  • IC implementation & Tests
  • Release
slide-6
SLIDE 6

IC Initiation

  • Problem Report

– May require logs, traces

  • Preventive Maintenance

– enhance reliability, comprehensibility, extensibility, etc.

  • New Feature Request

– additional functionality of the product – usually initiated by the customers, marketing, management

  • All change requests

– assigned a priority and placed on the queue – hot problems cause instant reprioritization

slide-7
SLIDE 7

IC Design

  • Concept Location

– Find where in the code the change will be done

  • Study Code and Documentation
  • Identify/Weigh Alternative Solutions
  • Implementation strategy

– Divide large changes into several smaller ones – Each has its own implementation and testing activity

  • Impact analysis

– Find all components that will be affected by the change

slide-8
SLIDE 8

IC Implementation

  • Refactoring 1 (pre-factoring)

– Restructure the software to localize change

  • Actualization

– Implements the new code

  • Incorporation

– Replaces the new code by the old

  • Change propagation

– Changes all other components that must be changed

  • Refactoring 2 (post-factoring)

– Improves clarity, readability

slide-9
SLIDE 9

Testing

  • Unit tests of the components

– Guarantee that units (classes) work

  • Regression test

– Guarantee that things that did not change still work

  • Integration test

– Guarantee that the whole system works again

  • Tests are done both during and after

implementation

slide-10
SLIDE 10

IC Release

  • Release build
  • Write Release Notes
  • Make release available to customer
slide-11
SLIDE 11

Concept location

  • plays key role in IC
  • concepts are present in the code
  • primitive concepts have to be enriched

– Point-of-Sale: introduce credit card payment – old code: payment represented as just one number

  • latent concepts have to be implemented

– Student Registration: introduce prerequisite check – old code assumption: prerequisites are satisfied

slide-12
SLIDE 12

Concept location

  • finds code that implements concept
  • part of program comprehension
  • concept location methodologies

– human knowledge – "grep" (pattern matching) – dynamic search (execution traces) – static search through dependency graph – traceability tools

slide-13
SLIDE 13

Top-down search

  • Depth first search done by programmer:

Start with the top class (main in C++) while (concept is not implemented here)

if (the concept is a part of the composite functionality) move to subclass which leads to the concept else backtrack

concept located

slide-14
SLIDE 14

Change propagation

  • Refactoring 1 (pre-factoring)

– Restructure the software to localize change

  • Actualization

– Implements the new code

  • Incorporation

– Replaces the new code by the old

  • Change propagation

– Changes all other components that must be changed

  • Refactoring 2 (post-factoring)

– Improves clarity, readability

slide-15
SLIDE 15

Change propagation

– if the visited class is modified, it may no longer fit

  • secondary changes must be made in interacting

(“neighboring”) classes

  • secondary changes may trigger additional changes

– “ripple effect”

– Process

  • Mark neighboring classes of a class that changed
  • visit the marked classes one-by-one
slide-16
SLIDE 16

Three possibilities for marked class visit

  • Change class

– Mark all neighbors

  • Do not change class but propagate

– Mark all neighbors

  • Do not change class and do not propagate

– Erase the mark

slide-17
SLIDE 17

Three options (class diagram)

Change class mark Do not change class but propagate

slide-18
SLIDE 18

Three options (class diagram)

Do not change class and do not propagate

slide-19
SLIDE 19

Example change propagation

  • Point-Of-Sale application
  • Old program
  • keeps an inventory, receives delivery, sells

products, and supports a cash register.

  • Classes designed and implemented at a minimal

level of functionality

slide-20
SLIDE 20

UML class diagram

slide-21
SLIDE 21

Incremental change

  • complexities of sale taxes
  • different products may have different sales tax,

depending on state law

  • location

– “tax” in class “item”

  • actualization

– new class taxCategory

slide-22
SLIDE 22

Incorporation

sale register saleLineItem store item taxCategory

slide-23
SLIDE 23

Change propagation

sale register saleLineItem store item taxCategory

slide-24
SLIDE 24

Change propagation

sale register saleLineItem store item taxCategory

slide-25
SLIDE 25

Change propagation

sale register saleLineItem store item taxCategory

slide-26
SLIDE 26

Change propagation

sale register saleLineItem store item taxCategory

slide-27
SLIDE 27

Change propagation

sale register saleLineItem store item taxCategory

slide-28
SLIDE 28

Summary adding tax

  • 1 new class was implemented
  • All 5 old classes had to be visited (!)
  • 3 old classes had to be changed
slide-29
SLIDE 29

Example Drawlets

  • Application framework Drawlets

– adds graphical display to a host application

  • Drawing canvas

– lines, free-hand lines, rectangles, rounded rectangles, triangles, pentagons, polygons, ellipses, text boxes, images

slide-30
SLIDE 30

Drawlets

  • more than 100 classes, 35 interfaces and 40,000

lines of code – originally implemented by Kent Beck, Ward Cunningham

  • later ported into Java
  • “perfect API”

– http://www.rolemodelsoft.com/aboutUs/ drawlets.htm

slide-31
SLIDE 31

The host application

  • responsible for providing an instance of the

drawing canvas, toolbars, and tool buttons

  • Class SimpleApplet is a host application

– is a part of the Drawlet library – SimpleApplet runs in any browser

slide-32
SLIDE 32

SimpleApplet window

slide-33
SLIDE 33

Top classes

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-34
SLIDE 34

Concept Location :: Example

  • Locating figure properties in Drawlets
slide-35
SLIDE 35

Example Drawlets: Top class

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-36
SLIDE 36

Wrong way

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-37
SLIDE 37

Backtrack

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-38
SLIDE 38

Right way

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-39
SLIDE 39

Wrong way

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-40
SLIDE 40

Backtrack

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-41
SLIDE 41

Concept Location :: Summary

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-42
SLIDE 42

Change Request

  • implement an "owner" for each figure

– owner put that figure onto the canvas – only owner is allowed to move that figure – each session declares a session owner

  • this session owner will own all new figures created
  • no other owner will be allowed to manipulate them
  • This change will make SimpleApplet more

versatile and useful

– support for cooperative work

slide-43
SLIDE 43

Extraction

  • The concepts relevant to the change

– figure owner and session owner – both are implicit

  • old code assumes that there is just one owner who
  • wns both sessions and figures
slide-44
SLIDE 44

Location

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette LabelTool Figure

slide-45
SLIDE 45

Actualization

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-46
SLIDE 46

Incorporation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-47
SLIDE 47

Propagation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-48
SLIDE 48

Propagation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-49
SLIDE 49

Propagation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-50
SLIDE 50

Propagation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-51
SLIDE 51

Propagation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-52
SLIDE 52

Propagation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-53
SLIDE 53

Propagation

SequenceOfFigures ShapeTool EllipseTool RectangleTool RectangularCreationTool PG_RectImageTool Locator CanvasTool AbstractFigure SimpleDrawingCanvas DrawingCanvas ToolPalette SimpleApplet ToolBar LocatorConnectionHandle PrototypeConstructionTool SelectionTool ConstructionTool StylePalette OwnerIdentity SimpleListener LabelTool Figure

slide-54
SLIDE 54

Shorter change propagation

  • Long change propagation is a problem

– it would be advantageous to shorten it

  • opportunistic refactoring

– moves code affected by change into fewer classes

  • splitting the roles
slide-55
SLIDE 55

More info on the case study

  • Václav Rajlich, Prashant Gosavi: Incremental

Change in Object-Oriented Programming. IEEE Software 21(4): 62-69 (2004)