Abstract
The introduction of question–answering services, such as Stack Overflow, has given rise to a new problem-solving paradigm in software development. Using these services, developers can post their programming questions online and get useful solutions by the community. In this chapter we propose a methodology that allows searching for solutions in Stack Overflow, using the main elements of a question post, including its title, tags, body, and source code snippets. We design a similarity scheme for these elements that can be used for finding similar question posts. Text elements are compared using Information Retrieval metrics, while snippet similarity is computed by first converting snippets into sequences using a representation that extracts structural information. The results of the evaluation of our methodology indicate that it can be effective for recommending similar question posts, and thus can be used to search for solutions without fully forming a question.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Although our methodology is mostly language-agnostic, we have focused on Java Stack Overflow questions to demonstrate our proof of concept.
- 2.
Our methodology supports all questions, regardless of the number of links. However, in the context of our evaluation, we may assume that questions with fewer links may be too localized and/or may not have similar question posts.
References
Diamantopoulos T, Symeonidis A (2015) Employing source code information to improve question-answering in stack overflow. In: Proceedings of the 12th Working Conference on Mining Software Repositories, MSR ’15. IEEE Press, Piscataway, NJ, USA, pp 454–457
Ying ATT (2015) Mining challenge 2015: comparing and combining different information sources on the stack overflow data set. In: The 12th Working Conference on Mining Software Repositories, page to appear
Elasticsearch: RESTful, Distributed Search & Analytics. https://www.elastic.co/products/elasticsearch, 2016. [Retrieved: April 2016]
Holmes R, Murphy GC (2005) Using structural context to recommend source code examples. In: Proceedings of the 27th International Conference on Software Engineering, ICSE ’05. ACM, New York, NY, USA, pp 117–125
Thummalapenta S, **e T (2007) PARSEWeb: A Programmer Assistant for Reusing Open Source Code on the Web. In: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software Engineering, ASE ’07. ACM, New York, NY, USA, pp 204–213
Sahavechaphan N, Claypool K (2006) XSnippet: mining for sample code. SIGPLAN Not 41(10):413–430
Subramanian S, Holmes R (2013) Making sense of online code snippets. In: Proceedings of the 2013 10th IEEE Working Conference on Mining Software Repositories (MSR). pp 85–88
Subramanian S, Inozemtseva L, Holmes R (2014) Live API documentation. In: Proceedings of the 36th International Conference on Software Engineering, ICSE 2014. ACM, New York, NY, USA,pp 643–652
Ponzanelli L, Bavota G, Di Penta M, Oliveto R, Lanza M (2014) Mining stackoverflow to turn the IDE into a self-confident programming prompter. In: Proceedings of the 11th Working Conference on Mining Software Repositories, MSR 2014. ACM, New York, NY, USA, pp 102–111
Hsu SK, Lin SJ (2011) MACs: mining API code snippets for code reuse. Expert Syst Appl 38(6):7291–7301
Cormen TH, Leiserson CE, Rivest RL, Stein C (2009) Introduction to algorithms, 3rd edn. The MIT Press, pp 390–396
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Diamantopoulos, T., Symeonidis, A.L. (2020). Mining Solutions for Extended Snippet Reuse. In: Mining Software Engineering Data for Software Reuse. Advanced Information and Knowledge Processing. Springer, Cham. https://doi.org/10.1007/978-3-030-30106-4_8
Download citation
DOI: https://doi.org/10.1007/978-3-030-30106-4_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-30105-7
Online ISBN: 978-3-030-30106-4
eBook Packages: Computer ScienceComputer Science (R0)