Outgoing steps with exactly the same label.
-
Thursday, January 05, 2012 8:50 PM
Received the following error:
Restriction of exploration: some kinds of composite behaviors (including test cases construct,
requirement coverage construct, etc.) won't work when inner behavior has any state which has outgoingsteps withexactly the same label. If so, try adjusting your model to avoid it and re-explore.I have a Rule that returns a type mapped to a SUT class.
[Rule] static ModelItemResults CreateItem(string key)
The Rule needs to behave Non-Deterministically via use of Choice.Some, but this causes construct test cases some problems...
Is there a way to change the label to represent the inner state of the class?
(Something like ModelItemResults#0 (True, True, False, False))
Or am I forced to modify the model?
Expanding on the question...
Previously, I was using out parameter for all of the rules. This is fine when there are 2 or 3 values. But as I expand my model to include all possible values, around 20, a class only makes sense.
In addition to the error mentioned above, I noticed that I have to add additional Rules for each Member of the class I wish to test. This was something automatically handled when using the "out" method...
From my novice point of view, it seems I'm forced to:
- Have extremely long method definitions
- Make helper methods for each value I want to tests in my return type
Is there another approach I’m missing?
P.S. Notice the typo's in the error message, copied the text straight from VisualStudio.
- Edited by J. Zumwalt Thursday, January 05, 2012 8:51 PM
- Edited by J. Zumwalt Thursday, January 05, 2012 8:52 PM
- Edited by J. Zumwalt Thursday, January 05, 2012 8:53 PM
- Edited by J. Zumwalt Thursday, January 05, 2012 8:54 PM
All Replies
-
Friday, January 06, 2012 9:28 AM
Hi J. Zumwalt,
Another approach could be replacing the class "ModelItemResults" by a struct or an immutable compound value.
Hope this can help.
-
Friday, January 06, 2012 3:40 PM
I tried making "ModelItemResults" both a struct, then a CompoundValue.
When exploring either, Spec Explorer crashes with:
FATAL ERROR: Exception of type 'Microsoft.Xrt.Instructions.MicroStepException' was thrown.
stacktrace:
at Microsoft.SpecExplorer.VS.SpecExplorerPackage.RecoverFromFatalError(Exception exception)
at Microsoft.SpecExplorer.RecoverFromFatalErrorEventObserver.HandleEvent(ExplorerEvent e)
at Microsoft.SpecExplorer.EventManager.HandleEvent(ExplorerEvent e)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
at System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(IMessage reqMsg)
at System.Runtime.Remoting.Lifetime.LeaseSink.SyncProcessMessage(IMessage msg)
at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)
at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args)
at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args)
at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args)
at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(IMessage reqMsg)
at System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(IMessage msg)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args)involved exception: Microsoft.Xrt.Instructions.MicroStepException: Exception of type 'Microsoft.Xrt.Instructions.MicroStepException' was thrown.
at Microsoft.Xrt.State.ActiveState.RaiseException(Term exception)
at Microsoft.Xrt.State.ActiveState.RaiseExplorationRuntimeException(String message)
at Microsoft.Xrt.State.ActiveState.<GetInstances>d__14.MoveNext()
at Microsoft.ActionMachines.DomainTemplate.Extent.Evaluate(IActiveState& state, Func`2 parameters, Func`2 typeSubs, Term target, Boolean expandInstances)
at Microsoft.ActionMachines.Cord.RuleMachineConstructProvider.RuleDescriptor.MakeDomainProvider(IActiveState& astate, HashSet`1 forTypes)
at Microsoft.ActionMachines.Cord.RuleMachineConstructProvider.RuleDescriptor.<Instantiate>d__21.MoveNext()
at Microsoft.ActionMachines.RuleMachine.ActivationControlState.<GetSteps>d__2a.MoveNext()
at Microsoft.ActionMachines.DeclarationMachine.DeclarationControl.<GetSteps>d__d.MoveNext()
at Microsoft.ActionMachines.ParallelMachine.ParallelControl.<GetCommonSteps>d__33.MoveNext()
at Microsoft.ActionMachines.ParallelMachine.ParallelControl.<GetSteps>d__12.MoveNext()
at Microsoft.ActionMachines.DeclarationMachine.DeclarationControl.<GetSteps>d__d.MoveNext()
at Microsoft.ActionMachines.Explorer.OpenState.MoveNext()
at Microsoft.ActionMachines.Explorer.OpenState..ctor(Nullable`1 incomingAction, MachineState state, OpenState previousState, Explorer explorer, Boolean isStart, Int32 pathBound)
at Microsoft.ActionMachines.Explorer.Explore(IMachine machine)
at Microsoft.SpecExplorer.ExploringOperator.Explore()
at Microsoft.SpecExplorer.RemoteExplorer.Explore(IMachine machine, IConfiguration config)
at Microsoft.SpecExplorer.RemoteExplorer.Work()Simply chaning ModelItemResults back to a normal class allows Spec Explorer to finish exploration.
Also, removing the Rule that returns the struct/Compound value from the .cord allows SE to finish.- Edited by J. Zumwalt Friday, January 06, 2012 3:49 PM
-
Friday, January 06, 2012 4:56 PM
Hi J. Zumwalt,
All I know is, that nested structs are a problem in newer Spec Explorer versions. Can you try to simplify the struct/compound value "ModelItemResults" and see if you can isolate the problem?
Have a nice weekend.
-
Monday, January 09, 2012 3:56 PM
At this time the struct only contains 3 primitives (int, bool, enum (0,1,2)). I haven't yet expanded it to the point mentioned above.
-
Monday, January 09, 2012 4:43 PM
Hi J.,
the srtuct and compount values replace the type-binding. So you should not use any type-binding in this approach. Can it be that you still have such a type-binding definition? If yes, please delete it.
- Marked As Answer by J. Zumwalt Monday, January 09, 2012 6:23 PM
-
Monday, January 09, 2012 6:24 PM
Using a struct and removing the TypeBinding has resolved the Error.
Thanks again for the help.

