Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Feature Location for Multi-Layer System Based on Formal Concept Analysis

14,980 views

Published on

Presented at CSMR 2012
http://dx.doi.org/10.1109/CSMR.2012.54

Published in: Technology
  • Be the first to comment

Feature Location for Multi-Layer System Based on Formal Concept Analysis

  1. 1. Feature Location for Multi-Layer SystemBased on Formal Concept AnalysisHiroshi  Kazato†1Shinpei  Hayashi†2Satoshi  Okada†1Shunsuke  Miyata†1Takashi  Hoshino†1 †1  NTT  Cyber  Space  LaboratoriesMotoshi  Saeki†2 †2  Tokyo  Institute  of  Technology
  2. 2. Mo#va#on •  In  mul#-­‐layer  systems,  implementa#on  of   feature  is  o6en  sca8ered  across  the   applica#on   •  Loca#ng  features  in  mul#-­‐layer  systems  (e.g.   web  applica#ons)  poses  a  new  challenge   [Marcus  2005]  [Dilshener  2011]  [Marcus 2005] Marcus et al.: “Static techniques for concept location in object-oriented code”, In Proc. ofIWPC 2005, pp.33-42, 2005.[Dilshener 2011] Dilshener et al.: “Relating developers concepts and artefact vocabulary in a financialsoftware module”, In Proc. of ICSM 2011, pp. 412-417, 2011
  3. 3. Related  Work •  Semi-­‐automa#c  FL  based  on  formal  concept   analysis  of  execu#on  traces  [Eisenbarth  2003]   ({u1,  u2,  u3,  u4,  u5,  u6,  u7},  ø) Computa#onal  Unit   Features (Methods  or  Func#ons) ({u2,  u4,  u5,  u7},  {s2}) ({u1,  u4,  u6,  u7},  {s1}) ({u3,  u5,  u6,  u7},  {s3}) f1 f2 f3 u1 u2 u3 u4 u5 u6 u7 s ✔ 1 ✔ ✔ ✔ ✔ ✔ ({u4,  u7},  {s1,  s2}) ({u5,  u7},  {s2,  s3}) s ✔ ✔ 2 ✔ ✔ ✔ ✔ s 3 ✔ ✔ ✔ ✔ ✔ ✔ ({u6,  u7},  {s1,  s3}) ({u7},  {s1,  s2,  s3}) [Eisenbarth 2003] Eisenbarth et al. : Locating Features in Source Code, IEEE TSE, 29(3) 210-224, 2003.
  4. 4. Our  Goal •  Locate  collabora#on  which  realizes  features,   composed  of  various  kinds  of  program   element  in  a  mul#-­‐layer  system   E xis#ng   Pro posed   Feature  1   nique Tech nique Tech Page  1   Feature  1   Method  1 Method  1 Method  2 Method  2 Method  3 Method  3 … Table  1 Concept   Concept   … La^ce La^ce
  5. 5. Overview  of  the  Proposed  Technique •  Conduct  dynamic  analysis  separately  for  each   layers   •  Interrelate  observed  elements  by  FCA   Concept   S   L0   L1   L2   L3   La^ce (Scenarios) (Features) Presenta#on Applica#on Data f1   s1 f1   p11   p21 p31 Browse   /index.shtml CatalogService.   PRODUCT p21 Analyst Category init() p11   p31 s2 p22 f2   p12   p22 p32 f3   p13   ... p23 p33 f2   ... p14   p24 p34 sl p12   p23 p32 fm   ... ... ... Prepareing   Extrac#ng  Execu#on  Traces  of   FL  using  Formal   Applying  FCA Scenarios Each  Layer   Concepts
  6. 6. Example:    iBATIS  JPetStore  5.0 •  Reference  applica#on  of  Java  EE   –  e-­‐commerce  system  •  Three  layers   –  L1:  Presenta#on   –  L2:  Applica#on   –  L3:  Data
  7. 7. Usecases  of  JPetStore 362 CHAPTER 11 ARCHITECTURE OF THE SAMPLE APPLICATION Search Catalog Browse Categories Browse Catalog Browse Product Details Browse Item Details Update Shopping Cart Sign On and Off customer Update Account Update Personalization <<include>> Send Purchase Order Submit Order to Order Fulfillment CenterSingh et al.: “Designing Enterprise Applications with the J2EE Platform, Second Edition”, Prentice Hall, 2002, Figure 11.5 Figure 11.5 Use Cases between Customer and Web Site
  8. 8. Feature-­‐Scenario  Mapings s1 s2 s3 s4 s5 s6 f1: Browse Catalog ✔ ✔ ✔ ✔f2: Search Catalog ✔f3: Browse Categories ✔ ✔ ✔f4: Browse Product Details ✔ ✔ ✔ ✔f5: Browse Item Details ✔f6: Update Shopping Cart ✔f7: Sign On and Off ✔ ✔ ✔f8: Update Account ✔f9: Update Personalization ✔f10: Submit Order ✔
  9. 9. L1:  Presenta#on  Layer  •  Observe  URL  of  web  pages  displayed  in  each   scenario   –  from  the  headers  of  HTTP  requests  2011-12-16 00:13:49,174 DEBUG HttpRefererLogger -http://localhost:8080/JPetStore-5.0/!2011-12-16 00:13:53,722 DEBUG HttpRefererLogger -http://localhost:8080/JPetStore-5.0/shop/index.shtml!2011-12-16 00:13:59,375 DEBUG HttpRefererLogger -http://localhost:8080/JPetStore-5.0/shop/viewCategory.shtml?categoryId=FISH!
  10. 10. L2:  Applica#on  Layer   •  Observe  Java  methods  executed  during   scenarios    ...!1329320179938,16,MethodEntry,1!1329320179938,16,MethodEntry,33!1329320179939,16,ClassLoad,1529,"com.ibatis.jpetstore.persistence.DaoConfig"!1329320179939,16,MethodInstrument,1529,150,"com.ibatis.jpetstore.persistence.DaoConfig.<clinit>()"!1329320179945,16,MethodInstrument,1529,151,"com.ibatis.jpetstore.persistence.DaoConfig.getDaoManager()"!1329320179950,16,MethodInstrument,1529,152,"com.ibatis.jpetstore.persistence.DaoConfig.newDaoManager(java.util.Properties)"!1329320179954,16,MethodEntry,150!1329320179954,16,MethodEntry,152!
  11. 11. L3:  Data  Layer  •  Observe  database  tables  manipulated  during   scenarios   –  from  SQL  statement  logs  2011-12-16 00:24:04,836 DEBUG Connection - {conn-100000} Connection!2011-12-16 00:24:04,918 DEBUG PreparedStatement - {pstm-100001}PreparedStatement: select PRODUCTID, NAME, DESCN as description, CATEGORYas categoryId from PRODUCT WHERE lower(name) like ? OR lower(category)like ? OR lower(descn) like ? !2011-12-16 00:24:04,918 DEBUG PreparedStatement - {pstm-100001}Parameters: [%koi%, %koi%, %koi%]!2011-12-16 00:24:04,918 DEBUG PreparedStatement - {pstm-100001} Types:[java.lang.String, java.lang.String, java.lang.String]!2011-12-16 00:24:04,944 DEBUG ResultSet - {rset-100002} ResultSet!...
  12. 12. Formal  Context •  Merge  traces  for  all  scenarios  and  layers L0:  Features L1:  Presenta#on L2:  Applica#on L3:  Data .setMessage(String) viewproduct.shtml SequenceSqlMapDao. getNextId(String) /index.shtml AbstractBean   ACCOUNT SIGNON /shop/ f1 … f10 … … … s1 ✔   … ✔   … … … s2 ✔   … ✔   … ✔   … … s3 ✔   … ✔   ✔   … ✔   ✔   … ✔   ✔   … ✔   s4 … ✔   … … ✔   … ✔   s5 … ✔   … … ✔   … ✔   s6 ✔   … ✔   … … …
  13. 13. Loca#ng  Features   in  Formal  Concepts c4 = ({s1}, {f3, ... }) c1 f3: Browse Categories! ! /shop/viewCategory.shtml! c12   c3 CatalogBean.getCategory()! CatalogBean.setCategoryId(String)! CatalogBean.viewCategory()! c8   CatalogService.getCategory(String)! Category.getName()! Category.setCategoryId(String)! Category.setDescription(String)! c13 c5   c11 c9 Category.setName(String)! CategorySqlMapDao.getCategory(Strin @CATEGORY!c14 c7 c6   c10 c2
  14. 14. Analyzing  the  Concept  La^ce c12 = (ø, {f1, f4, ... }) [ 0 / 32 / 1 ] c4 = ({s1}, {f3, ... }) [ 1 / 9 / 1 ]f1: Browse Catalog! f3: Browse Categories!f4: Browse Product Details!! c1  [  2  /  17  /  1  ] ! /shop/viewCategory.shtml!CatalogBean.getItemList()! CatalogBean.getCategory()!CatalogBean.getProduct()! CatalogBean.setCategoryId(String)!CatalogBean.getProductList()! c3  [  0  /  2  /  0  ] CatalogBean.viewCategory()!CatalogBean.setProductId(String)! CatalogService.getCategory(String)!CatalogBean.viewProduct()! Category.getName()!CatalogService.getItemListByProduct(String)! Category.setCategoryId(String)!CatalogService.getProduct(String)! Category.setDescription(String)!Item.getAttribute1()! c8  =  (ø,  {f7,  ...  })   Category.setName(String)!Item.getAttribute2()! CategorySqlMapDao.getCategory(String)!Item.getAttribute3()! [  1  /  36  /  4  ]   @CATEGORY!Item.getAttribute4()!Item.getAttribute5()! c11  [  0  /  8  /  0  ]Item.getItemId()!Item.getListPrice()! c13  [  0  /  1  /  0  ]  Item.getProduct()! c9 = ({s4}, { ... }) [ 1 / 2 / 0 ]Item.getProductId()! /shop/signonForm.shtml!Item.setAttribute1(String)! AccountBean.clear()!Item.setAttribute2(String)! AccountBean.signoff()!Item.setAttribute3(String)!Item.setAttribute4(String)!Item.setAttribute5(String)!Item.setItemId(String)!Item.setListPrice(BigDecimal)!Item.setProduct(Product)! c10  =  ({s5},  {f8,    f9,  ...  })  Item.setStatus(String)! [  2  /  17  /  0  ]Item.setSupplierId(int)!Item.setUnitCost(BigDecimal)!ItemSqlMapDao.getItemListByProduct(String)! c6  =  ({s3},  {f6,    f10,  ...  })  Product.getCategoryId()! c2 = (ø, ø) [  5  /  103  /  4  ]Product.getName()!Product.getProductId()! [0/0/0] formal    concept  related  to  ProductSqlMapDao.getProduct(String)!@ITEM! a  feature formal    concept  related  to  c14 = ({s6}, {f2, ... }) [ 1 / 6 / 0 ] two  or  more  features  f2: Search Catalog! formal    concept  related  to  !/shop/searchProducts.shtml! c7 = ({s2}, {f5, ... }) [ 0 / 4 / 0 ] c5 = (ø, { ... }) [ 1 / 3 / 1 ] no  specific  feature  CatalogBean.searchProducts()!CatalogBean.setKeyword(String)! f5: Browse Item Details! ! /shop/viewProduct.shtml! CatalogService.getItem(String)! [  p  /  a  /  d  ]  CatalogService.searchProductList(String)! CatalogBean.getItem()! Item.setQuantity(int)! #  of  program  elements  from    ProductSqlMapDao.searchProductList(String)! CatalogBean.setItemId(String)! ItemSqlMapDao.getItem(String)!ProductSqlMapDao$ProductSearch.getKeywordList()! CatalogBean.viewItem()! @INVENTORY! presenta#on  /    applica#on  /  ProductSqlMapDao$ProductSearch(String)! Item.getQuantity()! data  layers  
  15. 15. Discussion •  Advantages  to  exis#ng  FLTs   –  Incorporate  different  kinds  of  elements  into  FL  •  Flexibility  to  mul#-­‐layer  systems   –  Independent  from  the  number  and  combina#on   of  layers  •  Understanding  complicated  concepts   –  Concepts  may  contain  many  elements   –  Metrics  and/or  visualiza#on  of  program  elements   contained  in  those  concepts  may  help  
  16. 16. Conclusion •  Proposed  a  semi-­‐automa#c  technique  to   locate  features  in  a  mul#-­‐layer  system   –  by  extending  exis#ng  technique  based  on  FCA  and   dynamic  analysis  •  Showed  the  feasibility   –  by  applying  it  to  the  example  of  web  applica#on   based  on  typical  three-­‐layer  architecture  of  Java   EE  
  17. 17. Conclus#on OverviewoftheProposedTechnique Concept(La+ce c4 = ({s1}, {f3, ... }) •  Conductdynamicanalysisseparatelyforeach c1 f3: Browse Categories! layers ! /shop/viewCategory.shtml! •  InterrelateobservedelementsbyFCA CatalogBean.getCategory()! c12( c3 CatalogBean.setCategoryId(String)! Concept CatalogBean.viewCategory()! S L0 L1 L2 L3 LaQce CatalogService.getCategory(String)! (Scenarios) (Features) PresentaCon ApplicaCon Data Category.getName()! f1 c8( Category.setCategoryId(String)! s1 f1 p11 p21 p31 Browse Category.setDescription(String)! /index.shtml CatalogService. PRODUCT p21Analyst Category init() p11 p31 Category.setName(String)! s2 f2 p12 p22 c13 c5( c11 c9 CategorySqlMapDao.getCategory(String)! p22 p32 @CATEGORY! f3 p13 ... p23 p33 f2 ... sl p14 p24 p34 p12 p23 p32 c14 c7 c6( c10 fm( ... ... ... Prepareing ExtracCngExecuConTracesof FLusingFormal ApplyingFCA Scenarios EachLayer Concepts c2 •  Future  work   –  Suppor#ng  analysis  of  formal  concepts   –  Conduc#ng  a  case  study  through  industrial  and   open-­‐sourced  mul#-­‐layer  systems
  18. 18. Credit •  Day  273  -­‐  Tiny  Trachodon  by  puuikibeach   –  h8p://www.flickr.com/photos/puuikibeach/3768359322

×