Abstract
Nowadays, modern applications are developed using components written in different programming languages and technologies. The cost benefits of reuse and the advantages of each programming language are two main incentives behind the proliferation of such systems. However, as the number of languages increases, so do the challenges related to the development and maintenance of these systems. In such situations, developers may introduce design smells (i.e., anti-patterns and code smells) which are symptoms of poor design and implementation choices. Design smells are defined as poor design and coding choices that can negatively impact the quality of a software program despite satisfying functional requirements. Studies on mono-language systems suggest that the presence of design smells may indicate a higher risk of future bugs and affects code comprehension, thus making systems harder to maintain. However, the impact of multi-language design smells on software quality such as fault-proneness is yet to be investigated.
In this article, we present an approach to detect multi-language design smells in the context of JNI systems. We then investigate the prevalence of those design smells and their impacts on fault-proneness. Specifically, we detect 15 design smells in 98 releases of 9 open-source JNI projects. Our results show that the design smells are prevalent in the selected projects and persist throughout the releases of the systems. We observe that, in the analyzed systems, 33.95% of the files involving communications between Java and C/C++ contain occurrences of multi-language design smells. Some kinds of smells are more prevalent than others, e.g., Unused Parameters, Too Much Scattering, and Unused Method Declaration. Our results suggest that files with multi-language design smells can often be more associated with bugs than files without these smells, and that specific smells are more correlated to fault-proneness than others. From analyzing fault-inducing commit messages, we also extracted activities that are more likely to introduce bugs in smelly files. We believe that our findings are important for practitioners as it can help them prioritize design smells during the maintenance of multi-language systems.
- Panagiotis K. Linos, Zhi-hong Chen, Seth Berrier, and Brian O’Rourke. 2003. A tool for understanding multi-language program dependencies. In Proceedings of the 11th IEEE International Workshop on Program Comprehension, 2003. IEEE, 64--72.Google ScholarDigital Library
- Kostas Kontogiannis, Panos Linos, and Kenny Wong. 2006. Comprehension and maintenance of large-scale multi-language software applications. In Proceedings of the 22nd IEEE International Conference on Software Maintenance, 2006 (ICSM’06). IEEE, 497--500.Google ScholarDigital Library
- Pavneet Singh Kochhar, Dinusha Wijedasa, and David Lo. 2016. A large scale study of multiple programming languages and code quality. In Proceedings of the 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), Vol. 1. IEEE, 563--573.Google ScholarCross Ref
- T. Capers Jones. 1998. Estimating Software Costs. McGraw-Hill, Inc.Google Scholar
- Jacob Matthews and Robert Bruce Findler. 2009. Operational semantics for multi-language programs. ACM Transactions on Programming Languages and Systems (TOPLAS) 31, 3 (2009), 12.Google ScholarDigital Library
- Byeongcheol Lee, Martin Hirzel, Robert Grimm, and Kathryn S. McKinley. 2009. Debug all your code: Portable mixed-environment debugging. SIGPLAN Notes 44, 10 (Oct. 2009), 207--226.Google ScholarDigital Library
- Michael Goedicke, Gustaf Neumann, and Uwe Zdun. 2000. Object system layer. In Proceedings of the5th European Conference on Pattern Languages of Programms (EuroPLoP’2000) (2000).Google Scholar
- Michael Goedicke and Uwe Zdun. 2002. Piecemeal legacy migrating with an architectural pattern language: A case study. Journal of Software Maintenance and Evolution: Research and Practice 14, 1 (2002), 1--30.Google ScholarDigital Library
- Andrew Neitsch, Kenny Wong, and Michael W. Godfrey. 2012. Build system issues in multilanguage software. In Proceedings of the 2012 28th IEEE International Conference on Software Maintenance (ICSM). IEEE, 140--149.Google Scholar
- Gang Tan and Jason Croft. 2008. An empirical security study of the native code in the JDK. In Proceedings of the 17th Conference on Security Symposium (SS’08). USENIX Association, Berkeley, CA, 365--377.Google ScholarDigital Library
- Mouna Abidi, Manel Grichi, and Foutse Khomh. 2019. Behind the scenes: Developers’ perception of multi-language practices. In Proceedings of the 29th Annual International Conference on Computer Science and Software Engineering. IBM Corp., 72--81.Google Scholar
- Mouna Abidi, Foutse Khomh, and Yann-Gaël Guéhéneuc. 2019. Anti-patterns for multi-language systems. In Proceedings of the 24th European Conference on Pattern Languages of Programs. ACM, 42.Google ScholarDigital Library
- Mouna Abidi, Manel Grichi, Foutse Khomh, and Yann-Gaël Guéhéneuc. 2019. Code smells for multi-language systems. In Proceedings of the 24th European Conference on Pattern Languages of Programs. ACM, 12.Google ScholarDigital Library
- Federico Tomassetti and Marco Torchiano. 2014. An empirical assessment of polyglot-ism in github. In Proceedings of the 18th International Conference on Evaluation and Assessment in Software Engineering (EASE’14). ACM, New York, Article 17, 4 pages.Google ScholarDigital Library
- Rolf-Helge Pfeiffer and Andrzej Wąsowski. 2012. TexMo: A multi-language development environment. In Proceedings of the 8th European Conference on Modelling Foundations and Applications (ECMFA’12). Springer-Verlag, Berlin, 178--193.Google ScholarDigital Library
- Z. Mushtaq and G. Rasool. 2015. Multilingual source code analysis: State of the art and challenges. In Proceedings of the 2015 International Conference on Open Source Systems Technologies (ICOSST). 170--175.Google Scholar
- Sheng Liang. 1999. Java Native Interface: Programmer’s Guide and Reference (1st ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA.Google ScholarDigital Library
- John Hunt. 1999. Java for Practitioners: An Introduction and Reference to Java and Object Orientation (1st ed.). Springer-Verlag New York, Inc., Secaucus, NJ.Google Scholar
- Christopher Alexander, Sara Ishikawa, Murray Silverstein, Joaquim Romaguera i Ramió, Max Jacobson, and Ingrid Fiksdahl-King. 1977. A Pattern Language. Gustavo Gili.Google Scholar
- Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1995. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston, MA.Google ScholarDigital Library
- William H. Brown, Raphael C. Malveau, Hays W. McCormick, and Thomas J. Mowbray. 1998. AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis. John Wiley 8 Sons, Inc.Google ScholarDigital Library
- Martin Fowler and Kent Beck. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional.Google ScholarDigital Library
- Tushar Sharma and Diomidis Spinellis. 2018. A survey on software smells. Journal of Systems and Software 138 (2018), 158--173.Google ScholarCross Ref
- Min Zhang, Tracy Hall, and Nathan Baddoo. 2011. Code bad smells: A review of current knowledge. Journal of Software Maintenance and Evolution: Research and Practice 23, 3 (2011), 179--202.Google ScholarDigital Library
- Foutse Khomh, Massimiliano Di Penta, and Yann-Gael Gueheneuc. 2009. An exploratory study of the impact of code smells on software change-proneness. In Proceedings of the 16th Working Conference on Reverse Engineering, 2009 (WCRE’09). IEEE, 75--84.Google ScholarDigital Library
- Daniele Romano, Paulius Raila, Martin Pinzger, and Foutse Khomh. 2012. Analyzing the impact of antipatterns on change-proneness using fine-grained source code changes. In Proceedings of the 2012 19th Working Conference on Reverse Engineering (WCRE). IEEE, 437--446.Google ScholarDigital Library
- Zéphyrin Soh, Aiko Yamashita, Foutse Khomh, and Yann-Gaël Guéhéneuc. 2016. Do code smells impact the effort of different maintenance programming activities? In Proceedings of the 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), Vol. 1. IEEE, 393--402.Google ScholarCross Ref
- Aiko Yamashita and Leon Moonen. 2013. Do developers care about code smells? An exploratory survey. In Proceedings of the 2013 20th Working Conference on Reverse Engineering (WCRE). IEEE, 242--251.Google ScholarCross Ref
- Siliang Li and Gang Tan. 2009. Finding bugs in exceptional situations of JNI programs. In Proceedings of the 16th ACM Conference on Computer and Communications Security (CCS’09). ACM, New York, 442--452.Google ScholarDigital Library
- Goh Kondoh and Tamiya Onodera. 2008. Finding bugs in java native interface programs. In Proceedings of the 2008 International Symposium on Software Testing and Analysis (ISSTA’08). ACM, New York, 109--118.Google ScholarDigital Library
- Fred Long, Dhruv Mohindra, Robert C. Seacord, Dean F. Sutherland, and David Svoboda. 2013. Java Coding Guidelines: 75 Recommendations for Reliable and Secure Programs. Addison-Wesley.Google Scholar
- Martin Lippert and Stephen Roock. 2006. Refactoring in Large Software Projects: Performing Complex Restructurings Successfully. John Wiley 8 Sons.Google Scholar
- Francesca Arcelli Fontana, Pietro Braione, and Marco Zanoni. 2012. Automatic detection of bad smells in code: An experimental assessment.Journal of Object Technology 11, 2 (2012), 5--1.Google Scholar
- Foutse Khomh, Massimiliano Di Penta, Yann-Gaël Guéhéneuc, and Giuliano Antoniol. 2012. An exploratory study of the impact of antipatterns on class change-and fault-proneness. Empirical Software Engineering 17, 3 (2012), 243--275.Google ScholarDigital Library
- Naouel Moha, Yann-Gael Gueheneuc, Laurence Duchien, and Anne-Francoise Le Meur. 2009. Decor: A method for the specification and detection of code and design smells. IEEE Transactions on Software Engineering 36, 1 (2009), 20--36.Google ScholarDigital Library
- Amir Saboury, Pooya Musavi, Foutse Khomh, and Giulio Antoniol. 2017. An empirical study of code smells in javascript projects. In Proceedings of the 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 294--305.Google ScholarCross Ref
- Georg Gottlob, Christoph Koch, and Reinhard Pichler. 2005. Efficient algorithms for processing XPath queries. ACM Transactions on Database Systems (TODS) 30, 2 (2005), 444--491.Google ScholarDigital Library
- Davide Spadini, Maurício Aniche, and Alberto Bacchelli. 2018. Pydriller: Python framework for mining software repositories. In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. ACM, 908--911.Google ScholarDigital Library
- Jacek Śliwerski, Thomas Zimmermann, and Andreas Zeller. 2005. When do changes induce fixes? SIGSOFT Softw. Eng. Notes 30, 4 (May 2005), 1--5. DOI:http://dx.doi.org/10.1145/1082983.1083147Google ScholarDigital Library
- Audris Mockus and Lawrence G. Votta. 2000. Identifying reasons for software changes using historic databases. In Proceedings of ICSM. 120--130.Google Scholar
- Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Rocco Oliveto, and Andrea De Lucia. 2014. Do they really smell bad? A study on developers’ perception of bad code smells. In Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution. IEEE, 101--110.Google ScholarDigital Library
- Davide Spadini, Maurício Aniche, Margaret-Anne Storey, Magiel Bruntink, and Alberto Bacchelli. 2018. When testing meets code review: Why and how developers review tests. In Proceedings of the 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE). IEEE, 677--687.Google ScholarDigital Library
- Fabio Palomba, Annibale Panichella, Andy Zaidman, Rocco Oliveto, and Andrea De Lucia. 2017. The scent of a smell: An extensive comparison between textual and structural smells. IEEE Transactions on Software Engineering 44, 10 (2017), 977--1000.Google ScholarCross Ref
- David J. Sheskin. 2003. Handbook of Parametric and Nonparametric Statistical Procedures. Chapman and Hall/CRC.Google Scholar
- Tibor Gyimothy, Rudolf Ferenc, and Istvan Siket. 2005. Empirical validation of object-oriented metrics on open source software for fault prediction. IEEE Transactions on Software Engineering 31, 10 (2005), 897--910.Google ScholarDigital Library
- A. Güneş Koru, Khaled El Emam, Dongsong Zhang, Hongfang Liu, and Divya Mathew. 2008. Theory of relative defect proneness. Empirical Software Engineering 13, 5 (2008), 473.Google ScholarDigital Library
- Gehan M. K. Selim, Liliane Barbour, Weiyi Shang, Bram Adams, Ahmed E. Hassan, and Ying Zou. 2010. Studying the impact of clones on software defects. In Proceedings of the 2010 17th Working Conference on Reverse Engineering. IEEE, 13--21.Google ScholarDigital Library
- Baishakhi Ray, Daryl Posnett, Vladimir Filkov, and Premkumar Devanbu. 2014. A large scale study of programming languages and code quality in Github. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, 155--165.Google ScholarDigital Library
- Abhishek Sharma, Ferdian Thung, Pavneet Singh Kochhar, Agus Sulistya, and David Lo. 2017. Cataloging Github repositories. In Proceedings of the 21st International Conference on Evaluation and Assessment in Software Engineering. ACM, 314--319.Google ScholarDigital Library
- David Blei, Lawrence Carin, and David Dunson. 2010. Probabilistic topic models: A focus on graphical model design and applications to document and image analysis. IEEE Signal Processing Magazine 27, 6 (2010), 55.Google ScholarCross Ref
- Tse-Hsun Chen, Stephen W. Thomas, Meiyappan Nagappan, and Ahmed E. Hassan. 2012. Explaining software defects using topic models. In Proceedings of the 2012 9th IEEE Working Conference on Mining Software Repositories (MSR). IEEE, 189--198.Google Scholar
- Martin F. Porter. 2001. Snowball: A language for stemming algorithms. Online. Accessed 15 November, 2019.Google Scholar
- Michael L. Collard, Michael John Decker, and Jonathan I. Maletic. 2013. SRCML: An infrastructure for the exploration, analysis, and manipulation of source code: A tool demonstration. In Proceedings of the 2013 IEEE International Conference on Software Maintenance. IEEE, 516--519.Google Scholar
- Yann-Gaël Guéhéneuc and Giuliano Antoniol. 2008. Demima: A multilayered approach for design pattern identification. IEEE Transactions on Software Engineering 34 (2008), 667--684.Google ScholarDigital Library
- Fehmi Jaafar, Yann-Gaël Guéhéneuc, Sylvie Hamel, and Foutse Khomh. 2013. Mining the relationship between anti-patterns dependencies and fault-proneness. In Proceedings of the 2013 20th Working Conference on Reverse Engineering (WCRE). IEEE, 351--360.Google ScholarCross Ref
- Gang Tan, Srimat Chakradhar, Raghunathan Srivaths, and Ravi Daniel Wang. 2006. Safe java native interface. In Proceedings of the 2006 IEEE International Symposium on Secure Software Engineering. IEEE, 97--106.Google Scholar
- Robert K. Yin. 2002. Applications of Case Study Research Second Edition (Applied Social Research Methods Series Volume 34). Sage Publications, Inc.Google Scholar
- Sarim Zafar, Muhammad Zubair Malik, and Gursimran Singh Walia. 2019. Towards standardizing and improving classification of bug-fix commits. In Proceedings of the 2019 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM). IEEE, 1--6.Google ScholarCross Ref
- Marco Castelluccio, Le An, and Foutse Khomh. 2019. An empirical study of patch uplift in rapid release development pipelines. Empirical Software Engineering 24, 5 (2019), 3008--3044. DOI:http://dx.doi.org/10.1007/s10664-018-9665-yGoogle ScholarCross Ref
- Gema Rodríguez-Pérez, Andy Zaidman, Alexander Serebrenik, Gregorio Robles, and Jesús M. González-Barahona. 2018. What if a bug has a different origin? Making sense of bugs without an explicit bug introducing change. In Proceedings of the 12th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement. 1--4.Google Scholar
- Gema Rodríguez-Pérez, Gregorio Robles, and Jesús M. González-Barahona. 2018. Reproducibility and credibility in empirical software engineering: A case study based on a systematic literature review of the use of the SZZ algorithm. Information and Software Technology 99 (2018), 164--176.Google ScholarDigital Library
- E. C. Neto, D. A. d. Costa, and U. Kulesza. 2019. Revisiting and improving SZZ implementations. In Proceedings of the 2019 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM). 1--12.Google Scholar
- C. Treude and M. Wagner. 2019. Predicting good configurations for Github and stack overflow topic models. In Proceedings of the 2019 IEEE/ACM 16th International Conference on Mining Software Repositories (MSR). 84--95.Google Scholar
- Hamed Jelodar, Yongli Wang, Chi Yuan, Xia Feng, Xiahui Jiang, Yanchao Li, and Liang Zhao. 2019. Latent Dirichlet Allocation (LDA) and topic modeling: Models, applications, a survey. Multimedia Tools and Applications 78, 11 (2019), 15169--15211.Google ScholarDigital Library
- Panagiotis K. Linos. 1995. Polycare: A tool for re-engineering multi-language program integrations. In Proceedings of the 1st IEEE International Conference on Engineering of Complex Computer Systems (ICECCS’95). IEEE, 338--341.Google ScholarCross Ref
- Bernt Kullbach, Andreas Winter, Peter Dahm, and Jürgen Ebert. 1998. Program comprehension in multi-language systems. In Proceedings of the 5th Working Conference on Reverse Engineering, 1998. IEEE, 135--143.Google ScholarCross Ref
- Steffen Olbrich, Daniela S. Cruzes, Victor Basili, and Nico Zazworka. 2009. The evolution and impact of code smells: A case study of two open source systems. In Proceedings of the 2009 3rd International Symposium on Empirical Software Engineering and Measurement. IEEE Computer Society, 390--400.Google ScholarDigital Library
- Marwen Abbes, Foutse Khomh, Yann-Gael Gueheneuc, and Giuliano Antoniol. 2011. An empirical study of the impact of two antipatterns, blob and spaghetti code, on program comprehension. In Proceedings of the 2011 15th European Conference on Software Maintenance and Reengineering (CSMR). IEEE, 181--190.Google ScholarDigital Library
- Cristiano Politowski, Foutse Khomh, Simone Romano, Giuseppe Scanniello, Fabio Petrillo, Yann-Gaël Guéhéneuc, and Abdou Maiga. 2020. A large scale empirical study of the impact of spaghetti code and blob anti-patterns on program comprehension. Information and Software Technology 122 (2020), 106278. DOI:http://dx.doi.org/10.1016/j.infsof.2020.106278Google ScholarCross Ref
- Mario Linares-Vásquez, Sam Klock, Collin McMillan, Aminata Sabané, Denys Poshyvanyk, and Yann-Gaël Guéhéneuc. 2014. Domain matters: Bringing further evidence of the relationships among anti-patterns, application domains, and quality-related metrics in java mobile apps. In Proceedings of the 22nd International Conference on Program Comprehension. ACM, 232--243.Google ScholarDigital Library
- Eva Van Emden and Leon Moonen. 2002. Java quality assurance by detecting code smells. In Proceedings of the 9th Working Conference on Reverse Engineering, 2002. IEEE, 97--106.Google ScholarCross Ref
- Radu Marinescu. 2004. Detection strategies: Metrics-based rules for detecting design flaws. In Proceedings of the 20th IEEE International Conference on Software Maintenance, 2004. IEEE, 350--359.Google ScholarDigital Library
- Michele Lanza and Radu Marinescu. 2007. Object-Oriented Metrics in Practice: Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems. Springer Science 8 Business Media.Google ScholarDigital Library
- Naouel Moha and Yann-Gaël Guéhéneuc. 2007. P TIDEJ and D ECOR: Identification of design patterns and design defects. In Companion to the 22nd ACM SIGPLAN Conference on Object-oriented Programming Systems and Applications. ACM, 868--869.Google Scholar
- Foutse Khomh, Stéphane Vaucher, Yann-Gaël Guéhéneuc, and Houari Sahraoui. 2009. A Bayesian approach for the detection of code and design smells. In Proceedings of the 9th International Conference on Quality Software, 2009 (QSIC’09). IEEE, 305--314.Google ScholarDigital Library
- Foutse Khomh, Stephane Vaucher, Yann-Gaël Guéhéneuc, and Houari Sahraoui. 2011. BDTEX: A GQM-based bayesian approach for the detection of antipatterns. Journal of Systems and Software 84, 4 (2011), 559--572.Google ScholarDigital Library
- Marouane Kessentini, Wael Kessentini, Houari Sahraoui, Mounir Boukadoum, and Ali Ouni. 2011. Design defects detection and correction by example. In Proceedings of the 2011 IEEE 19th International Conference on Program Comprehension (ICPC). IEEE, 81--90.Google ScholarDigital Library
- Ghulam Rasool and Zeeshan Arshad. 2017. A lightweight approach for detection of code smells. Arabian Journal for Science and Engineering 42, 2 (2017), 483--506.Google ScholarCross Ref
- Francesca Arcelli Fontana, Mika V. Mäntylä, Marco Zanoni, and Alessandro Marino. 2016. Comparing and experimenting machine learning techniques for code smell detection. Empirical Software Engineering 21, 3 (2016), 1143--1191.Google ScholarDigital Library
- Hui Liu, Zhifeng Xu, and Yanzhen Zou. 2018. Deep learning based feature envy detection. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering. 385--396.Google ScholarDigital Library
- Antoine Barbez, Foutse Khomh, and Yann-Gaël Guéhéneuc. 2020. A machine-learning based ensemble method for anti-patterns detection. Journal of Systems and Software 161 (2020), 110486.Google ScholarCross Ref
- F. Palomba, A. Panichella, A. De Lucia, R. Oliveto, and A. Zaidman. 2016. A textual-based technique for smell detection. In Proceedings of the 2016 IEEE 24th International Conference on Program Comprehension (ICPC). 1--10.Google Scholar
- Michael Goedicke, Gustaf Neumann, and Uwe Zdun. 2001. Message redirector. In Proceedings of the 6th European Conference on Pattern Languages of Programms (EuroPLoP’2001) (2001).Google Scholar
- Sheng Liang. 1999. The Java Native Interface: Programmer’s Guide and Specification. Addison-Wesley Professional.Google ScholarDigital Library
Index Terms
- Are Multi-Language Design Smells Fault-Prone? An Empirical Study
Recommendations
Code smells for multi-language systems
EuroPLop '19: Proceedings of the 24th European Conference on Pattern Languages of ProgramsSoftware quality becomes a necessity and no longer an advantage. In fact, with the advancement of technologies, companies must provide software with good quality. Many studies introduce the use of design patterns as improving software quality and ...
Automatic API Usage Scenario Documentation from Technical Q&A Sites
Continuous Special Section: AI and SEThe online technical Q&A site Stack Overflow (SO) is popular among developers to support their coding and diverse development needs. To address shortcomings in API official documentation resources, several research works have thus focused on augmenting ...
Developing Cost-Effective Blockchain-Powered Applications: A Case Study of the Gas Usage of Smart Contract Transactions in the Ethereum Blockchain Platform
Continuous Special Section: AI and SEEthereum is a blockchain platform that hosts and executes smart contracts. Executing a function of a smart contract burns a certain amount of gas units (a.k.a., gas usage). The total gas usage depends on how much computing power is necessary to carry out ...
Comments