Mining Models of Object Behavior


partager des documents DOCUMENTS ASSOCIÉS

 

Mining Models of Object Behavior

 

Mining Models of Object Behavior Andrzej Wasylkowski, Saarland University (with Valentin Dallmeier and Nicolas Bettenburg) Advisors: Christian Lindig and Andreas Zeller The problem java.util.Vector boolean add(Object o) void clear() boolean isEmpty() Object remove(int index) boolean removeAll(Collection c) ? ? What is the effect of calling ?clear?? ? Can ?remove? be called at any time? How to use a class correctly? What do object behavior models look like? <init>() isEmpty() add() clear() remove() removeAll() add() remove() clear() isEmpty() Object behavior model for the java.util.Vector class How can we mine object behavior models? Instrumenting bytecode Identifying inspectors inspector methods Program User Running the program instrumented target class object behavior model target class target class other classes Identifying inspectors java.util.Vector boolean add(Object o) void clear() boolean isEmpty() Object remove(int index) boolean removeAll(Collection c) ? Identifying inspectors ? No parameters ? Is ?pure? ? Returns a value java.util.Vector boolean add(Object o) void clear() boolean isEmpty() Object remove(int index) boolean removeAll(Collection c) ? Identifying inspectors ? No parameters ? Is ?pure? ? Returns a value java.util.Vector boolean add(Object o) void clear() boolean isEmpty() Object remove(int index) boolean removeAll(Collection c) ? java.util.Vector boolean add(Object o) void clear() boolean isEmpty() Object remove(int index) boolean removeAll(Collection c) ? Identifying inspectors ? No parameters ? Is ?pure? ? Returns a value Instrumenting bytecode public class Vector { ? public void clear() { ? } ? } Instrumenting bytecode public class Vector { ? public void clear() { State entryState = new State(); entryState.addElement(?isEmpty()?, isEmpty()); ? } ? } Instrumenting bytecode public class Vector { ? public void clear() { State entryState = new State(); entryState.addElement(?isEmpty()?, isEmpty()); try { ? } finally { State exitState = new State(); exitState.addElement(?isEmpty()?, isEmpty()); } } ? } Instrumenting bytecode public class Vector { ? public void clear() { State entryState = new State(); entryState.addElement(?isEmpty()?, isEmpty()); try { ? } finally { State exitState = new State(); exitState.addElement(?isEmpty()?, isEmpty()); model.addTransition(entryState, exitState, ?clear()?); } } ? } How common are inspectors? 0% 25% 50% 75% 100% Inspector methods 7% 8% 17% 12% 21% 21% 34% 10% Checkstyle HTMLParser JSMSEngine JackSum Jalopy Lucene PMD ProGuard How common are classes with inspectors? 0% 25% 50% 75% 100% Classes with at least one inspector 37% 25% 50% 53% 64% 34% 78% 15% Checkstyle HTMLParser JSMSEngine JackSum Jalopy Lucene PMD ProGuard How common are classes with inspectors? 0% 25% 50% 75% 100% Classes with at least one inspector 37% 25% 50% 53% 64% 34% 78% 15% Checkstyle HTMLParser JSMSEngine JackSum Jalopy Lucene PMD ProGuard On average, 45% of a program?s classes contain at least one inspector Application: understanding behavior of a class org.eclipse.jdt.internal.compiler.impl.BooleanConstant <starting state> booleanValue = true stringValue : java.lang.String toString : java.lang.String typeID > 0 typeName : java.lang.String <init> booleanValue = false stringValue : java.lang.String toString : java.lang.String typeID > 0 typeName : java.lang.String <init> Application: understanding behavior of a class org.aspectj.asm.StructureModel <starting state> getFileMap = null getRoot = null isValid = false <init> getFileMap = null getRoot : org.aspectj.asm.ProgramElementNode isValid = false setRoot getFileMap : java.util.HashMap getRoot : org.aspectj.asm.ProgramElementNode isValid = true setFileMap Application: understanding behavior of a class org.columba.ristretto.imap.IMAPProtocol <starting state> selectedMailbox = null socket = null state = NOT_CONNECTED <init> selectedMailbox = null socket : java.net.Socket state = NOT_AUTHENTICATED openPort selectedMailbox = null socket : java.net.Socket state = AUTHENTICATED login status capability append selectedMailbox : java.lang.String socket : java.net.Socket state = SELECTED select logout create uidSearch select Other applications ? Checking behavior of objects with respect to models at runtime ? Finding possible model violations in a source code ? Suggesting method calls during development Future work: mining models statically public void foo (Data data) { data.startExtracting (); while (data.hasNext ()) process (data.next ()); data.endExtracting (); } hasNext() hasNext() startExtracting() startExtracting() endExtracting() next() next() Mining models statically: challenges ? How to recognize object?s state? while (a.foo () || b.bar ()) { // what is the state of a? ? How to merge models based on a control flow? public void foo (Data data) { ? foo (data); ? } ? How can we deal with possible aliases? Points-to analysis? a.foo (); b.bar (); ? Can we combine models mined statically with those mined dynamically? Conclusions

PARTAGER SUR

Envoyer le lien par email
1407
READS
2
DOWN
7
FOLLOW
2
EMBED
DOCUMENT # TAGS
#mining 

licence non indique


DOCUMENT # INDEX
Technologies, Informatique 
img

Partagé par  dude

 Suivre

Auteur:
Source:Non communique