Abstract
Large scale programs usually imply many programming rules, which are missing from specification documents. However, if programmers violate these rules in the process of programming, they may introduce software defects. Mining programming rules for detecting defect is an effective way to alleviate this problem. However, previous works suffer from a large number of candidate rules and suspicious defects which need manual validation. This issue affects the applicability and scalability of these previously proposed approaches. This paper proposes a novel approach to detect defects based on programming rules mined from different versions of a project. Firstly, it mines function call sequence patterns from the version under analysis and a previous stable version; secondly, it filters useful function call sequence patterns based on the patterns contained in the previous version; thirdly, the programs are automatically checked against filtered patterns for detecting suspicious defects. Experiments are carried out on three open source projects varies from 12k to 142k LOC to evaluate the effectiveness of our proposed approach. The experiment results show that the approach can improve the efficiency of defect detection by reducing 55% suspicious defects for the three projects without comprising the defect detection capability.
This work is supported by the National Natural Science Foundation of China (Grant No. 61702041), and the Science and Technology Project of Beijing Municipal Education Commission (Grant No. KM201811232016).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Rapidminer: https://rapidminer.com/.
- 2.
Redis: https://redis.io/.
- 3.
Lua: http://www.lua.org/.
- 4.
Sqlite: https://www.sqlite.org/.
- 5.
10 Open Source Projects in C, https://my.oschina.net/zhoukuo/blog/335788.
References
Saied, M.A., Sahraoui, H., Dufour, B.: An observational study on API usage constraints and their documentation. In: 22nd IEEE International Conference on Software Analysis, Evolution and Reengineering, pp. 33–42 (2015)
Li, M., Huo, X.: Software defect mining based on semi-supervised learning. J. Data Acquis. Process. 31(1), 56–64 (2016). (in Chinese)
Li, Z., Wu, J., Li, M.: Study on key issues about API usage. J. Softw. 29(06), 1716–1738 (2018). (in Chinese)
Robillard, M.P., Bodden, E., Kawrykow, D., Mezini, M., Ratchford, T.: Automated API property inference techniques. IEEE Trans. Softw. Eng. 39(5), 613–637 (2013)
Li, Z., Zhou, Y.: PR-Miner: automatically extracting implicit programming rules and detecting violations in large software code. In: 10th European Software Engineering Conference Held Jointly with 13th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 306–315 (2005)
Legunsen, O., Hassan, W.U., Xu, X., Roşu, G., Marinov, D.: How good are the specs? A study of the bug-finding effectiveness of existing java API specifications. In: 31st IEEE/ACM International Conference on Automated Software Engineering, pp. 602–613 (2016)
Mei, H., Wang, Q.X., Zhang, L., Wang, J.: Software analysis: a road map. Chin. J. Comput. 32(9), 1697–1710 (2009). (in Chinese)
Young, M., Pezze, M.: Software Testing and Analysis: Process Principles and Techniques. Wiley, Hoboken (2005)
Srikant, R., Agrawal, R.: Mining sequential patterns: generalizations and performance improvements. In: Apers, P., Bouzeghoub, M., Gardarin, G. (eds.) EDBT 1996. LNCS, vol. 1057, pp. 1–17. Springer, Heidelberg (1996). https://doi.org/10.1007/BFb0014140
Agrawal, R., Srikant, R.: Mining sequential patterns. In: 11th IEEE International Conference on Data Engineering, pp. 3–14 (1995)
Cui, Z., Mu, Y., Zhang, Z., Wang, W.: Defects detection based on mining function call sequence patterns. Comput. Sci. (SATE 2016) 44(11), 226–231 (2017). (in Chinese)
Engler, D., Chen, D.Y., Hallem, S., Chou, A., Chelf, B.: Bugs as deviant behavior: a general approach to inferring errors in systems code. In: 8th ACM Symposium on Operating Systems Principles, pp. 57–72 (2001)
Liang, B, Bian, P., Zhang, Y., Shi, W., You, W., Cai, Y.: AntMiner: mining more bugs by reducing noise interference. In: 38th IEEE/ACM International Conference on Software Engineering, pp. 333–344 (2016)
Thummalapenta, S., Xie, T.: Alattin: mining alternative patterns for detecting neglected conditions. In: 24th IEEE/ACM International Conference on Automated Software Engineering, pp. 283–294 (2009)
Murali, V., Chaudhuri, S., Jermaine, C.: Bayesian specification learning for finding API usage errors. In: 11th ACM Joint Meeting on Foundations of Software Engineering, pp. 151–162 (2017)
Cui, Z., Chen, X., Mu, Y., Pan, M., Wang, R.: PSP-Finder: a defect detection method based on mining correlations from function call paths. Chin. J. Electron. 27(04), 776–782 (2018)
Kagdi, H., Collard, M.L., Maletic, J.I.: An approach to mining call-usage patterns with syntactic context. In: 22nd IEEE/ACM International Conference on Automated Software Engineering, pp. 457–460 (2007)
Yang, J., Evans, D., Bhardwaj, D., Bhat, T., Das, M.: Perracotta: mining temporal API rules from imperfect traces. In: 28th IEEE/ACM International Conference on Software Engineering, pp. 282–291 (2006)
Dallmeier, V., Lindig, C., Wasylkowski, A., Zeller, A.: Mining object behavior with ADABU. In: International Workshop on Dynamic Systems Analysis, pp. 17–24 (2006)
Pradel, M., Gross, T.R.: Automatic generation of object usage specifications from large method traces. In: 24th IEEE/ACM International Conference on Automated Software Engineering, pp. 371–382 (2009)
Zhong, H., Zhang, L., Mei, H.: Inferring specifications of object oriented APIs from API source code. In: 15th Asia-Pacific Software Engineering Conference, pp. 221–228 (2008)
Nguyen, T.T., Nguyen, H.A., Pham, N.H., Al-Kofahi, J.M., Nguyen T.N.: Graph-based mining of multiple object usage patterns. In: 7th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp. 383–392 (2009)
Wei, Y., Furia, C.A., Kazmin, N., Meyer, B.: Inferring better contracts. In: 33rd IEEE/ACM International Conference on Software Engineering, pp. 191–200 (2011)
Nguyen, H.A., Dyer, R., Nguyen, T.N., Rajan, H.: Mining preconditions of APIs in large-scale code corpus. In: 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 166–177 (2014)
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
Cui, Z., Chen, X., Mu, Y., Zhang, Z., Ma, X. (2018). Mining Function Call Sequence Patterns Across Different Versions of the Project for Defect Detection. 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_10
Download citation
DOI: https://doi.org/10.1007/978-3-030-04272-1_10
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)