DOI QR코드

DOI QR Code

A Code Clustering Technique for Unifying Method Full Path of Reusable Cloned Code Sets of a Product Family

제품군의 재사용 가능한 클론 코드의 메소드 경로 통일을 위한 코드 클러스터링 방법

  • 김태영 (전북대학교 소프트웨어공학과) ;
  • 이지현 (전북대학교 소프트웨어공학과) ;
  • 김은미 (호원대학교 컴퓨터.게임학과)
  • Received : 2022.09.13
  • Accepted : 2022.11.18
  • Published : 2023.01.31

Abstract

Similar software is often developed with the Clone-And-Own (CAO) approach that copies and modifies existing artifacts. The CAO approach is considered as a bad practice because it makes maintenance difficult as the number of cloned products increases. Software product line engineering is a methodology that can solve the issue of the CAO approach by developing a product family through systematic reuse. Migrating product families that have been developed with the CAO approach to the product line engineering begins with finding, integrating, and building them as reusable assets. However, cloning occurs at various levels from directories to code lines, and their structures can be changed. This makes it difficult to build product line code base simply by finding clones. Successful migration thus requires unifying the source code's file path, class name, and method signature. This paper proposes a clustering method that identifies a set of similar codes scattered across product variants and some of their method full paths are different, so path unification is necessary. In order to show the effectiveness of the proposed method, we conducted an experiment using the Apo Games product line, which has evolved with the CAO approach. As a result, the average precision of clustering performed without preprocessing was 0.91 and the number of identified common clusters was 0, whereas our method showed 0.98 and 15 respectively.

유사한 소프트웨어는 기존 산출물을 복제하고 수정하는 클론-앤-오운(clone-and-own, CAO) 방법으로 개발되곤 한다. 그러나 클론-앤-오운 방법은 복제된 제품의 수가 늘면서 유지보수를 어렵게 만들기 때문에 나쁜 프랙티스로 간주된다. 소프트웨어 제품라인 공학은 체계적인 재사용을 통해 소프트웨어 제품군을 개발하는 방법으로 클론-앤-오운 방법의 문제를 해결할 수 있다. CAO 방식으로 개발되어 온 제품패밀리를 제품라인 공학으로 마이그레이션하는 작업은 여러 소프트웨어 제품에서 클로닝된 부분들을 찾아 통합하고 재사용 가능한 자산으로 구축하는 것으로부터 시작된다. 그러나 클로닝이 디렉토리부터 코드 라인까지 다양한 수준에서 발생하고 그 과정에서 이들의 구조에 변경이 일어날 수 있어 단순하게 클로닝을 찾아내는 것만으로는 고품질의 제품라인 코드베이스를 구축하기 어렵다. 성공적인 마이그레이션을 위해서는 소스 코드들 사이의 클로닝 관계를 찾는 것 이외에도 소스 코드들의 파일 경로와 클래스 이름, 메소드 시그니처 등의 동일성을 확보는 작업이 선행되어야 한다. 이에 본 연구는 CAO 기반으로 개발된 제품들로부터 마이그레이션 대상 제품들을 선정한 후 제품들에 흩어져 있는 유사 코드 집합을 검출하여 메소드 경로의 통일이 필요한 대상을 식별하는 클러스터링 방법을 제안한다. 제안 방법의 효과를 보이기 위해 CAO 방식으로 진화해온 ApoGames 제품군에 제안 방법을 적용하여 실험을 진행하였다. 그 결과, 전처리 없이 수행된 파일의 상대 경로 기반 클러스터링 방법의 평균 정밀도는 0.91이며 식별된 공통 클러스터의 개수는 0개인 반면에 이 논문에서 제안하는 전처리와 함께 수행된 메소드 시그니처 기반 클러스터링 방법의 평균 정밀도는 0.98로 개선되었으며 식별된 공통 클러스터는 최대 15개까지 증가하였다.

Keywords

Acknowledgement

이 성과는 정부(과학기술정보통신부)의 재원으로 한국연구재단의 지원을 받아 수행된 연구임(NRF-2020R1F1A1071650).

