Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

AF for Script Based Test Executive

Hello,

I attended the AF Hands-On session at NIWeek 2012, but just recently finally got around to revisiting the framework and applying it to a new project I am starting.  From my initial exposure to it, I am a huge fan, however, I'm wondering if because of that I may be trying to apply it to a project that may not be a fit for it and was hoping to get some feedback from the AF community.

So my current project started out as a basic test system in that the operator would select somewhere between 1 and 5 test 'tiers' that would be conducted (i.e they could decide to only conduct 1 tier, or conduct all 5 tiers).  So my initial design was to have a UI Actor that would allow operator to start/stop the test and display results of the individual steps inside the tiers.  And my plan was to create a Base Tier Actor and then the 5 specific Actor Tiers who would get launched (sequentially) by the UI Actor depending on what the operator selected.

As further discussions occurred with my internal customer, the requirement was introduced to have a script text file define the test steps for each Tier to provide more flexibility instead of each Tiers test steps being defined inside the actual code.  So then I decided, OK, now I'll just have one Tier Actor that will load the script file and since the test commands in the script file will be predefined, each script file command could correspond to a message in my Tier Actor, no problem.

However, the requirement that has me unsure on how to proceed is that the test script could have a 'loop' command in which a subset of commands in the file can be looped N number of times.  What I am envisioning is to have my Tier Actor, launch another instance of itself to process the commands that are to be looped, but I'm not sure if that would be overly complicated or not.  Specifically when passing down messages from the top level UI Actor that need to be processed in the loop command Tier Actor (grandchild of the UI Actor).  I suppose I could send a command back up to the UI Actor to have him launch the loop command Tier Actor as another option, but wanted to get input from the community on what I have put together thus far.

And yes, this application is probably screaming, Use TestStand!, but unfortunately, that is not an option currently.

thanks in advance,

Quintin

0 Kudos
Message 1 of 8
(5,824 Views)

I'm also working on a test system at the moment.  But though I'm using "actors" (not AF, but similar), I don't view test commands as messages to an actor.  A test script is a set of "test step" objects executed as a single message by an actor.  So there is no need to have recursive actors to handle "loops" in the test script. 

Message 2 of 8
(3,769 Views)

Is N always a constant number? If so, just send the "do this" command N times.

If it isn't a constant number but is instead some sort of condition that has to be tested, create a message that contains the instruction to perform and the boolean condition to evaluate. The Do.vi executes the appropriate command, evaluates the boolean condition and then *sends itself back to the actor through the Self queue* if the condition to stop isn't met.

(Reenqueue with High priority so that you stay ahead of any other commands that the controller may have sent down.)

Message 3 of 8
(3,769 Views)

drjdpowell wrote:

I'm also working on a test system at the moment.  But though I'm using "actors" (not AF, but similar), I don't view test commands as messages to an actor.  A test script is a set of "test step" objects executed as a single message by an actor.  So there is no need to have recursive actors to handle "loops" in the test script. 

I don't think he was building recursive actors... where you have 1 message with many instructions to perform, he has 1 message per instruction and was just trying to figure out how to have an instruction that means "repeat this instruction".

Note that there are lots of approaches -- the one I typed up just seemed like the easiest to grasp without getting into a lot of recursive definitions of "instruction" vs "set of instructions".

0 Kudos
Message 4 of 8
(3,769 Views)

Hi Quintin,

I had to do sth simliar in the absence of TestStand (which in the mean time is available at last )

What I did was first of all defining tests as classes. From my test desription file, I instantiated objects of the appropriate classes and put them into an array. This array was sent to my "Sequencer Actor" which just did a playback upon receiving the start command. Proceeding from one step (Test Object) to another is implemented by sending a command to itself with the index of the next step to be executed.... only very basic state logic is needed. The nice thing about it: the controller can send a high priority message to the sequencer to stop the sequence while running

Just as a thought....

Going back to the TestStand 2 course now

Oli

Message 5 of 8
(3,769 Views)

Thanks everyone for your replies.

I provide some additional info on my requirements, the looping section of my script could have multiple commands/test steps contained it, i.e.:

Loop 10

     command A

     command B

     command C

Loop End

Would loop commands A, B and C 10 times.

So the topic of recursively calling a new Tier Actor to process Commands A, B and C 10 times was actually a thought I had in mind, but I wasn't sure if there was a simpler way to handle that situation.  As well as the situation that AQ points out of conditionally executing A, B and C until a certain criteria has been met, but I think I need to gather more requirements from my customer to see if that would be need to be supported by my architecture or not.

So with that being the case, would recursively calling a new Tier Actor for a loop section make sense?  The only issue/annoyance would be duplicating messaging code for messages that are sent from the UI Actor that need to be processed by the lower Tier Actor (i.e. an Abort command).

0 Kudos
Message 6 of 8
(3,769 Views)

My earlier solution definitely does NOT make sense given the new requirements.

0 Kudos
Message 7 of 8
(3,769 Views)

If you can create a "what's the next step" method of whatever you use to define your test script, then you can do everything with one Test-Executing Actor.  That might be easier (or clearer) that having nested actor clones.

0 Kudos
Message 8 of 8
(3,769 Views)