Skip to main content
Log in

Mining Effective Temporal Specifications from Heterogeneous API Data

  • Regular Paper
  • Published:
Journal of Computer Science and Technology Aims and scope Submit manuscript

Abstract

Temporal specifications for Application Programming Interfaces (APIs) serve as an important basis for many defect detection tools. As these specifications are often not well documented, various approaches have been proposed to automatically mine specifications typically from API library source code or from API client programs. However, the library-based approaches take substantial computational resources and produce rather limited useful specifications, while the client-based approaches suffer from high false positive rates. To address the issues of existing approaches, we propose a novel specification mining approach, called MineHEAD, which exploits heterogeneous API data, including information from API client programs as well as API library source code and comments, to produce effective specifications for defect detection with low cost. In particular, MineHEAD first applies client-based specification mining to produce a collection of candidate specifications, and then exploits the related library source code and comments to identify and refine the real specifications from the candidates. Our evaluation results on nine open source projects show that MineHEAD produces effective specifications with average precision of 97.2%.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Weimer W, Necula G C. Mining temporal specifications for error detection. In Proc. the 11th Int. Conf. Tools and Algorithms for the Construction and Analysis of Systems, Edinburgh, UK, Apr. 4–8, 2005, pp.461–476.

  2. 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 Proc. the 18th ACM Symp. Operating Systems Principles, Banff, Canada, Oct. 21–24, 2001, pp.57–72.

  3. Yang J, Evans D, Bhardwaj D, Bhat T, Das M. Perracotta: Mining temporal API rules from imperfect traces. In Proc. the 28th Int. Conf. Software Engineering, Shanghai, China, May 20–28, 2006, pp.282–291.

  4. Goues C L, Weimer W. Specification mining with few false positives. In Proc. the 15th Int. Conf. Tools and Algorithms for the Construction and Analysis of Systems, York, UK, Mar. 22–29, 2009, pp.292–306.

  5. Thummalapenta S, Xie T. Alattin: Mining alternative patterns for detecting neglected conditions. In Proc. the 24th Int. Conf. Automated Software Engineering, Auckland, New Zealand, Nov. 16–20, 2009, pp.283–294.

  6. Gabel M, Su Z. Javert: Fully automatic mining of general temporal properties from dynamic traces. In Proc. the 16th Int. Symp. Foundations of Software Engineering, Atlanta, USA, Nov. 9–15, 2008, pp.339–349.

  7. Thummalapenta S, Xie T. Mining exception-handling rules as sequence association rules. In Proc. the 31st Int. Conf. Software Engineering, Vancouver, Canada, May 16–24, 2009, pp.496–506.

  8. Gabel M, Su Z. Symbolic mining of temporal specifications. In Proc. the 30th Int. Conf. Software Engineering, Leipzig, Germany, May 10–18, 2008, pp.51–60.

  9. Gabel M, Su Z. Online inference and enforcement of temporal properties. In Proc. the 32nd Int. Conf. Software Engineering, Cape Town, South Africa, May 1–8, 2010, pp.15–24.

  10. Whaley J, Martin M C, Lam M S. Automatic extraction of object-oriented component interfaces. In Proc. the 4th Int. Software Testing and Analysis Symp., Roma, Italy, Jul. 22–24, 2002, pp.218–228.

  11. Henzinger T A, Jhala R, Majumdar R. Permissive interfaces. In Proc. the 10th European Software Engineering Int. Symp. Foundations of Soft. Eng., Lisbon, Portugal, Sep. 5–9, 2005, pp.31-40.

  12. Li Z, Zhou Y. PR-Miner: Automatically extracting implicit programming rules and detecting violations in large software code. In Proc. the 10th European Software Engineering Conf. Held Jointly with 13th Int. Symp. Foundations of Soft. Eng., Lisbon, Portugal, Sept. 5–9, 2005, pp.306–315.

  13. Alur R, ̈Cerny P, Madhusudan P, Nam W. Synthesis of interface specifications for Java classes. In Proc. the 32nd Symp. Principles of Programming Languages, Long Beach, USA, Jan. 12–14, 2005, pp.98–109.

  14. Tan L, Yuan D, Krishna G, Zhou Y. /*iComment: Bugs or bad comments?*/. In Proc. the 21st Symp. Operating Systems Principles, Stevenson, USA, Oct. 14–17, 2007, pp.145–158.

  15. Zhong H, Zhang L, Xie T, Mei H. Inferring resource specifications from natural language API documentation. In Proc. the 24th Int. Conf. Automated Software Engineering, Auckland, New Zealand, Nov. 16–20, 2009, pp.307-318.

  16. Weka, http://www.cs.waikato.ac.nz/ml/weka/, August, 2011.

  17. Javadoc, http://java.sun.com/j2se/javadoc/inde-x.jsp, August, 2010.

  18. The Stanford Parser, http://nlp.stanford.edu/software/lex-parser.shtml, August, 2011.

  19. ASM, http://asm.ow2.org/, August, 2011.

  20. Ammons G, Bodik R, Larus J R. Mining Specifications. In Proc. the 29th Symp. Principles of Programming Languages, Portland, USA, Jan. 16–18, 2002, pp.4–16.

  21. Lorenzoli D, Mariani L, Pezzμe M. Automatic generation of software behavioral models. In Proc. the 30th Int. Conf. Software Engineering, Leipzig, Germany, May 10–18, 2008, pp.501–510.

  22. Lo D, Maoz S. Scenario-based and value-based specification mining: Better together. In Proc. the 25th Int. Conf. Automated Software Engineering, Antwerp, Belgium, Sept. 20–24, 2010, pp.387–396.

  23. Lo D, Mariani L, Pezzμe M. Automatic steering of behavioral model inference. In Proc. the 7th Joint Meeting of the European Software Engineering Conf. and the Symp. Foundations of Software Engineering, Amsterdam, the Netherlands, Aug. 24–28, 2009, pp.345–354.

  24. Lo D, Khoo S C, Liu C. Mining past-time temporal rules from execution traces. In Proc. the 6th Int. Workshop on Dynamic Analysis, Seattle, USA, Jul. 21,2008, pp.50–56.

  25. Lo D, Khoo S C, Liu C. Mining temporal rules for software maintenance. Journal of Software Maintenance and Evolution: Research and Practice, 2008, 20(4): 227–247.

    Article  Google Scholar 

  26. Lo D, Ramalingam G, Ranganath V P, Vaswani K. Mining quantified temporal rules: Formalism, algorithms, and evaluation. In Proc. the 16th Working Conf. on Reverse Engineering, Lille, France, Oct. 13–16, 2009, pp.62–71.

  27. Wasylkowski A, Zeller A. Mining temporal specifications from object usage. In Proc. the 24th Int. Conf. Automated Software Engineering, Auckland, New Zealand, Nov. 16–20, 2009, pp.295–306.

  28. Pradel M, Gross T R. Automatic generation of object usage specifications from large method traces. In Proc. the 24th Int. Conf. Automated Software Engineering, Auckland, New Zealand, Nov. 16–20, 2009, pp.371–382.

  29. Lee C, Chen F, Rosu G. Mining parametric specifications. In Proc. the 33rd Int. Conf. Software Engineering, Honolulu, USA, May 21–28, 2011, pp.591–600.

  30. Zhong H, Zhang L, Mei H. Early filtering of polluting method calls for mining temporal specifications. In Proc. the 15th Asia-Pacific Software Engineering Conf., Beijing, China, Dec. 3–5, 2008, pp.9–16.

  31. Lo D, Khoo S C. SMArTIC: Towards building an accurate, robust and scalable specification miner. In Proc. the 14th Int. Symp. Foundations of Software Engineering, Portland, USA, Nov. 5–11, 2006, pp.265–275.

  32. Dallmeier V, Knopp N, Mallon C, Hack S, Zeller A. Generating test cases for specification mining. In Proc. the 19th Int. Symp. Software Testing and Analysis, Trento, Italy, Jul. 12–16, 2010, pp.85–96.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Qian Wu.

Additional information

This work is supported by the National Basic Research 973 Program of China under Grant No. 2009CB320703, the Science Fund for Creative Research Groups of China under Grant No. 60821003.

Electronic Supplementary Material

Below is the link to the electronic supplementary material.

(PDF 89.5 kb)

Rights and permissions

Reprints and permissions

About this article

Cite this article

Wu, Q., Liang, GT., Wang, QX. et al. Mining Effective Temporal Specifications from Heterogeneous API Data. J. Comput. Sci. Technol. 26, 1061–1075 (2011). https://doi.org/10.1007/s11390-011-1201-0

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11390-011-1201-0

Keywords

Navigation