Mining Function Call Sequence Patterns Across Different Versions of the Project for Defect Detection

  • Zhanqi CuiEmail author
  • Xiang Chen
  • Yongmin Mu
  • Zhihua Zhang
  • Xu Ma
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11293)


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.


Programming rules Version history Defect detection 


  1. 1.
    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)Google Scholar
  2. 2.
    Li, M., Huo, X.: Software defect mining based on semi-supervised learning. J. Data Acquis. Process. 31(1), 56–64 (2016). (in Chinese)MathSciNetGoogle Scholar
  3. 3.
    Li, Z., Wu, J., Li, M.: Study on key issues about API usage. J. Softw. 29(06), 1716–1738 (2018). (in Chinese)Google Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    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)Google Scholar
  6. 6.
    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)Google Scholar
  7. 7.
    Mei, H., Wang, Q.X., Zhang, L., Wang, J.: Software analysis: a road map. Chin. J. Comput. 32(9), 1697–1710 (2009). (in Chinese)Google Scholar
  8. 8.
    Young, M., Pezze, M.: Software Testing and Analysis: Process Principles and Techniques. Wiley, Hoboken (2005)zbMATHGoogle Scholar
  9. 9.
    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). Scholar
  10. 10.
    Agrawal, R., Srikant, R.: Mining sequential patterns. In: 11th IEEE International Conference on Data Engineering, pp. 3–14 (1995)Google Scholar
  11. 11.
    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)Google Scholar
  12. 12.
    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)Google Scholar
  13. 13.
    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)Google Scholar
  14. 14.
    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)Google Scholar
  15. 15.
    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)Google Scholar
  16. 16.
    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)CrossRefGoogle Scholar
  17. 17.
    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)Google Scholar
  18. 18.
    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)Google Scholar
  19. 19.
    Dallmeier, V., Lindig, C., Wasylkowski, A., Zeller, A.: Mining object behavior with ADABU. In: International Workshop on Dynamic Systems Analysis, pp. 17–24 (2006)Google Scholar
  20. 20.
    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)Google Scholar
  21. 21.
    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)Google Scholar
  22. 22.
    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)Google Scholar
  23. 23.
    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)Google Scholar
  24. 24.
    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)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  • Zhanqi Cui
    • 1
    Email author
  • Xiang Chen
    • 2
  • Yongmin Mu
    • 1
  • Zhihua Zhang
    • 1
  • Xu Ma
    • 1
  1. 1.Computer SchoolBeijing Information Science and Technology UniversityBeijingChina
  2. 2.School of Computer Science and TechnologyNantong UniversityNantongChina

Personalised recommendations