35
Lessons in Software Evolution Learned by Listening to Smalltalk Oscar Nierstrasz scg.unibe.ch

Lessons in Software Evolution Learned by Listening to Smalltalk

Embed Size (px)

DESCRIPTION

Invited talk at SOFSEM 2010. Full paper (PDF) is available for download. http://bit.ly/8awi30

Citation preview

Page 1: Lessons in Software Evolution Learned by Listening to Smalltalk

Lessons in Software EvolutionLearned by Listening to Smalltalk

Oscar Nierstraszscg.unibe.ch

Page 2: Lessons in Software Evolution Learned by Listening to Smalltalk

Research Team

Adrian LienhardAdrian Kuhn

Fabrizio PerinLukas RenggliJorge Ressia

David RoethlisbergerNiko Schwarz

Toon VerwaestErwann Wernli

Page 3: Lessons in Software Evolution Learned by Listening to Smalltalk

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

Roadmap

Page 4: Lessons in Software Evolution Learned by Listening to Smalltalk

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

Roadmap

The trouble with changeThe trouble with change

Page 5: Lessons in Software Evolution Learned by Listening to Smalltalk

How we enable change

Package what is stable

Define an interface for configuration

Page 6: Lessons in Software Evolution Learned by Listening to Smalltalk

A brief history of software packaging

Page 7: Lessons in Software Evolution Learned by Listening to Smalltalk

The Trouble with Software Change

Understanding the system

Understanding the system

Bridging the gapBridging the gap

Specifying changeSpecifying change

Managing changeManaging change

Understanding change

Understanding change

Page 8: Lessons in Software Evolution Learned by Listening to Smalltalk

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

Roadmap

Smalltalk in a NutshellSmalltalk in a Nutshell

Page 9: Lessons in Software Evolution Learned by Listening to Smalltalk

To thine own self be true

Less is MoreLess is More The object model “is as simple as possible, but no simpler”

The object model “is as simple as possible, but no simpler”

Reify EverythingReify Everything

You can change a Running SystemYou can change a Running System

“Everything is an object” is applied consistently

“Everything is an object” is applied consistently

Smalltalk models itself, so changing the model changes the system

Smalltalk models itself, so changing the model changes the system

Page 10: Lessons in Software Evolution Learned by Listening to Smalltalk

The origins of Smalltalk

Alan Kay’s Dynabook project (1968)

Alan Kay’s Dynabook project (1968)

Alto — Xerox PARC (1973)

Alto — Xerox PARC (1973)

Page 11: Lessons in Software Evolution Learned by Listening to Smalltalk

Smalltalk architecture

ImageImage

ChangesChanges

Virtual machineVirtual machine

SourcesSources

Page 12: Lessons in Software Evolution Learned by Listening to Smalltalk

Everything happens by sending messages

2 raisedTo: 1 + 3 factorial2 raisedTo: 1 + 3 factorial 128128

First unary, then binary, then keyword:First unary, then binary, then keyword:

factorial+raisedTo:

Page 13: Lessons in Software Evolution Learned by Listening to Smalltalk

<= aPoint "Answer whether the receiver is neitherbelow nor to the right of aPoint."

^ x <= aPoint x and: [y <= aPoint y]

<= aPoint "Answer whether the receiver is neitherbelow nor to the right of aPoint."

^ x <= aPoint x and: [y <= aPoint y]

A typical method

(2@3) <= (5@6)(2@3) <= (5@6) truetrue

Keyword messageKeyword message

Instance variableInstance variable

BlockBlock

Binary messageBinary message

Unary messageUnary message

Method nameMethod name ArgumentArgument CommentComment

ReturnReturn

Page 14: Lessons in Software Evolution Learned by Listening to Smalltalk

Everything is an object

Page 15: Lessons in Software Evolution Learned by Listening to Smalltalk

Everything is an object

Page 16: Lessons in Software Evolution Learned by Listening to Smalltalk

You can change a running system

AKA: “The Debugger is your Friend” AKA: “The Debugger is your Friend”

Page 17: Lessons in Software Evolution Learned by Listening to Smalltalk

Pharo — an multi-platform, open-source Smalltalk

Pharo by Example. Andrew Black, et al. Square Bracket Associates, 2009.

Pharo by Example. Andrew Black, et al. Square Bracket Associates, 2009.

Page 18: Lessons in Software Evolution Learned by Listening to Smalltalk

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

