1 / 9

Logging Utils (AS)

Logging Utils (AS). Provides a set of logging functions; call them to log something. Serialization delegates. logvent ( appSt,e ) // for deep logging : logFunEntrer (...) logFunExit (...) logLoopEnter (...). raw log (UTF8).

dutch
Download Presentation

Logging Utils (AS)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logging Utils (AS) • Provides a set of logging functions; call them to log something. Serialization delegates logvent(appSt,e) // for deep logging : logFunEntrer(...) logFunExit(...) logLoopEnter(...) raw log (UTF8)

  2. To log an object o, LogUtils relies on a “serialization scheme” • It works like this: • If o implements Serializable, then it has a method serializeSelf. • Else check delegates mapping, which is a map of this type: Class of o  (Object  void) • There is a separation between: • Specifying projection • Formatting (a function that given an object knows how to serialize it)

  3. Example of class implementing Serializable class Pair implements Serializable { public varfst : * ; public varsnd : * ; .... public function serializeSelf(s : Serializer) : void { s.beginObject(this,Object(MYTYPE)) ; s.storeField(Object(FST),fst) ; s.storeField(Object(SND),snd) ; s.endObject() ; } } a Serializer will take care for the formatting. this function specifies how to make the projection

  4. Example of serialization delegate function collectionSerializationDelegateFunction(c : Object, s : Serializer) : void { s.beginObject(c,COLL_TY_NAME) ; for each (var o:* in c) s.storeField("elem",o) ; s.endObject() ; }

  5. Automation framework • Listens to flash events, decide which ones are worth “recording”. • On a relevant event e, it will produce a “RECORD” event, that will in turn contain pointers to: • e (actually, something else representing it) • its parameters • its target (e.g. which button e interacts on). • Logging is attached simply by adding a handler to this RECORD event, and this handler will call “logEvent(...)” from LogUtils, passing to it: • the RECORD event itself (which in turn contain the above infos) • a projection of application state. Someone has to provide this projection function ---the logger cannot invent one on its own.

  6. Automation Delegates • To determine which events to monitor, the automation framework scans all GUI elements (called “Display Objects”) of the application. • It is also aware when at the runtime more DOs are added, or removed. • For each DO x, it checks a map of type: Class of x  AutomationDelegateIf a delegate exists, then x will be logged; the delegate specifies which events on x will be logged.

  7. Example of Automation Delegate class ClickableDelegate extends Delegate { public function ClickableDelegate(x:DisplayObject){ super(x) ; // this decides that only event CLICK will be recorded: x.addEventListener(CLICK, myHandler); } public function myHandler(ev:Event) { // this will dispatch RECORD-event: Automation.record(this, Command.create("click")); } // not needed for logging, used by replay (for test execution): public function click():void { object.dispatchEvent(new MouseEvent(CLICK,true,false)); } }

  8. FITTEST Integrated Test Environment (ITE) • Allows logging to turned on/off on users’ machines or SUT’s server • Collecting logs • Launching test suite on other machines Test machine Habbo server Player-1 playing Habbo FITTEST ITE Player-2 playing Habbo FITTEST agent

  9. launch Automation Delegates (input) Automation Framework SUT LogerSetup LogUtils Serialization Delegates (input) (define abs-function) (with ASIC instrumentation for deep logging) FITTEST Agent raw log file FITTEST ITE HasLog (compress, selection, export to XML, reduction (new)) Model inference etc XML log file

More Related