Skip to main content

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

  • Conference paper
  • First Online:
Software Analysis, Testing, and Evolution (SATE 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 11293))

Included in the following conference series:

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).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Rapidminer: https://rapidminer.com/.

  2. 2.

    Redis: https://redis.io/.

  3. 3.

    Lua: http://www.lua.org/.

  4. 4.

    Sqlite: https://www.sqlite.org/.

  5. 5.

    10 Open Source Projects in C, https://my.oschina.net/zhoukuo/blog/335788.

References

  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. Li, M., Huo, X.: Software defect mining based on semi-supervised learning. J. Data Acquis. Process. 31(1), 56–64 (2016). (in Chinese)

    MathSciNet  Google Scholar 

  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. 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)

    Article  Google Scholar 

  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. 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. 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. Young, M., Pezze, M.: Software Testing and Analysis: Process Principles and Techniques. Wiley, Hoboken (2005)

    MATH  Google Scholar 

  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). https://doi.org/10.1007/BFb0014140

    Chapter  Google Scholar 

  10. Agrawal, R., Srikant, R.: Mining sequential patterns. In: 11th IEEE International Conference on Data Engineering, pp. 3–14 (1995)

    Google Scholar 

  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. 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. 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. 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. 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. 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)

    Article  Google Scholar 

  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. 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. 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. 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. 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. 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. 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. 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 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Zhanqi Cui .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics