Journal of Computer Science and Technology ›› 2022, Vol. 37 ›› Issue (2): 389-404.doi: 10.1007/s11390-022-0673-4

Special Issue: Software Systems

• Software Systems • Previous Articles     Next Articles

Test-Driven Feature Extraction of Web Components

Yong-Hao Long1,2 (龙永浩), Yan-Cheng Chen1 (陈彦呈), Xiang-Ping Chen3 (陈湘萍), Member, CCF, Xiao-Hong Shi4 (石晓红), and Fan Zhou1,* (周凡)        

  1. 1School of Computer Science and Engineering, National Engineering Research Center of Digital Life, Sun Yat-sen University, Guangzhou 510006, China
    2School of Design, The Hong Kong Polytechnic University, Hong Kong, China
    3Guangdong Key Laboratory for Big Data Analysis and Simulation of Public Opinion, The School of Communication and Design, Sun Yat-sen University, Guangzhou 510006, China
    4School of Information Technology and Engineering, Guangzhou College of Commerce, Guangzhou 511363, China
  • Received:2020-05-31 Revised:2022-01-24 Accepted:2022-02-18 Online:2022-03-31 Published:2022-03-31
  • Contact: Fan Zhou E-mail:isszf@mail.sysu.edu.cn
  • About author:Fan Zhou is currently a professor in Sun Yat-sen University, Guangzhou. He received his Ph.D. degree in computer science from Sun Yat-sen University, Guangzhou, in 2007. His research interests include computer graphics, computer aided design and image processing.
  • Supported by:
    This work was supported by the Key-Area Research and Development Program of Guangdong Province under Grant No. 2020B010165001, the National Natural Science Foundation of China under Grant No. 61976061, and Guangdong Basic and Applied Basic Research Foundation under Grant No. 2020A1515010973.

With the growing requirements of web applications, web components are developed to package the implementation of commonly-used features for reuse. In some cases, the developer may want to reuse some features which cannot be customized by the component's APIs. He/she has to extract the implementation by hand. It is labor-intensive and error-prone. Considering the widely-used test cases which can be useful to specify the software features, a test-driven approach is proposed to extract the implementation of the desired features in web components. The satisfaction of the user's requirements is transformed into the passing rate of user-specified test cases. In this way, the quality of the extraction result can be evaluated automatically. Meanwhile, a record/replay-based GUI test generation method is proposed to ensure that the extraction result has the correct GUI appearance. To extract the feature implementation, a hierarchical genetic algorithm is proposed to find the code snippet that can pass all the tests and has the approximate smallest size. We compare our method with two existing feature extraction methods. The result shows that our method can extract the correct implementation with the minimum size. A human-subject study is conducted to show the effectiveness and weaknesses of our method in helping users extract the features.


Key words: feature extraction; genetic algorithm; graphical user interface; software reuse ;

