[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] Need help to collect completion proposals made by code recommenders programetically

Hi Marcel,
Good day. I am happy to inform you that I have successfully created code completion queries and collect the results for a few source files without any exception/problem. I have used AstDefUseFinder class and write some other codes to complete the task. I will conduct my experiment now on a large system now. Can you please take a look on the following questions:
i) Even if I configure that I need 5 completion proposals, the number of recommendations is frequently less
 than five. Is there any design decision behind this?. My guess is that for the other recommendations the relevance value is less than the threshold. Am I correct?

ii) Right now I am using a model available in this file: jre-1.0.0-call.zip. My understanding is that this model helps to calculate method call for jdk (like swing or awt). I want to use eclipse as a subject system where I plan to consider method calls to SWT. How can I obtain the corresponding model?. Can you please help me in this regard.

I will share  my code and results with you, but I need a few days more to restructure the code and collect the complete results. Please let me know your comments/suggestion.
Thank you again for your kind help and support.


-Muhammad Asaduzzaman
 


On Fri, Oct 4, 2013 at 2:12 AM, Marcel Bruch <marcel.bruch@xxxxxxxxxxxxxx> wrote:
Hi Muhammad,


Am 04.10.2013 um 09:45 schrieb Muhammad Asaduzzaman <parvez.usask@xxxxxxxxx>:

> Hi Marcel,
> Good day. I am very close to collect all the required information to
> make a query.

great.

> Just a question regarding overriding context. I have
> found that objectUsage query object takes two parameters
> (overrideFirst and overrideSuper).

You are working on 1.0 code, do you?

> I am using an example here. Lets
> say I have created a class that is inherited  from javax.swing.JFrame
> and override the method createRootPane(). The top most declaration of
> this method is in JFrame  and I use the information for overrideFirst
> . Lets say that I override another method getCursorType. Since the
> method comes from java.awt.frame (jframe override the method), so that
> should be the correct location for creating overrideFirst. Right?

Right. The naming in 1.0 is a bit unpleasant. "first" means first - or topmost - declaration in the inheritance hierarchy. "super" is the closest overridden declaration.

>
> Is it the case that for overridesuper I should use the method
> declaration in JFrame for the second example. Am I missing something?
> Please let me know.


Not sure I get you right but I believe yes.

To suggest method *calls*, we take into account the root/first method as overrides information. For recommending which methods to override we only look at the super methods. It doesn't make sense to use root/first methods here.

I hope that helps. Please let me know if you have further questions.

Best,
Marcel

