Answered by:
Object value 'newValue' is symbolic and cannot be converted to a fixed value

Question
-
Looking for some insight on this error:
Description Block(Block(ExplorationRuntimeException#0: "Object value 'newValue' is symbolic and cannot be converted to a fixed value Stack trace: ....
If the model is needed, I will try to provide a simple one to recreate the issue.Tuesday, December 29, 2009 7:08 PM
Answers
-
Hi Anne,
Yes, the Arguments property contains the arguments (parameter values) to the action. Parameter names are in the ActionSymbol property of an ActionInvocation. Its Member property will be set in your case to a SerializableMethodBase, whose Parameters property is an array of SerializableParameterInfo objects, each with a Name property.
Best,
Nico- Marked as answer by Nico KicillofModerator Tuesday, January 26, 2010 1:58 AM
Tuesday, January 26, 2010 1:58 AMModerator
All replies
-
Hi Anne,
This problem usually happens if you call a .Net library function on a rule parameter for which Spec Explorer does not know how to generate a concrete value. This problem only occurs if the library function is not implemented in the intermediate language (bytecode) of .Net, but natively. A typical example for this is string concatenation (+).
What is the background? Spec Explorer actually executes model rules symbolically. The parameters of a rule are not really assigned concrete values during rule execution, but they remain abstract symbolic values. Spec Explorer computes all the possible branches the rule execution can take based on that symbolic parameters. Only after the symbolic execution ends, Spec Explorer generates all concrete parameter combinations. This way, it is avoided that the same rule is executed many times again for each parameter set. As eventually parameters are expanded, this kind of symbolic execution happens under the hood (note that the often cited 'symbolic exploration', a potential future feature, is different in that expansion what not happen at all or not before full exploration ends).
This symbolic execution works well unless you call into a native library function. In that moment, Spec Explorer needs to convert the symbolic parameter value into a concrete value. For that it needs to now from which domain to draw concrete values. If it doesn't, mentioned error is raised.
If this info doesn't immediate help you to fix the problem, please just share the rule method in which 'newValue' appears.
Thanks,
WolfgangWednesday, December 30, 2009 5:44 AMModerator -
Wolfgang,
Thanks for the explanation. The background is as follows:
Toward the goal of having access to the state of the system using the Spec Explorer Object model, I was trying to gather some details about the system state using several Probes. I am interested in gathering:
1. Overall System State2. State which changed as a result of previous transition
3. Requirements covered as a result of previous transition
For #2, I am trying to use string concatenation to note which fields in the system state have changed. For example, say there is an action called setX(string newValue) which sets some state varaible x = newValue. I want to note that the state has been updated – e.g. stateChanged = “x was changed to: “ + newValue. String concatenation is clearly the issue here. Is there any way around this?
Another methodology for accomplishing what I want to do is using the State Checker pattern, and passing 1,2, and 3 above as parameters. Is there any way to access the parameters for an action programmatically via the Object Model? I see the Transition’s Action.Text property – I could always parse this string, but would like to avoid it.
Thanks again,
Anne
Wednesday, December 30, 2009 6:40 PM -
Anne,
Actually if this happens in a state probe, you may have run into a bug. If you have a repro which you can share at this point, could you please send to me or to the support alias?
For now you could work around using the state checker pattern. Yes, you can perfectly access the parameters of an action via the object model. There should be an array of arguments with each action invocation.
Thanks,
Wolfgang- Proposed as answer by Nico KicillofModerator Tuesday, January 5, 2010 12:41 AM
- Unproposed as answer by Nico KicillofModerator Tuesday, January 5, 2010 12:41 AM
Friday, January 1, 2010 1:23 AMModerator -
Every Transition has an Action property of type ActionInvocation. You want to access its Arguments property, which contains an array of SerializableExpressions. You can convert them into LINQ Expressions by calling method ToExpression on them.
- Proposed as answer by Nico KicillofModerator Tuesday, January 5, 2010 12:46 AM
Tuesday, January 5, 2010 12:46 AMModerator -
Wolfgang, I have been trying to reproduce the issue, but haven't come across it again. If I do, I'll send the model across.
Nico, thanks for the links and direction on how to access the parameters. Would it be possible to provide a simple model with sample code? I have tried using the ToExpression, but run into error about being unable to resolve my implementation types. I tried adding references, but no success.Wednesday, January 6, 2010 8:18 PM -
Hi Anne,
you only need to use ToExpression if you actually intend to compile the expressions (like parameter values) in the transition system on-the-fly into executable .Net code. I guess that is not your intend, or is it? If you don't want to use this but for example just inspect them or convert to some external other format, you can walk over the SerializableExpression, or just use the text representation of each argument.
As regards the usage of ToExpression, I still have on the agenda to author a blog entry about a minimal 'text executor' based on the transition system.
Your concrete problem (if you actually intend to use ToExpression) of not finding implementation types probably can be resolved by either referencing the implementation assembly from your program which uses the TS, or, as a generic solution, by subscribing to the AppDomain type resolver event and loading the requested types using reflection.
Thanks
WolfgangWednesday, January 13, 2010 5:37 AMModerator -
Wolfgang,
Yes, the issue was that some of my actions take model types as arguments. Though adding a reference did not resolve the issue, I ultimately abandoned this problem, because even if it was able to resolve the implementation types, I still could not solve the problem of taking those parameters and translating the action to a test step a manual tester could execute.
For example, if I want to have a test step that tells a tester to add a contact to an address book and correpsonds to this action:
AddContact(string firstname, string lastname)
I wanted to be able to translate that to:
"Test step: add contact with first name = " + firstname + " and lastname = " + lastname.
Even with ToExpression(), I am only getting the parameter value, not the parameter name that the value maps to. Because of this, I decided to use a probe to construct the English version of the teststep within the model itself, and print the probe value to my testcase output file.
Let me know if I am missing something and there is a way to extract the parameter name and value. If so, I could update my model to only use primitive parameter types, or could explore the generic solution you mentioned above.
Also, I was able to recreate the original issue reported in this thread - I'll send the model to the support alias soon.
Anne- Edited by Anne2009 Wednesday, January 13, 2010 6:26 PM forgot last note
Wednesday, January 13, 2010 6:25 PM -
Hi Anne,
Yes, the Arguments property contains the arguments (parameter values) to the action. Parameter names are in the ActionSymbol property of an ActionInvocation. Its Member property will be set in your case to a SerializableMethodBase, whose Parameters property is an array of SerializableParameterInfo objects, each with a Name property.
Best,
Nico- Marked as answer by Nico KicillofModerator Tuesday, January 26, 2010 1:58 AM
Tuesday, January 26, 2010 1:58 AMModerator