Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Incremental Feature Location and Identification in Source Code
1.
2. Mo#va#on:
Exploring
Features
Analysts
known
part
of
f1
feature
f1
unknown
to
analysts
feature
f2
Problem
Domain
Technical
Domain
loca#on
of
f1
unexplored
modules
and
dependencies
Feature
Loca+on
(FL)
Feature
Iden+fica+on
(FI)
3. Key
Idea:
Dependency
Classifica#on
• Combining
sta#c
dependency
analysis
and
dynamic
FL
technique
m5
m2
m7
m9
m1
m3
m6
m4
m8
f2
f1
Call
graph
:
Uncovered
dependencies
(only
in
sta#c
dependencies;
have
not
executed
yet)
:
Covered
dependencies
(in
both
sta#c
and
dynamic
dependencies)
m5
m2
m7
m9
m1
m3
m8
m6
m4
(a)
(b)
(c)
4. Classifying
Dependencies
in
the
Adjacency
Matrix
m8
m9
m1
m2
m3
m5
m4
m6
m7
m8
m9
m1
m2
(c)
m3
(a)
m5
m4
(b)
m6
m7
f
fCase
(c):
intra-‐feature
dependency
• Missing
scenario
in
f
?
callee
Case
(b):
incoming
dependency
• Entry
point
of
f
?
f
f
f
f
Case
(a):
outgoing
dependency
• Relevant
to
f
?
• Calling
another
feature?
caller
f1
f2
⊥
⊥
f2
f1
5. Example:
JPetStore
5.0
• Small
e-‐commerce
applica#on
(2KLOC)
consis#ng
of
eight
features
Scenarios
1st
Features
s1
s2
s3
f1
Browsing the Catalog ✔
✔
f2
Searching the Catalog ✔
f3
Signing In ✔
✔
f4
Ordering Items ✔
f5
Signing Up
f6
Adding and Removing an Item
f7
Updating the Quantity of an Item
f8
Reviewing an Order
Uniden#fied
by
analysts
6. Dependency
Matrix
of
JPetStore
Transitions to
SignonForm.jsp
(global forward)
Transitions to
Main.jsp
(global forward)
f1T
T
f3
f4
f2
f1
T
T
f3
f4
f2
Transitions to
NewOrderForm.jsp
(global forward)
Transitions to Error.jsp
(default error handler)
Transition to
ShippingForm.jsp
Invocations to CartBean.updateCartQuantities()
and CartBean.removeItemFromCart()
Transitions to
ViewItem.jsp
Invocation to
Cart.incrementQuantityByItemId(String)
Invocations to
AbstractBean.setMessage(String)
Covered
Uncovered
7. Manual
Explora#on
(1
of
2)
• Incoming
Dependency
to
f4
– f2:
CatalogBean.seachProducts()
→
f4:
AbstractBean.setMessage(String)
public String searchProducts() {
if (keyword == null || keyword.length() < 1) {
setMessage("Please enter a keyword to search for, then press the
search button.");
return FAILURE;
} else {
productList = catalogService.searchProductList(keyword.toLowerCase());
return SUCCESS;
}
}
8. Manual
Explora#on
(2
of
2)
• Outgoing
dependency
from
f4
– f4:
OrderBean.newOrder()
→⊥:
/order/ShippingForm.jsp
public String newOrder() {
Map sessionMap = ActionContext.
getActionContext().getSessionMap();
if (shippingAddressRequired) {
shippingAddressRequired = false;
return SHIPPING;
} else if (!isConfirmed()) {
return CONFIRM;
} else if (getOrder() != null) {
...
f4:
/order/NewOrderForm.jsp
9. Adding
Scenarios
for
Next
FL
• S4:
Perform
an
empty
search
• S5:
Supply
a
shipping
address
in
submibng
an
order
Scenarios
1st
2nd
Features
s1
s2
s3
s4
s5
f1
Browsing the Catalog ✔
✔
✔
f2
Searching the Catalog ✔
✔
f3
Signing In ✔
✔
✔
f4
Ordering Items ✔
✔
f5
Signing Up
f6
Adding and Removing an Item
f7
Updating the Quantity of an Item
f8
Reviewing an Order
Iden#fied
in
the
first
itera#on
10. Narrowing
Dependencies
• 71
uncovered
dependencies
were
related
to
f4
– 35
are
fan-‐ins
to
the
known
features
– 36
(21%)
remained
to
be
explored
T
f1
f2
f3
f4
⊥
Total
T
f1
0
5
1
1
2
3
2
2
5
11
f2
1
1
0
1
0
3
1
1
2
2
1
1
5
9
f3
0
2
3
20
3
3
3
3
9
28
f4
4
4
0
4
4
10
5
66
12
12
25
96
⊥
6
6
11
11
2
2
29
29
39
39
42
42
129
129
Total
11
13
11
21
2
5
38
61
51
113
60
60
173
273
Led:
#
of
uncovered
dependencies,
Right:
#
of
dependencies