[1] Krueger C W. Software reuse. ACM Computing Surveys, 1992, 24(2): 131-183. DOI: 10.1145/130844.130856.
[2] Chattopadhyay S, Nelson N, Gonzalez Y R, Leon A A, Pandita R, Sarma A. Latent patterns in activities: A field study of how developers manage context. In Proc. the 41st IEEE/ACM Int. Conference on Software Engineering, May 2019, pp.373-383. DOI: 10.1109/ICSE.2019.00051.
[3] Gascon-Samson J, Jung K, Goyal S, Rezaiean-Asel A, Pattabiraman K. ThingsMigrate: Platform-independent migration of stateful JavaScript IoT applications. In Proc. the 32nd European Conference on Object-Oriented Programming, July 2018, Article No. 18. DOI: 10.4230/LIPIcs.ECOOP.2018.18.
[4] Xu B, An L, Thung F, Khomh F, Lo D. Why reinventing the wheels? An empirical study on library reuse and re-implementation. Empirical Software Engineering, 2020, 25(1): 755-789. DOI: 10.1007/s10664-019-09771-0.
[5] Krüger J, Mukelabai M, Gu W, Shen H, Hebig R, Berger T. Where is my feature and what is it about? A case study on recovering feature facets. Journal of Systems and Software, 2019, 152: 239-253. DOI: 10.1016/j.jss.2019.01.057.
[6] Oney S, Myers B. FireCrystal: Understanding interactive behaviors in dynamic web pages. In Proc. the 2019 IEEE Symp. Visual Languages and Human-Centric Computing, Sept. 2009, pp.105-108. DOI: 10.1109/VLHCC.2009.5295287.
[7] Hibschman J, Zhang H. Unravel: Rapid web application reverse engineering via interaction recording, source tracing, and library detection. In Proc. the 28th Annual ACM Symp. User Interface Software & Technology, Nov. 2015, pp.270-279. DOI: 10.1145/2807442.2807468.
[8] Alimadadi S, Sequeira S, Mesbah A, Pattabiraman K. Understanding JavaScript event-based interactions. In Proc. the 36th Int. Conference on Software Engineering, May 2014, pp.367-377. DOI: 10.1145/2568225.2568268.
[9] Maras J, Stula M, Carlson J, Crnkovic I. Identifying code of individual features in client-side web applications. IEEE Trans. Software Engineering, 2013, 39(12): 1680-1697. DOI: 10.1109/TSE.2013.38.
[10] Shaffer D W, Resnick M. ``Thick'' authenticity: New media and authentic learning. Journal of Interactive Learning Research, 1999, 10(2): 195-216.
[11] Razzaq A, Le Gear A, Exton C, Buckley J. An empirical assessment of baseline feature location techniques. Empirical Software Engineering, 2020, 25(1): 266-321. DOI: 10.1007/s10664-019-09734-5.
[12] Burg B, Ko A J, Ernst M D. Explaining visual changes in web interfaces. In Proc. the 28th Annual ACM Symp. User Interface Software & Technology, Nov. 2015, pp.259-268. DOI: 10.1145/2807442.2807473.
[13] Barr E T, Harman M, Jia Y, Marginean A, Petke J. Automated software transplantation. In Proc. the 2015 Int. Symp. Software Testing and Analysis, July 2015, pp.257-269. DOI: 10.1145/2771783.2771796.
[14] Jensen S H, Møller A, Thiemann P. Type analysis for JavaScript. In Proc. the 16th Int. Symp. Static Analysis, August 2009, pp.238-255. DOI: 10.1007/978-3-642-03237-0_17.
[15] Kashyap V, Dewey K, Kuefner E A et al. JSAI: A static analysis platform for JavaScript. In Proc. the 22nd ACM SIGSOFT Int. Symp. Foundations of Software Engineering, Nov. 2014, pp.121-132. DOI: 10.1145/2635868.2635904.
[16] Guha A, Saftoiu C, Krishnamurthi S. The essence of JavaScript. In Proc. the 24th European Conference on Object-Oriented Programming, June 2010, pp.126-150. DOI: 10.1007/978-3-642-14107-2_7.}
[17] Madsen M, Livshits B, Fanning M. Practical static analysis of JavaScript applications in the presence of frameworks and libraries. In Proc. the 9th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on Foundations of Software Engineering, August 2013, pp.499-509. DOI: 10.1145/2491411.2491417.
[18] Guarnieri S, Pistoia M, Tripp O, Dolby J, Teilhet S, Berg R. Saving the world wide web from vulnerable JavaScript. In Proc. the 2011 Int. Symp. Software Testing and Analysis, July 2011, pp.177-187. DOI: 10.1145/2001420.2001442.
[19] Malik R S, Patra J, Pradel M. NL2Type: Inferring JavaScript function types from natural language information. In Proc. the 41st IEEE/ACM Int. Conference on Software Engineering, May 2019, pp.304-315. DOI: 10.1109/ICSE.2019.00045.
[20] Jensen S H, Madsen M, Møller A. Modeling the HTML DOM and browser API in static analysis of JavaScript web applications. In Proc. the 19th ACM SIGSOFT Symp. and the 13th European Conference on Foundations of Software Engineering, Sept. 2011, pp.59-69. DOI: 10.1145/2025113.2025125.
[21] Kristensen E K, Møller A. Reasonably-most-general clients for JavaScript library analysis. In Proc. the 41st Int. Conference on Software Engineering, May 2019, pp.83-93. DOI: 10.1109/ICSE.2019.00026.
[22] Madsen M, Tip F, Lhoták O. Static analysis of event-driven Node.js JavaScript applications. ACM SIGPLAN Notices, 2015, 50(10): 505-519. DOI: 10.1145/2858965.2814272.
[23] Park C, Ryu S. Scalable and precise static analysis of JavaScript applications via loop-sensitivity. In Proc. the 29th European Conference on Object-Oriented Programming, July 2015, pp.735-756. DOI: 10.4230/LIPIcs.ECOOP.2015.735.
[24] Andreasen E, Gong L, Møller A et al. A survey of dynamic analysis and test generation for JavaScript. ACM Computing Surveys, 2017, 50(5): Article No. 66. DOI: 10.1145/3106739.
[25] Sen K, Kalasapur S, Brutch T, Gibbs S. Jalangi: A selective record-replay and dynamic analysis framework for JavaScript. In Proc. the 9th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, August 2013, pp.488-498. DOI: 10.1145/2491411.2491447.
[26] Burg B, Bailey R, Ko A J, Ernst M D. Interactive record/replay for web application debugging. In Proc. the 26th ACM Symp. User Interface Software and Technology, Oct. 2013, pp.473-484. DOI: 10.1145/2501988.2502050.
[27] Mahajan S, Halfond W G. Finding HTML presentation failures using image comparison techniques. In Proc. the 29th ACM/IEEE Int. Conference on Automated Software Engineering, Sept. 2014, pp.91-96. DOI: 10.1145/2642937.2642966.
[28] Ocariza F S, Pattabiraman K, Mesbah A. Detecting inconsistencies in JavaScript MVC applications. In Proc. the 37th Int. Conference on Software Engineering, May 2015, pp.325-335. DOI: 10.1109/ICSE.2015.52.
[29] Wang J, Dou W, Gao C, Wei J. JSTrace: Fast reproducing web application errors. Journal of Systems and Software, 2018, 137: 448-462. DOI: 10.1016/j.jss.2017.06.038.
[30] Li P, Wohlstadter E. Script inSight: Using models to explore JavaScript code from the browser view. In Proc. the 9th Int. Conference on Web Engineering, June 2009, pp.260-274. DOI: 10.1007/978-3-642-02818-2_21.
[31] Dow S P, Glassco A, Kass J, Schwarz M, Schwartz D L, Klemmer S R. Parallel prototyping leads to better design results, more divergence, and increased self-efficacy. ACM Trans. Computer-Human Interaction, 2010, 17(4): Article No. 18. DOI: 10.1145/1879831.1879836.
[32] Gibson D, Punera K, Tomkins A. The volume and evolution of web page templates. In Proc. the 14th Int. Conference on World Wide Web, May 2005, pp.830-839. DOI: 10.1145/1062745.1062763.
[33] Lee B, Srivastava S, Kumar R, Brafman R, Klemmer S R. Designing with interactive example galleries. In Proc. the SIGCHI Conference on Human Factors in Computing Systems, Apr. 2010, pp.2257-2266. DOI: 10.1145/1753326.1753667.
[34] Kumar R, Talton J O, Ahmad S, Klemmer S R. Bricolage: Example-based retargeting for web design. In Proc. the SIGCHI Conference on Human Factors in Computing Systems, May 2011, pp.2197-2206. DOI: 10.1145/1978942.1979262.
[35] Swearngin A, Dontcheva M, Li W, Brandt J, Dixon M, Ko A J. Rewire: Interface design assistance from examples. In Proc. the 2018 CHI Conference on Human Factors in Computing Systems, Apr. 2018, Article No. 504. DOI: 10.1145/3173574.3174078.
[36] Wang Z, Cheng B, Jin Y, Feng Y, Chen J. EasyApp: A widget-based cross-platform mobile development environment for end-users. In Proc. the 23rd Annual Int. Conference on Mobile Computing and Networking, Oct. 2017, pp.591-593. DOI: 10.1145/3117811.3131242.
[37] Benson E O, Karger D R. Cascading tree sheets and recombinant HTML: Better encapsulation and retargeting of web content. In Proc. the 22nd Int. Conference on World Wide Web, May 2013, pp.107-118. DOI: 10.1145/2488388.2488399.
[38] Verou L, Zhang A X, Karger D R. Mavo: Creating interactive data-driven web applications by authoring HTML. In Proc. the 29th Annual Symp. User Interface Software and Technology, Oct. 2016, pp.483-496. DOI: 10.1145/2984511.2984551.
[39] Liu X, Huang G, Zhao Q, Mei H, Brain B M. iMashup: A mashup-based framework for service composition. Science China Information Sciences, 2014, 57(1): 1-20. DOI: 10.1007/s11432-013-4782-0.
[40] Huang G, Liu X, Ma Y, Lu X, Zhang Y, Xiong Y. Programming situational mobile web applications with cloud-mobile convergence: An Internetware-oriented approach. IEEE Trans. Services Computing, 2016, 12(1): 6-19. DOI: 10.1109/TSC.2016.2587260.
[41] Eisenbarth T, Koschke R, Simon D. Locating features in source code. IEEE Trans. Software Engineering, 2003, 29(3): 210-224. DOI: 10.1109/TSE.2003.1183929.
[42] Mahajan S, Alameer A, McMinn P, Halfond W G. Automated repair of layout cross browser issues using search-based techniques. In Proc. the 26th ACM SIGSOFT Int. Symp. Software Testing and Analysis, July 2017, pp.249-260. DOI: 10.1145/3092703.3092726.
[43] Chang T H, Yeh T, Miller R C. GUI testing using computer vision. In Proc. the 28th International Conference on Human Factors in Computing Systems, Apr. 2010, pp.1535-1544. DOI: 10.1145/1753326.1753555.
[1] Jun Ma, Qing-Wei Sun, Chang Xu, and Xian-Ping Tao. GridDroid---An Effective and Efficient Approach for Android Repackaging Detection Based on Runtime Graphical User Interface [J]. Journal of Computer Science and Technology, 2022, 37(1): 147-181.
[2] Chun-Hui Wang, Zhi Jin, Wei Zhang, Didar Zowghi, Hai-Yan Zhao, Wen-Pin Jiao. Activity Diagram Synthesis Using Labelled Graphs and the Genetic Algorithm [J]. Journal of Computer Science and Technology, 2021, 36(6): 1388-1406.
[3] Chun-Yang Ling, Yan-Zhen Zou, Ze-Qi Lin, Bing Xie. Graph Embedding Based API Graph Search and Recommendation [J]. Journal of Computer Science and Technology, 2019, 34(5): 993-1006.
[4] Jie Xiao, Zhan-Hui Shi, Jian-Hui Jiang, Xu-Hua Yang, Yu-Jiao Huang, Hai-Gen Hu. A Locating Method for Reliability-Critical Gates with a Parallel-Structured Genetic Algorithm [J]. Journal of Computer Science and Technology, 2019, 34(5): 1136-1151.
[5] Gianna Reggio, Maurizio Leotta, Filippo Ricca, Diego Clerissi. DUSM: A Method for Requirements Specification and Refinement Based on Disciplined Use Cases and Screen Mockups [J]. Journal of Computer Science and Technology, 2018, 33(5): 918-939.
[6] Mohamed Maher Ben Ismail, Ouiem Bchir. Automatic Fall Detection Using Membership Based Histogram Descriptors [J]. , 2017, 32(2): 356-367.
[7] Rong-Zhi Qi, Zhi-Jian Wang, Shui-Yan Li. A Parallel Genetic Algorithm Based on Spark for Pairwise Test Suite Generation [J]. , 2016, 31(2): 417-427.
[8] Lei Fang, Biao Liu, Min-Lie Huang. Leveraging Large Data with Weak Supervision for Joint Feature and Opinion Word Extraction [J]. , 2015, 30(4): 903-916.
[9] Wen Qu, Kai-Song Song, Yi-Fei Zhang, Shi Feng, Da-Ling Wang, and Ge Yu. A Novel Approach Based on Multi-View Content Analysis and SemiSupervised Enrichment for Movie Recommendation [J]. , 2013, 28(5): 776-787.
[10] Concha Bielza, Juan A. Fernández del Pozo, and Pedro Larrañaga. Parameter Control of Genetic Algorithms by Learning and Simulation of Bayesian Networks —— A Case Study for the Optimal Ordering of Tables [J]. , 2013, 28(4): 720-731.
[11] Abdelwadood Mesleh, Dmitriy Skopin, Sergey Baglikov, Anas Quteishat. Heart Rate Extraction from Vowel Speech Signals [J]. , 2012, 27(6): 1243-1251.
[12] Antonio M. Mora, Antonio Fernández-Ares, Juan J. Merelo, Pablo García-Sánchez, and Carlos M. Fernandes. Effect of Noisy Fitness in Real-Time Strategy Games Player Behaviour Optimisation Using Evolutionary Algorithms [J]. , 2012, 27(5): 1007-1023.
[13] Zhu-Fei Chu (储著飞), Student Member, IEEE, Yin-Shui Xia (夏银水), and Lun-Yao Wang (王伦耀). Cell Mapping for Nanohybrid Circuit Architecture Using Genetic Algorithm [J]. , 2012, 27(1): 113-120.
[14] Qiang Wu(吴 强), Li-Qing Zhang(张丽清), and Guang-Chuan Shi(石光川). Robust Feature Extraction for Speaker Recognition Based on Constrained Nonnegative Tensor Factorization [J]. , 2010, 25(4): 783-792.
[15] Feng Zeng, Student Member, CCF, and Zhi-Gang Chen, Member, CCF. Cost-Sensitive and Load-Balancing Gateway Placement in Wireless Mesh Networks with QoS Constraints [J]. , 2009, 24(4): 775-785.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
[1] . Online First Under Construction [J]. Journal of Computer Science and Technology, 0, (): 1 .
[2] Zhi-Neng Chen, Chong-Wah Ngo, Wei Zhang, Juan Cao, Yu-Gang Jiang. Name-Face Association in Web Videos: A Large-Scale Dataset, Baselines, and Open Issues[J]. , 2014, 29(5): 785 -798 .
[3] Fei Xia, De-Jun Jiang, Jin Xiong, Ning-Hui Sun. A Survey of Phase Change Memory Systems[J]. , 2015, 30(1): 121 -144 .
[4] André Brinkmann, Kathryn Mohror, Weikuan Yu, Philip Carns, Toni Cortes, Scott A. Klasky, Alberto Miranda, Franz-Josef Pfreundt, Robert B. Ross, Marc-André Vef. Ad Hoc File Systems for High-Performance Computing[J]. Journal of Computer Science and Technology, 2020, 35(1): 4 -26 .
[5] Yu-Tong Lu, Peng Cheng, Zhi-Guang Chen. Design and Implementation of the Tianhe-2 Data Storage and Management System[J]. Journal of Computer Science and Technology, 2020, 35(1): 27 -46 .
[6] Reza Jafari Ziarani, Reza Ravanmehr. Serendipity in Recommender Systems: A Systematic Literature Review[J]. Journal of Computer Science and Technology, 2021, 36(2): 375 -396 .
[7] Bo-Han Li, Yi Liu, An-Man Zhang, Wen-Huan Wang, Shuo Wan. A Survey on Blocking Technology of Entity Resolution[J]. Journal of Computer Science and Technology, 2020, 35(4): 769 -793 .
[8] Lie-Huang Zhu, Bao-Kun Zheng, Meng Shen, Feng Gao, Hong-Yu Li, Ke-Xin Shi. Data Security and Privacy in Bitcoin System: A Survey[J]. Journal of Computer Science and Technology, 2020, 35(4): 843 -862 .
[9] Dun Liang, Yuan-Chen Guo, Shao-Kui Zhang, Tai-Jiang Mu, Xiaolei Huang. Lane Detection: A Survey with New Results[J]. Journal of Computer Science and Technology, 2020, 35(3): 493 -505 .
[10] Lan Huang, Da-Lin Li, Kang-Ping Wang, Teng Gao, Adriano Tavares. A Survey on Performance Optimization of High-Level Synthesis Tools[J]. Journal of Computer Science and Technology, 2020, 35(3): 697 -720 .

ISSN 1000-9000(Print)

         1860-4749(Online)
CN 11-2296/TP

Home
Editorial Board
Author Guidelines
Subscription
Journal of Computer Science and Technology
Institute of Computing Technology, Chinese Academy of Sciences
P.O. Box 2704, Beijing 100190 P.R. China
Tel.:86-10-62610746
E-mail: jcst@ict.ac.cn
 
  Copyright ©2015 JCST, All Rights Reserved