02.04.2013 Views

CONTENTS

CONTENTS

CONTENTS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

REVERSE ENGINEERING AND SIMULATION OF ACTIVE OBJECTS BEHAVIOR 241<br />

Step 6. Comparison, re-analysis, re-design... This step is important for verification<br />

and testing of software conformance to specification, analysis and design models.<br />

3. A case study<br />

ActiveCASE is a tool developed for designing, implementing and simulating active<br />

objects behavior in concurrent object oriented applications [5]. We have extended it<br />

to offer support for first 4 steps of the process of generating statecharts.<br />

In order to illustrate how FSMs are generated in ActiveCASE we will use the same<br />

motivating example used in [5]: traffic simulation in a matrix of tracks. The goal is<br />

to generate the corresponding FSMs for Car class using ActiveCASE components.<br />

According to step 0, a statechart is defined for Car class, as described in [5].<br />

The code instrumentation (step 1) has been done manually. First of all, the ActiveObject<br />

class was enriched with two specific methods: GetCurrentStateToString()<br />

and GenerateCurrentState(). First method returns a string with information regarding<br />

the current state, whith the following configuration: [Class: < ClassName ><br />

; Object :< ObjectIdentity >; Method :< MethodName >; attr1; ... attrn], where<br />

attr1; ...attrn is a list of actual attribute values. Each subclass of ActiveObject class<br />

should rewrite this function in order to add its own specific attribute values. The<br />

second method,GenerateCurrentString(), saves the current state in a log file on disk<br />

or, if the simulation is activated, sends the state strings to the simulator component.<br />

Figure 2. FSMs generated for ”Red Car” and ”Blue Car” objects<br />

Figure 2 shows two FSMs generated for two Car objects (called ”Blue Car” and<br />

”Red Car”). For generating these FSMs, only three Car methods were instrumented:<br />

the constructor, Halt and Go methods.<br />

The analysis of the result reveals the fact that the FSMs are not complete, each<br />

one having a state that was not generated for the other (state ”Stopped; Down;” in<br />

”Red Car” FSM, and state ”Stopped; Left;” generated for ”Blue Car” FSM).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!