Abstract
Developers spend significant time and effort in maintaining software. In a maintenance task, developers sometimes have to simultaneously modify multiple program entities (i.e., classes, methods, and fields). We refer to such complex changes as multi-entity edits. It is challenging for developers to apply multi-entity edits consistently and completely. Existing tools provide limited support for such edits, mainly because the co-changed entities usually contain diverse program contexts and experience different changes. This paper introduces CMSuggester, an automatic approach that suggests complementary changes for multi-entity edits. Given a multi-entity edit that adds a field and modifies one or more methods to access the field, CMSuggester suggests other methods to co-change for the new field access. CMSuggester is inspired by our previous empirical study, which reveals that the methods co-changed to access a new field usually commonly access the same set of fields declared in the same class. By extracting the fields accessed by the given changed method(s), CMSuggester identifies and recommends any unchanged method that also accesses those fields.
Our evaluation shows that CMSuggester recommends changes for 279 out of 408 suggestion tasks. With the recommended methods, CMSuggester achieves 73% F-score on average, while the widely used tool ROSE achieves 48% F-score. In most cases, as shown in our evaluation results, CMSuggester are useful for developers, since it recommend complete and correct multi-entity edits.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Support of compaction strategy option for stress.java. https://github.com/apache/cassandra/commit/f06e1d63a2006aa95d36636c56561158c8758a3c
Apache Aries (2018). http://aries.apache.org
apache/cassandra (2018). https://github.com/apache/cassandra
apache/derby (2018). https://github.com/apache/derby
apache/mahout (2018). https://github.com/apache/mahout
DERBY-2201: Allow scalar functions to return LOBs (2018). https://github.com/apache/derby/commit/638f1b48afc27c094c7f34a6254778c1a4ad9608
DERBY-5162: Null out the wrapped Clob when resetting a SQLClob to NULL (2018). https://github.com/apache/derby/commit/e9737b6
Fix infinite loop when paging queries with IN (2018). https://github.com/apache/cassandra/commit/7c32ffb
MAHOUT-401: Use NamedVector in seq2sparse (2018). https://github.com/apache/mahout/commit/22d7d31
WALA (2018). http://wala.sourceforge.net/wiki/index.php/Main_Page
Christa, S., Madhusudhan, V., Suma, V., Rao, J.J.: Software maintenance: from the perspective of effort and cost requirement. In: Satapathy, S., Bhateja, V., Joshi, A. (eds.) Proceedings of the International Conference on Data Engineering and Communication Technology, vol. 469, pp. 759–768. Springer, Singapore (2017). https://doi.org/10.1007/978-981-10-1678-3_73
Gall, H., Hajek, K., Jazayeri, M.: Detection of logical coupling based on product release history. In: Proceedings of ICSM, pp. 190–198 (1998)
Gall, H., Jazayeri, M., Krajewski, J.: CVS release history data for detecting logical couplings. In: Proceedings of IWPSE, pp. 13–23 (2003)
Hassan, A.E., Holt, R.C.: Predicting change propagation in software systems. In: Proceedings of ICSM, pp. 284–293 (2004)
Herzig, K., Just, S., Zeller, A.: It’s not a bug, it’s a feature: how misclassification impacts bug prediction. In: Proceedings of ICSE, pp. 392–401 (2013)
Kim, D., Nam, J., Song, J., Kim, S.: Automatic patch generation learned from human-written patches. In: Proceedings of ICSE, pp. 802–811 (2013)
Kim, M., Notkin, D.: Discovering and representing systematic code changes. In: Proceedings of ICSE, pp. 309–319 (2009)
Le Goues, C., Nguyen, T., Forrest, S., Weimer, W.: Genprog: a generic method for automatic software repair. IEEE Trans. Softw. Eng. 38(1), 54 (2012)
Li, Z., Zhou, Y.: PR-Miner: automatically extracting implicit programming rules and detecting violations in large software code. In: Proceedings of ESEC/FSE, pp. 306–315 (2005)
Long, F., Amidon, P., Rinard, M.: Automatic inference of code transforms for patch generation. In: Proceedings of ESEC/FSE, pp. 727–739 (2017)
Long, F., Rinard, M.: Automatic patch generation by learning correct code. In: Proceedings of POPL, pp. 298–312 (2016)
Meng, N., Kim, M., McKinley, K.: LASE: locating and applying systematic edits. In: Proceedings of ICSE, pp. 502–511 (2013)
Nguyen, T.T., Nguyen, H.A., Pham, N.H., Al-Kofahi, J.M., Nguyen, T.N.: Clone-aware configuration management. In: Proceedings of ASE, pp. 123–134 (2009)
Park, J., Kim, M., Ray, B., Bae, D.H.: An empirical study of supplementary bug fixes. In: Proceedings of MSR, pp. 40–49 (2012)
Rumbaugh, J., Blaha, M., Premerlani, W., Eddy, F., Lorensen, W.: Object-Oriented Modeling and Design. Prentice-Hall Inc., Upper Saddle River (1991)
Shirabad, J.S., Lethbridge, T.C., Matwin, S.: Mining the maintenance history of a legacy software system. In: Proceedings of ICSM, pp. 95–104 (2003)
Tan, M.: Online defect prediction for imbalanced data. Master’s thesis, University of Waterloo (2015)
Wang, Y., Meng, N., Zhong, H.: An empirical study of multi-entity changes in real bug fixes. In: Proceedings of ICSME (2018)
Yin, Z., Yuan, D., Zhou, Y., Pasupathy, S., Bairavasundaram, L.: How do fixes become bugs? In: Proceedings of ESEC/FSE, pp. 26–36 (2011)
Ying, A.T.T., Murphy, G.C., Ng, R.T., Chu-Carroll, M.: Predicting source code changes by mining change history. IEEE Trans. Softw. Eng. 30(9), 574–586 (2004)
Zhong, H., Mei, H.: Mining repair model for exception-related bug. J. Syst. Softw. 141, 16–31 (2018)
Zhong, H., Su, Z.: An empirical study on real bug fixes. In: Proceedings of ICSE, pp. 913–923 (2015)
Zimmermann, T., Weisgerber, P., Diehl, S., Zeller, A.: Mining version histories to guide software changes. In: Proceedings of ICSE, pp. 563–572 (2004)
Acknowledgment
We thank anonymous reviewers for their valuable comments on our earlier version of the paper. This work was supported by NSF Grant CCF-1565827, National Basic Research Program of China (973 Program) No. 2015CB352203, the National Nature Science Foundation of China No. 61572313, and the grant of Science and Technology Commission of Shanghai Municipality No. 15DZ1100305.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Wang, Y., Meng, N., Zhong, H. (2018). CMSuggester: Method Change Suggestion to Complement Multi-entity Edits. In: Bu, L., Xiong, Y. (eds) Software Analysis, Testing, and Evolution. SATE 2018. Lecture Notes in Computer Science(), vol 11293. Springer, Cham. https://doi.org/10.1007/978-3-030-04272-1_9
Download citation
DOI: https://doi.org/10.1007/978-3-030-04272-1_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-04271-4
Online ISBN: 978-3-030-04272-1
eBook Packages: Computer ScienceComputer Science (R0)