> Thanks again for your help and support throughout the time. I will
> share the result and code with you when I finish the code and complete
> data collection.
>
> -Muhammad Asaduzzaman
>
>
> On Wed, Aug 7, 2013 at 2:47 PM, Marcel Bruch
> <marcel.bruch@xxxxxxxxxxxxxx> wrote:
>> Sounds reasonable. A few more words on what code recommenders (at eclipse.org) does:
>>
>>> Can I create an appropriate query for each method call?
>>
>> Sure,  it depends on what you want to test but it's generally possible. For its recommendations it considers the following information:
>>
>> The information how a variable was defined (by method_return, by new, by a field, as method parameter).
>> If possible the name of the method that defined the object (in the case of method return, new, or parameter).
>> The methods that were already invoked on the object
>> And last what we call the override context, i.e., when code completion is triggered in an overridden method we use the topmost declaration of the overridden method to refine the recommendations ("how to use a text widget differs whether you are in Dialog.open or Dialog.close).
>>
>> If you want to evaluate what recommendations it returns after you created the text widget, simply "observe" the definitionKind=NEW, the definingMethod=new Text(…) and ask the ICallModel for it's recommendations by calling m.recommendCalls(). If you want how recommendations change after setText is observed simply call m.setCalled(setText()) (disclaimer: something along these lines ;-)) Check the documentation of ICallModel for details.
>>
>> When you get to an evaluation, feel free to share the results and the evaluation code with me so I can ensure that the API is used correctly. There are one or two et undocumented specialties in the code that clients should be aware of :-)
>>
>>
>> Please note:
>> Code Recommender models *heavily* use clustering to create reasonable sized models. This makes them difficult to compare with other approaches or the results in the research paper published 4 years ago. We accept a loss in quality for better performance and especially reasonable low memory consumption for industrial use.
>>
>> Hope this helps,
>> Marcel
>>
>>
>>
>>
>> On Aug 7, 2013, at 8:54 PM, Muhammad Asaduzzaman <parvez.usask@xxxxxxxxx> wrote:
>>
>>> Hi Marcel,
>>> Thanks again. To explain what I want to do and make sure I am doing
>>> that correctly here is a simple scenario.
>>>
>>> Class A{
>>>      public A(){
>>>      Text T=new Text();
>>>      T.setText();
>>>      T.setLayout();
>>>      }
>>>
>>> }
>>>
>>> Lets say a file A.java contain a class and there are two method calls
>>> in there (T.setText and T.setLayout()). Lets say, I am in the position
>>> of first method call and I will determine what completion proposals
>>> are made by code recommender at that point and continue the steps with
>>> all other method calls. (for now, I will only focus on the methods
>>> belongs to swt classes and ignore other method calls).
>>>
>>> Can I create an appropriate query for each method call? If its
>>> possible then I can use the recommender.computeRecommendations(query)
>>> to collect the completion proposals.
>>> After taking a look on the ObjectUsage class, It appears to me that it
>>> takes the following input:
>>> calls (list of method calls), definition, kind, overridesFirst,
>>> overridesSuper and type. If I can fill this information for each
>>> method calls then I can call the computeRecommendations(query)
>>> method.
>>>
>>> Sorry for my long mail. I try to explain what I am planning to do.
>>> Please correct me if I am wrong.
>>>
>>> After reading your paper (Learning from example to improve code
>>> completion systems), it appears to me that you also considered various
>>> statements before the target method call. Does Code Recommenders also
>>> considers them (like object creation.. )?
>>>
>>> Thanks again for your kind help and support. I will take a look on
>>> those classes.
>>>
>>> -Muhammad Asaduzzaman
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Aug 7, 2013 at 12:15 PM, Marcel Bruch
>>> <marcel.bruch@xxxxxxxxxxxxxx> wrote:
>>>> Great. Update to the latest version of master to get rid of the NPE.
>>>>
>>>>
>>>>> Now I need to create the right query and call
>>>>> the recommender.computeRecommendations(query) method.
>>>>
>>>> I'm not sure what you want to do, but please note that the ObjectUsage class and the method EclipseOrgCallRecommender are *solely for demo purpose*.
>>>>
>>>>
>>>> To make clear:
>>>> The API to look at is ICallModel. Forget about the rest if you want to learn *how* recommendations are computed and what information is considered when computing recommendations.
>>>>
>>>>
>>>>
>>>> If you are interested to learn where the inputs into ICallModel *in Eclipse* come from:
>>>> Have a look at org.eclipse.recommenders.internal.calls.rcp.CallCompletionSessionProcessor.java or org.eclipse.recommenders.internal.calls.rcp.CallsApidocProvider.handle(IJavaElement, String, String, JavaElementSelectionEvent, Composite). The show how clients of ICallModel look like.
>>>>
>>>>
>>>> Let me know if you need more information. I'll update the documentation accordingly.
>>>>
>>>> HTH
>>>> Marcel
>>>>
>>>>
>>>> _______________________________________________
>>>> recommenders-dev mailing list
>>>> recommenders-dev@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/recommenders-dev
>>> _______________________________________________
>>> recommenders-dev mailing list
>>> recommenders-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/recommenders-dev
>>
>> _______________________________________________
>> recommenders-dev mailing list
>> recommenders-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/recommenders-dev
> _______________________________________________
> recommenders-dev mailing list
> recommenders-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/recommenders-dev

_______________________________________________
recommenders-dev mailing list
recommenders-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/recommenders-dev