Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Tracking Objects To Detect Feature Dependencies
1. Tracking Objects to Detect
Feature Dependencies
Adrian Lienhard, Orla Greevy and Oscar Nierstrasz
Software Composition Group
University of Bern, Switzerland
2. Context
“A feature is an observable unit of behavior of a system
triggered by the user” [Eisenbarth’03]
Example: IRC client
Open, Setup, Connect, Join Channel,
Send Message, Receive Message, Disconnect
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
3. No feature is an island
We consider a runtime dependency to exist
between features if state-changes in one feature
impact the behavior of another feature.
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
4. Why object aliasing
causes dependencies
Open Join Channel Receive Message
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
8. Open Join Channel Receive Message
window window
connection connection
Snapshot
view
channel
Snapshot 1 Snapshot 2
Identify the creation of all references of an object
and how they are transferred
Open Join Channel Receive Message
Object
flow view
of connection
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
9. Open Join Channel Receive Message
window window
connection connection
Snapshot
view
channel
Snapshot 1 Snapshot 2
Identify the creation of all references of an object
and how they are transferred
Open Join Channel Receive Message
Object
flow view <new> model
of connection
reference returned
store into field (of
from instantiating
window instance)
the connection
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
10. Open Join Channel Receive Message
window window
connection connection
Snapshot
view
channel
Snapshot 1 Snapshot 2
Identify the creation of all references of an object
and how they are transferred
Open Join Channel Receive Message
Object
flow view <new> model model connection
of connection
store into field (of
read from field
channel instance)
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
11. Open Join Channel Receive Message
window window
connection connection
Snapshot
view
channel
Snapshot 1 Snapshot 2
Identify the creation of all references of an object
and how they are transferred
Open Join Channel Receive Message
Object
flow view <new> model model connection connection conn
of connection
stored into local
read from field variable -- then
used as target of
message send
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
12. Detecting dependencies
‣ Identify the reference through which a message is sent
to its target
‣ From this reference, follow the object flow backwards
‣ If a previous reference originates in different feature,
we found a dependency
Open Join Channel Receive Message
<new> model model connection connection conn
➾ the connection instance causes two
dependencies for the Receive Message feature
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
13. Exploring dependencies
Object dependency graph of Receive Message
‣ nodes: objects
depended on
‣ edges: references
subject to a
dependency
Open Join Channel
Connect Send Message
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
14. Exploring dependencies
Object dependency graph of Receive Message
‣ nodes: objects
depended on
‣ edges: references
subject to a
dependency
Open Join Channel
Connect Send Message
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
15. Exploring dependencies
Object dependency graph of Receive Message
‣ nodes: objects
depended on
‣ edges: references
subject to a
dependency
Open Join Channel
Connect Send Message
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
16. Exploring dependencies
Object dependency graph of Receive Message
‣ nodes: objects
depended on
‣ edges: references
subject to a
dependency
Open Join Channel
Connect Send Message
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
17. IRC client dependencies
Open
Setup
Connect
MOTD
Join Channel
Send Message
Receive Message
New Console
Disconnect
0 5 10 15 20 25 30 35
Our approach Salah et al.
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
18. Pier CMS dependencies
Initialization
Start
Login
Add Page
Copy Page
Edit Page
Change Group
Change Other
Change Owner
Remove Page
Logout
0 100 200 300 400
Our approach Salah et al.
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch
19. Conclusions
‣ Analyzing where objects are created does not
reveal dependencies caused by object aliasing
‣ By tracking the flow of objects we can
accurately detect feature runtime dependencies
ICPC’07 : : Tracking Objects to Detect Feature Dependencies : : Adrian Lienhard : : lienhard@iam.unibe.ch