Despite various debugging supports of the existing IDEs for programming errors and exceptions, software developers often look at web for working solutions or any up-to-date information. Traditional web search does not consider thecontext of the problems that they search solutions for, and thus it often does not help much in problem solving. In this paper, we propose a context-aware meta search tool, SurfClipse, that analyzes an encountered exception andits context in the IDE, and recommends not only suitable search queries but also relevant web pages for the exception (and its context). The tool collects results from three popular search engines and a programming Q & A site against the exception in the IDE, refines the results for relevance against the context of the exception, and then ranks them before recommendation. It provides two working modes--interactive and proactive to meet the versatile needs of the developers, and one can browse the result pages using a customized embedded browser provided by the tool.
Student Profile Sample - We help schools to connect the data they have, with ...
TOWARDS AN IDE-BASED CONTEXT-AWARE META SEARCH ENGINE FOR EXCEPTION RECOMMENDATION
1. TOWARDS A CONTEXT-AWARE META SEARCH
ENGINE FOR IDE-BASED RECOMMENDATION
ABOUT PROGRAMMING ERRORS &
EXCEPTIONS
Mohammad Masudur Rahman, Shamima Yeasmin, and
Chanchal K. Roy
Department of Computer Science
University of Saskatchewan
CSMR-18/WCRE-21 Software Evolution Week (SEW
2014), Antwerp, Belgium
5. EXCEPTION HANDLING: WEB SEARCH
Traditional web search
•No ties between IDE and web
browsers
•Does not consider problem-context
•Environment-switching is distracting
& Time consuming
•Often not much productive (trial &
error approach)
5
SoftwareResearchLab,UofS
6. IDE-BASED WEB SEARCH
About 80% effort on Software Maintenance,(Ponzanelli
et al, ICSE 2013)
Bug fixation– error and exception handling
Developers spend about 19% of time in web
search, (Brandt et al, SIGCHI, 2009)
o IDE-Based context-aware web search is the right
choice
6
SoftwareResearchLab,UofS
7. EXISTING RELATED WORKS
Rahman et al. (WCRE 2013)
ERA version of this paper
Outlines basic idea, limited experiments
Cordeiro et al. (RSSE 2012)
Based on StackOverflow data dump
Subject to the availability of the dump, not easily updatable
Uses limited context, only stack trace
Very limited experiments
Ponzanelli et al. (ICSE 2013)
Based on StackOverflow data dump
Uses limited context, only context-code
Not specialized for exception handling
7
SoftwareResearchLab,UofS
8. EXISTING RELATED WORKS
Poshyvanyk et al. (IWICSS 2007)
Integrates Google Desktop in the IDE
Not context-aware
Brandt et al. (SIGCHI 2010)
Integrates Google web search into IDE
Not context-aware
Focused on usability analysis
8
SoftwareResearchLab,UofS
10. THE KEY IDEA !! META SEARCH ENGINE
10
SoftwareResearchLab,UofS
11. PROPOSED IDE-BASED META SEARCH MODEL
Start
search
Results
Web page
11
SoftwareResearchLab,UofS
12. PROPOSED IDE-BASED META SEARCH
MODEL
Distinguished Features (5)
IDE-Based solution
Web search, search result and web browsing all from IDE
No context-switching needed
Meta search engine
Captures data from multiple search engines
Also applies custom ranking techniques
Context-Aware search
Uses stack traces information
Uses context-code (surroundings of exception locations)
Software As A Service (SAAS)
Search is provided as a web service, and can be leveraged by
an IDE. http://srlabg53-2.usask.ca/wssurfclipse/ 12
SoftwareResearchLab,UofS
13. PROPOSED IDE-BASED META SEARCH
MODEL
Two Working Modes
Proactive Mode
Auto-detects the occurrence of an exception
Initiates search for exception by client itself
Aligned with Cordeiro et al. (RSSE’ 2012) & Ponzanelli et al.
(ICSE 2013)
Interactive Mode
Developer starts search using context menu
Also facilitates keyword-based search
Aligned with traditional web search within the IDE
14. SEARCH QUERY GENERATION
Search Query required to collect results from the
Search Engine APIs and to develop the corpus.
Query generation
Uses stack trace and Context code
Collects 5 tokens of top-most degree of interests from
stack trace.
Collects 5 most frequently invoked methods in the
context-code.
Combined both token list to form the recommended
keywords for the context.
14
SoftwareResearchLab,UofS
15. RESULT RANKING ASPECTS (4)
Content-Relevance
Considers page title, body content against search query
Context-Relevance
Considers stack traces from webpage against target stack trace
Considers code snippets against context-code extracted from IDE
Link Popularity
Considers the Alexa & Compete site rank
Estimates a normalized score from those ranks
Search Engine Confidence
Heuristic measure of confidence for the result
Considers the frequency of occurrence
Considers the weight of each search engine
15
SoftwareResearchLab,UofS
16. PROPOSED METRICS & SCORES
Content Matching Score (Scms)
Cosine similarity based measurement
Stack trace Matching Score (Sstm)
Structural and lexical similarity measurement of stack
traces
Code context Matching Score (Sccx)
Code snippet similarity (code clones)
StackOverflow Vote Score (Sso)
Total votes for all posts in the SO result link
16
SoftwareResearchLab,UofS
17. PROPOSED METRICS & SCORES
Site Traffic Rank Score (Sstr)-- Alexa and Compete
Rank of each link
Search Engine weight (Ssew)---Relative reliability
or importance of each search engine. Experiments
with 75 programming queries against the search
engines.
Heuristic weights of the metrics are determined
through controlled experiments.
17
SoftwareResearchLab,UofS
18. EXPERIMENT OVERVIEW
75 Exceptions collected from Eclipse IDE
workspaces of grad-students of SR Lab, U of S,
and different online sources (StackOverflow,
pastebin)
Related to Eclipse plug-in framework and Java
Application Development
Solutions chosen from exhaustive web search with
cross validations by peers
Recommended results manually validated.
Results compared against existing approaches and
search engines.
18
SoftwareResearchLab,UofS
19. PERFORMANCE METRICS
Mean Precision (MP)
Recall (R)
Mean First False Positive Position (MFFP)
Mean Reciprocal Rank (MRR)
19
SoftwareResearchLab,UofS
21. RESULTS OF EXISTING APPROACHES
Recommender Metrics Top 10 Top 20 Top 30
Cordeiro et al.
(only stack traces)
MP
TEF
R
0.0202
15 (75)
20.00%
0.0128
18 (75)
24.00%
0.0085
18 (75)
24.00%
Proposed Method
(Proactive Mode)
MP
TEF
R
0.0886
51 (75)
68.00%
0.0529
55 (75)
73.33%
0.0380
56 (75)
74.66%
Ponzanelli et al.
(only context-code)
MP
TEF
R
0.0243
7 (37)
18.92%
0.0135
7 (37)
18.92%
0.0099
7 (37)
18.92%
Proposed Method
(Proactive Mode)
MP
TEF
R
0.1000
30 (37)
81.08%
0.0621
32 (37)
86.48%
0.0450
32 (37)
86.48%
[ MP = Mean Precision, R = Recall,
TEF= Total Exceptions Fixed]
21
SoftwareResearchLab,UofS
22. RESULTS OF SEARCH ENGINES
Search Engine Metrics Top 10 Top 20 Top 30
Google MP
TEF
R
0.1571
57 (75)
76.00%
0.0864
57 (75)
76.00%
0.0580
57 (75)
76.00%
Bing MP
TEF
R
0.1013
55 (75)
73.33%
0.0533
58 (75)
77.33%
0.0364
58 (75)
77.33%
Yahoo MP
TEF
R
0.0986
54 (75)
72.00%
0.0539
57 (75)
76.00%
0.0369
57 (75)
76.00%
StackOverflow
Search
MP
TEF
R
0.0226
14 (75)
18.66%
0.0140
17 (75)
22.66%
0.0097
17 (75)
22.66%
Proposed Method
(Interactive mode)
MP
TEF
R
0.1229
59 (75)
78.66%
0.0736
64 (75)
85.33%
0.0538
68 (75)
90.66%
22
SoftwareResearchLab,UofS
23. THREATS TO VALIDITY
Search not real time yet, generally takes about 20-
25 seconds per search. Multithreading used,
extensive parallel processing needed.
Search engines constantly evolving, same results
may not be produced at later time.
Experimented with common exceptions, which are
widely discussed and available in the web.
23
SoftwareResearchLab,UofS
24. LATEST UPDATES
More extensive experiments with 150 exceptions.
Achieved 92% accuracy.
Eclipse plugin release
(https://marketplace.eclipse.org/content/surfclipse)
Context-aware Keyword search with automatic
query completion feature.
Visual Studio 2012 Plugin under development.
Extensive User Study ongoing.
24
SoftwareResearchLab,UofS
27. REFERENCES
[1] M.M. Rahman, S.Y. Mukta, and C.K. Roy. An IDE-Based Context-Aware Meta
Search Engine. In Proc. WCRE, pages 467–471, 2013.
[2] J. Cordeiro, B. Antunes, and P. Gomes. Context-based Recommendation to
Support Problem Solving in Software Development. In Proc. RSSE, pages 85
–89, June 2012.
[3] L. Ponzanelli, A. Bacchelli, and M. Lanza. Seahawk: StackOverflow in the
IDE. In Proc. ICSE, pages 1295–1298, 2013.
[4] D. Poshyvanyk, M. Petrenko, and A. Marcus. Integrating COTS Search
Engines into Eclipse: Google Desktop Case Study. In Proc. IWICSS, pages
6–, 2007.
[5] J. Brandt, P. J. Guo, J. Lewenstein, M. Dontcheva, and S. R. Klemmer. Two
Studies of Opportunistic Programming: Interleaving Web Foraging, Learning,
and Writing Code. In Proc. SIGCHI, pages 1589–1598, 2009.
27
SoftwareResearchLab,UofS
28. SAMPLE STACK TRACE
28
SoftwareResearchLab,UofS
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at test.SockTest.main(SockTest.java:13)
29. SAMPLE CONTEXT CODE
29
SoftwareResearchLab,UofS
try {
Socket client = new Socket("localhost", 4321);
ObjectOutputStream out = new ObjectOutputStream(
client.getOutputStream());
out.flush();
ObjectInputStream in = new ObjectInputStream(
client.getInputStream());
System.out.println("Buffer size: " + client.getSendBufferSize());
for (int i = 0; i < 10; i++) {
if (i == 3) {
Thread.currentThread().interrupt();
System.out.println("Interrupted.");
}
out.writeObject("From Client: Hellow." + i);
out.flush();
System.out.println(in.readObject());
}
} catch (Exception e) {
e.printStackTrace();
}
30. SEARCH QUERY FOR CORPUS DEVELOPMENT
java.net.ConnectException Connection refused
connect currentThread
30
SoftwareResearchLab,UofS
32. SAMPLE STACK TRACE (2)
32
SoftwareResearchLab,UofS
java.lang.ClassNotFoundException: org.sqlite.JDBC
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at core.ANotherTest.main(ANotherTest.java:18)
33. CONTEXT CODE (2)
33
SoftwareResearchLab,UofS
try
{
//code for making connection with a sqlite database
Class.forName("org.sqlite.JDBC");
Connection connection=null;
connection=DriverManager.getConnection("jdbc:sqlite:"+"/"+"test.db");
Statement statement=connection.createStatement();
String create_query="create table History ( LinkID INTEGER primary
key, Title TEXT not null, LinkURL TEXT not null);";
boolean created=statement.execute(create_query);
System.out.println("Succeeded");
}catch(Exception exc){
exc.printStackTrace();
}
34. SEARCH QUERY FOR CORPUS DEVELOPMENT
java.lang.ClassNotFoundException
org.sqlite.JDBC db ClassLoader execute
34
SoftwareResearchLab,UofS
35. ITEMS USED FOR RELEVANCE CHECKING
35
SoftwareResearchLab,UofS
java.lang.ClassNotFoundException org.sqlite.JDBC
db ClassLoader execute
+
Sample Stack Trace
+
Sample Context Code
Hinweis der Redaktion
//introduce yourself
Here, I am going to present the paper titled as Towards a Context-Aware Meta Search Engine for IDE-Based Recommendation about Programming Errors and Exceptions.
Basically, here, we proposed an IDE-Based recommendation system that works like a meta search engine, that means, it captures results from multiple search engines against a search query, and then analyze them to produce a better and context-relevant result set.
A very common experience for software developers during software development and maintenance.
They often encounter exceptions during debugging and bug fixation.
IDE provides the possible source locations of the exception in the form of stack traces.
It also provides a little explanation of the exception (What technical problem did occur?)
However, the information is too trivial, and it is not often enough for complete fixation.
So, the developer jumps on web search.
But, wait what they really do?
They collect the error message from the stack trace.
However, to make a suitable & representative query, they need to analyze the stack traces and the executed codes in the editor.
That is a non-trivial task to accomplish and it requires experience, time and effort.
Anyway, the developer submits the query to the web search engines.
But from the developer perspectives, the traditional search is not a convenient one.
The traditional browser is completely detached from the IDE, therefore it does not consider the problem context at all
the developer has to take the responsibility to represent the problem context in terms of query which is not an easy task
the environment-switching between IDE and the web browser is distracting and time-consuming for the developer.
Study shows that developers spend a lot of time, its about 19% of their programming time for web search.
Here comes the IDE-based search engine, and it has to consider the problem context as a must.
There are some existing studies that try to address the issues of traditional web search.
However, they are basically based on StackOverflow, for example the second and third ones.
StackOverflow is a big source of information and recently it has 1.9 million users with 12 million posts;
However, we cannot ignore the whole web for information, and that is why our approach comes into play.
The rest two works basically tries to integrate Google desktop search and Google web search in the IDE;
However, we are interested to exploit multiple search engines to get more confident set of results for the developer.
The baseline idea is to leverage the existing resources for solving technical challenges in a smart way.
This is a simple test of the performance of individual search engine.
We used 3 popular search engines, and found that no individual engine alone returns the complete solution set.
This may be due to their search indices or ranking algorithms.
So, depending on a single one, for example, Google may not be a good idea.
So, the key IDEA is - Meta Search engine.
This is our proposed meta search model for IDE-based recommendation.
It has tow modules:
Client module (Eclipse plugin)
Server module (Web service)
Once the developer selects an exception from Error log or console view, the client module captures the error message, stack trace and the context code likely responsible for exception and sends to the computation (server) module.
Upon getting the search request, the computation module sends the error message to multiple search engines. We use Google, Bing, Yahoo and the StackOverflow API to collect results and use them to develop the corpus.
Once the corpus is developed, we apply our proposed metrics and algorithms to produce a result set that is relevant to the encountered exception.
Then the results are sent to the client in the IDE panel.
The developer can click each result and can browse page within their working environment.
So, basically, we are providing four interesting and essential things in this model.
A complete IDE-based web search solution
Meta search from within the IDE
Context-aware search
SAAS based search solution, that can be leveraged by any IDE of any platform.
The proposed model has two working modes–Proactive and Interactive.
We design two modes to provide different needs of the developers and to meet demands of different problem solving situations.
For example, the proactive mode provides recommendation without any effort. Once an exception occurs, the IDE detects the exception, develops the search query, collect other context details, and initiates the search. Once the results are available, the developer is notified of the results.
In case of interactive mode, the developer can choose an error or exception encountered within the IDE, and can start the search through context-menu command. The IDE is responsible to extract the exception details and collect the results from the server.
The model also provides a keyword-based interface where developer can perform keyword-based search. During keyword-based search, IDE also recommends a set of suitable keywords representing the current problem context (e.g., exception details).
The model generates query keywords for both working modes.
In case of proactive mode, the search query is directly used to collect results.
In case of interactive mode, the developer is allowed to choose search keywords from the recommended list.
We collect the 5 tokens of the top-most degree of interest (please check paper to see DOI) from stack trace, and 5 most frequently invoked methods from context code to develop the search query.
However, search engines has limitations in the length of keywords, therefore, in case of proactive mode, we did not get results for all query (query length issue), whereas in the interactive mode, we carefully choose the keywords (less keywords) from the same recommended list, and got better results.
This one of the major causes, the interactive mode provides better performance than proactive mode.
We consider four aspects for relevance ranking.
Content-relevance– We consider the page title and textual content of a resultant web page to estimate its content-relevance against the search query
Context-relevance– We extract the stack trace and code snippet found in the web page, and estimate its relevance against that of the encountered exception.
Link popularity– We use Alexa and compete statistics (popularity ranks) of a result link to estimate its relative popularity
Search Engine Confidence– How many search engines return a result and what is the weight of each engine?
These are the individual metrics we consider to estimate those four aspects of ranking
The metrics are grouped into different aspects for ranking.
All weights are normalized.
We consider the heuristic weights for the metrics through controlled iterations of experiments.
We started with some wise guesses, and then ran iterations to reach the best weights for each ranking aspect.
We conducted experiments with 75 exceptions related to Eclipse plugin development and Java Application development
We collected them from the workspace of the graduate students, and different online sources
We use these 4 performance metrics.
Metrics are generally borrowed from the field of recommendation system and Information retrieval.
The slide shows how different aspects of the ranking control the results.
We see that content-relevance alone is not enough. However, we estimate content-relevance in a more efficient way in our approach where we consider stack trace also, which the search engines cannot do.
Considering context in association with context is always helpful.
Moreover, we considers two more aspects, which provides more positive effects in the results.
Here we show the result comparison against two existing approaches.
The proactive mode of our model is aligned with these two methods by automatic search query generation without developer involvement.
In this mode, client searches with its generated query from the context (e.g., stack trace and context-code), and collects the results.
The first approach by Cordeiro et al which considers only stack traces, and depends on StackOverflow data dump, definitely cannot answer all questions. It provides a recall of 24%, whereas
Our proposed approach performs significantly well.
The second approach Seahawk, considers the context-code, not specialized for exception related search. Still it is relevant to our works. However, we found it suffers from the same lack of the work by Cordeiro et al
The interactive mode of our model is aligned with the working principles of search engines– search query generation with developer involvement.
In this mode, the client recommends suitable keywords from the context, and developer chooses from them for search.
We use the same set of keywords from the recommended list for both our approach and the search engines.
So, basically, the real comparison should be against the search engines which we did, and found these results.
All 3 search engines performed almost the same except with Google’s precision.
Our method provides a precision comparable to Google, but it outperforms all in terms of recall. It provides 90.66% recall, whereas the search
Engines provide 77.33% at best.
Recently, we tested with 150 exceptions, and found 92% recall, whereas the search engines performed nearly 80%
So, it also validates our previous experiment results.
We experienced these 3 threats to validity.
-search not real time yet
-search engines are constantly evolving, so has reproducibility issues
-experimented with widely available exceptions and bound by the limitations of provided results from search engines
These are the latest updates.
We also submitted this tool in ICSE 2014. The video shows the highlights of the tool.
So, that’s all about my talk. Thanks for your attention.
Questions ??