References

  1. C. W. Krueger and K. Jackson, "Requirements engineering for systems and software product lines," Product line management white paper, Dec. 2009. (http://www.biglever.co m/extras/RE_for_SPL.pdf).
  2. R. Lapena, M. Ballarin, and C. Cetina, "Towards clone-and-own support: Locating relevant methods in legacy products," in Proceedings of the 20th International Systems and Software Product Line Conference (SPLC), pp.194-203, 2016.
  3. J. Bosch, "Maturity and evolution in software product lines: Approaches, artefacts and organization," The 2nd International Systems and Software Product Line Conference (SPLC), Lecture Notes in Computer Science, Vol.2379, pp.247-262, 2002.
  4. V. Anwikar, R. Naik, A. Contractor, and H. Makkapati. "Domain-driven technique for functionality identification in source code," in SIGSOFT Software Engineering Notes, Vol.37, No.3, pp.1-8, 2012. https://doi.org/10.1145/2180921.2180923
  5. E. Kuiter, J. Kruger, S. Krieter, T. Leich, and G. Saake, "Getting rid of clone-and-own: Moving to a software product line for temperature monitoring," in Proceedings of the 22nd International Systems and Software Product Line Conference (SPLC), Vol.A, pp.1-11, 2018.
  6. M. Abbas, R. Jongeling, C. Lindskog, E.P. Enoiu, M. Saadatmand, and D. Sundmark, "Product line adoption in industry: An experience report from the railway domain," in Proceedings of the 24th International Systems and Software Product Line Conference (SPLC), Vol.A, pp.14-24, 2020.
  7. Y. Dubinsky, J. Rubin, T. Berger, S. Duszynski, M. Becker, and K. Czarnecki, "An exploratory study of cloning in industrial software product lines," in Proceedings of 17th European Conference on Software Maintenance and Reengineering (CSMR), pp.25-34, 2013.
  8. E. Ghabach, "Supporting clone-and-own in software product line," Doctoral thesis, Software Engineering, Universite Coted'Azur, 2018.
  9. C. Lima, I. do Carmo Machado, E. S. de Almeida, and C. von Flach G Chavez, "Recovering the product line architecture of the apo-games," in Proceedings of the 22nd International Systems and Software Product Line Conference (SPLC), pp.289-293, 2018.
  10. J. Rubin, K. Czarnecki, and M. Chechik, "Managing cloned variants: A framework and experience," in Proceedings of the 17th International Software Product Line Conference (SPLC), pp.101-110, 2013.
  11. N. Lodewijks, "Analysis of a clone-and-own industrial automation system: An exploratory study," in Proceedings of the Seminar Series on Advanced Techniques and Tools for Software Evolution (SATToSE), pp.1-12, 2017.
  12. I. D. Baxter and D. Churchett, "Using clone detection to manage a product line," Workshop on Industrial Experience with Product Line Approaches, pp.1-3, 2002.
  13. D. Faust and C. Verhoef, "Software product line migration and deployment," in Software: Practice and Experience, Vol.33, No.10, pp.933-955, 2003. https://doi.org/10.1002/spe.530
  14. R. Koschke, P. Frenzel, A. P. J. Breu, and K. Angstmann, "Extending the reflexion method for consolidating software variants into product lines," in Software Quality Journal, Vol.17, No.4, pp.331-366, 2009. https://doi.org/10.1007/s11219-009-9077-8
  15. T. Mende, F. Beckwermert, R. Koschke, and G. Meier, "Supporting the grow-and-prune model in software product lines evolution using clone detection," in Proceedings of the 12th European Conference on Software Maintenance and Reengineering, pp.163-172, 2008.
  16. A. Schlie, S. Schulze, and I. Shaefer, "Recovering variability information from source code of clone-and-own software systems," in Proceedings of the 14th International Working Conference on Variability Modelling of Software-Intensive Systems (VAMOS), pp.1-9, 2020.
  17. A. Schlie, A. Knuppel, C. Shidl, and I. Shaefer, "Incremental feature model synthesis for clone-and-own software systems in MATLAB/Simulink," in Proceedings of the 24th International Systems and Software Product Line Conference (SPLC), Vol.A, pp.53-64, 2020.
  18. W. Fenske, J. Meinicke, S. Schulze, and G. Saake, "Variant-preserving refactorings for migrating cloned products to a product line," in Proceedings of the IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp.316-326, 2017.
  19. T. Ishio, Y. Sakaguchi, K. Ito, and K. Inoue, "Source file set search for clone-and-own reuse analysis," in Proceedings of the 14th International Conference on Mining Software Repositories (MSR), pp.257-268, 2017.
  20. L. Linsbauer, R. E. Lopez-Herrejon, and A. Egyed, "Variability extraction and modeling for product variants," Software System Model, Vol.16, No.4, pp.1179-1199, 2017. https://doi.org/10.1007/s10270-015-0512-y
  21. J. Debbiche, O, Lignell, J Kruger, and T. Berger, "Migrating Java-based apo-games into a composition-based software product line," in Proceedings of the 23nd International Systems and Software Product Line Conference (SPLC), Vol.A, pp.98-102, 2019.
  22. C. 1, W. Assuncao, J. Martinez, W. Mendonca, I. C Machado, and C. Chavez, "Product line architecture recovery with outlier filtering in software families: the apo-games case study," in Journal of the Brazilian Computer Society, Vol.25, No.7, pp.1-17, 2019. https://doi.org/10.1186/s13173-018-0081-3
  23. J. Lee, T. Kim, and S. Kang, "Recovering software product line architecture of product variants developed with the clone-and-own approach," in Proceedings of the IEEE 44th International Conference on Computers, Software and Applications (COMPSAC), pp.985-990, 2020.