Roadmap

Taming Software ChangeTaming Software Change

Page 19: Lessons in Software Evolution Learned by Listening to Smalltalk

Moose: a platform for reverse engineering

Page 20: Lessons in Software Evolution Learned by Listening to Smalltalk

Smalltalk

NavigationMetrics

QueryingGrouping

Smalltalk

Java

C++

COBOL

CDIF

XMI

ExternalParser

CodeCrawler

ConAn Van ...Hapax

Extensible meta model

Model repository

Explicit metamodels enable change

The Story of Moose: an Agile Reengineering Environment. Oscar Nierstrasz, Stéphane Ducasse, and Tudor Gîrba. ESEC/FSE 2005

The Story of Moose: an Agile Reengineering Environment. Oscar Nierstrasz, Stéphane Ducasse, and Tudor Gîrba. ESEC/FSE 2005

Page 21: Lessons in Software Evolution Learned by Listening to Smalltalk

Moose visualizations

Page 22: Lessons in Software Evolution Learned by Listening to Smalltalk

Programming visualizations with CodeCrawler

Page 23: Lessons in Software Evolution Learned by Listening to Smalltalk

Scripting visualizations with Mondrian

Mondrian: An Agile Visualization Framework. Michael Meyer, Tudor Gîrba, and Mircea Lungu. SoftVis 2006

Mondrian: An Agile Visualization Framework. Michael Meyer, Tudor Gîrba, and Mircea Lungu. SoftVis 2006

Page 24: Lessons in Software Evolution Learned by Listening to Smalltalk

Moose — a platform for collaborative research

Page 25: Lessons in Software Evolution Learned by Listening to Smalltalk

Feature inheritance ≠ specialization

Page 26: Lessons in Software Evolution Learned by Listening to Smalltalk

First-class traits enable fine-grained reuse

Page 27: Lessons in Software Evolution Learned by Listening to Smalltalk

Class = superclass + state + traits + glue

Traits provide and require methods

Traits provide and require methods

The composing class retains control

The composing class retains control

Traits: A Mechanism for fine-grained Reuse. Stéphane Ducasse, Oscar Nierstrasz, Nathanael Schärli, Roel Wuyts and Andrew Black. ACM TOPLAS, March 2006

Traits: A Mechanism for fine-grained Reuse. Stéphane Ducasse, Oscar Nierstrasz, Nathanael Schärli, Roel Wuyts and Andrew Black. ACM TOPLAS, March 2006

Page 28: Lessons in Software Evolution Learned by Listening to Smalltalk

Traits and Classes share common behaviour

Page 29: Lessons in Software Evolution Learned by Listening to Smalltalk

First-class aliases enable object flow analysis

Practical Object-Oriented Back-in-Time Debugging. Adrian Lienhard, Tudor Gîrba, and Oscar Nierstrasz. ECOOP 2008.

Practical Object-Oriented Back-in-Time Debugging. Adrian Lienhard, Tudor Gîrba, and Oscar Nierstrasz. ECOOP 2008.

Page 30: Lessons in Software Evolution Learned by Listening to Smalltalk

A back-in-time VM with object flow analysis

Page 31: Lessons in Software Evolution Learned by Listening to Smalltalk

GC remembers only what is needed

Page 32: Lessons in Software Evolution Learned by Listening to Smalltalk

How to manage change in a running system?

Encapsulating and Exploiting Change with Changeboxes. Marcus Denker, et al. ICDL 2007.

Encapsulating and Exploiting Change with Changeboxes. Marcus Denker, et al. ICDL 2007.

Page 33: Lessons in Software Evolution Learned by Listening to Smalltalk

First-class changes enable scoped evolution

Page 34: Lessons in Software Evolution Learned by Listening to Smalltalk

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

The trouble with changeSmalltalk in a NutshellTaming Software ChangeEpilogue — Bringing Models Closer to Code

Roadmap

Epilogue — Bringing Models Closer to CodeEpilogue — Bringing Models Closer to Code

Page 35: Lessons in Software Evolution Learned by Listening to Smalltalk

Systems that support change need to be model-centric and context-aware

Model-centric systems are self-describing and can be adapted

dynamically

Model-centric systems are self-describing and can be adapted

dynamically

Context-aware systems control the scope of change to static or

dynamic contexts

Context-aware systems control the scope of change to static or

dynamic contexts