Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Incremental Feature Location and Identification in Source Code

14.493 visualizaciones

Publicado el

Presented at CSMR 2013 http://dx.doi.org/10.1109/CSMR.2013.52

Publicado en: Tecnología
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Incremental Feature Location and Identification in Source Code

  1. 1. 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)
  2. 2. 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)  
  3. 3. 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  ff  f  Case  (a):  outgoing  dependency  •  Relevant  to  f  ?  •  Calling  another  feature? caller f1  f2  ⊥  ⊥  f2  f1  
  4. 4. 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  
  5. 5. Dependency  Matrix  of  JPetStore Transitions toSignonForm.jsp(global forward)Transitions toMain.jsp(global forward)f1TTf3f4f2f1TTf3f4f2Transitions toNewOrderForm.jsp(global forward)Transitions to Error.jsp(default error handler)Transition toShippingForm.jspInvocations to CartBean.updateCartQuantities()and CartBean.removeItemFromCart()Transitions toViewItem.jspInvocation toCart.incrementQuantityByItemId(String)Invocations toAbstractBean.setMessage(String)CoveredUncovered
  6. 6. 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 thesearch button."); return FAILURE; } else { productList = catalogService.searchProductList(keyword.toLowerCase()); return SUCCESS; } }  
  7. 7. 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  
  8. 8. 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  
  9. 9. 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  
  10. 10. Conclusion

×