Mining sequence of method calls

40 views
Skip to first unread message

otmarjr

unread,
Mar 15, 2017, 4:44:11 PM3/15/17
to Boa Language and Infrastructure User Forum
Hello folks !!

Currently I'm working in a project where I'd like to extract sequences of method calls for a given class from the source code. Could you please tell me if this is possible using Boa infrastructure ?  I'm mostly interested in Java projects using JDK's classes.

Best regards,
Otmar

Robert E Dyer

unread,
Mar 15, 2017, 4:46:46 PM3/15/17
to boa-...@googlegroups.com
Hi Otmar,

By ‘sequence of method calls’ I assume you mean on a per-method basis?  In other words, some method has some specific sequence (although with branching, it isnt actually a fixed sequence but rather a set of sequences/paths) of method calls?

If so, this is definitely possible!  You just want to have a visitor for the Method type, and then build a list of all seen Expression nodes that are calls.

- Robert

--
More information about Boa: http://boa.cs.iastate.edu/
---
You received this message because you are subscribed to the Google Groups "Boa Language and Infrastructure User Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boa-user+u...@googlegroups.com.
To post to this group, send email to boa-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

________________________________________________
Robert Dyer | Assistant Professor | Department of Computer Science
BGSU | rd...@bgsu.edu | 419.372.3469 | 244 Hayes | Bowling Green, OH

Want to mine ultra-large-scale software repositories with minimal initial
investment? Check out Boa! http://boa.cs.iastate.edu/

Rahman, Mohammad Masudur

unread,
Mar 15, 2017, 4:51:35 PM3/15/17
to boa-...@googlegroups.com

If you are looking for simple AST parser at the first step before diving into big repo, Javaparser is the right choice.

https://github.com/javaparser


--
Mohammad Masudur Rahman

PhD Student
Department of Computer Science
University of Saskatchewan, Canada
http://www.usask.ca/~masud.rahman/

From: boa-...@googlegroups.com <boa-...@googlegroups.com> on behalf of otmarjr <otm...@gmail.com>
Sent: Wednesday, March 15, 2017 2:44 PM
To: Boa Language and Infrastructure User Forum
Subject: [Boa Users] Mining sequence of method calls
 
--

otmarjr

unread,
Mar 16, 2017, 10:08:59 AM3/16/17
to Boa Language and Infrastructure User Forum
Hello Dr Dyer,

Thanks for taking your time to answer. In fact, I'd like to make just one restriction, which would be consider the possible sequences in a per-class basis. For example, given a variable in a class, I'd like to create the set of all possible sequences of method calls that can occur after executing public methods of the class under analysis. Hopefully, it would be possible to account for branches caused by if stataments or exception handling.

Kind regards,
Otmar


Em quarta-feira, 15 de março de 2017 17:46:46 UTC-3, Robert Dyer escreveu:
Hi Otmar,

By ‘sequence of method calls’ I assume you mean on a per-method basis?  In other words, some method has some specific sequence (although with branching, it isnt actually a fixed sequence but rather a set of sequences/paths) of method calls?

If so, this is definitely possible!  You just want to have a visitor for the Method type, and then build a list of all seen Expression nodes that are calls.

- Robert

On Mar 15, 2017, at 4:44 PM, otmarjr <otm...@gmail.com> wrote:

Hello folks !!

Currently I'm working in a project where I'd like to extract sequences of method calls for a given class from the source code. Could you please tell me if this is possible using Boa infrastructure ?  I'm mostly interested in Java projects using JDK's classes.

Best regards,
Otmar

--
More information about Boa: http://boa.cs.iastate.edu/
---
You received this message because you are subscribed to the Google Groups "Boa Language and Infrastructure User Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boa-user+u...@googlegroups.com.
To post to this group, send email to boa-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

________________________________________________
Robert Dyer | Assistant Professor | Department of Computer Science

otmarjr

unread,
Mar 16, 2017, 10:14:29 AM3/16/17
to Boa Language and Infrastructure User Forum, masud....@usask.ca
Hello Mohammad,

Glad to see that you've noticed I'll have some challenges in picking an algorithm to mine the classes! Could you please tell me if Java Parser could be integrated with Boa ? Could you please point me in the direction of any algorithm to derive the set of sequences of method calls, given the AST of a class ?

Best regards,
Otmar

Robert E Dyer

unread,
Mar 16, 2017, 10:32:19 AM3/16/17
to boa-...@googlegroups.com
Hi Otmar,

In that case, you probably want to still mine on a per-method basis.  Then you can compose each (public) method to build all possible sequences out of that.

- Robert
________________________________________________
BGSU | rd...@bgsu.edu | 419.372.3469 | 244 Hayes | Bowling Green, OH

otmarjr

unread,
Mar 16, 2017, 6:32:37 PM3/16/17
to Boa Language and Infrastructure User Forum
Hello Robert,

Ok, I'll give it a try with Boa. Glad to hear it supports such use cases.

Best regards,
Otmar
Reply all
Reply to author
Forward
0 new messages