开发者

Expressions value evaluvation

开发者 https://www.devze.com 2023-02-18 01:10 出处:网络
I\'m trying to create expression trees using Linq.Expressions and evaluvate them at 开发者_高级运维runtime.I was wondering if there\'s a way to populate values based on the operator.

I'm trying to create expression trees using Linq.Expressions and evaluvate them at 开发者_高级运维runtime.I was wondering if there's a way to populate values based on the operator.

Example:

My expression is : (x<=100) && (50!=y).What can be the values of x and y? For a true and false scenario? Is there a way to find them using Expression object?


I don't believe this is going to be trivial to do!


One thing you might find interesting is the Pex research project from Microsoft - http://research.microsoft.com/en-us/projects/pex/ This is used in the pex whitebox testing plugin and in the fun http://www.pexforfun.com/ site. While not exactly your problem, I believe they do use heuristics (and some blind "trial-and-error" guesses) to try to find boundary cases for testing.

0

精彩评论

暂无评论...
验证码 换一张
取 消