Programatic interface for TCases #260
Replies: 5 comments 7 replies
-
You make some very good points. I agree that creating and maintaining an input model can be a difficult job. Tcases is actually designed to make it easy to do everything from code. Take a look at all of the Supposing you had a program that built a |
Beta Was this translation helpful? Give feedback.
-
Have you had any more thoughts about the kind of "input space as code" you'd like to see? |
Beta Was this translation helpful? Give feedback.
-
Looking at your example, it seems quite similar to the existing builder paradigm. If it seems simpler, it is partly because it doesn't demonstrate all of the elements that go into an input model. That's especially true now with the introduction of schemas for variable and value definitions. On the other hand, this does suggest way to make it easier to use the builders. See PR #270 for a sample implementation. What do you think? |
Beta Was this translation helpful? Give feedback.
-
Yet another simplification: allow subcomponents to be added in the form of builder instances. Less "build-y"! |
Beta Was this translation helpful? Give feedback.
-
From my experience it is possible to set expected results. For most of the variables there is expected result there. So I had GIVENs and THENs in each variable. There were also WHENs variables which existed only for the purpose of connecting GIVEN and THEN in executable test cases (they were present in each testcase which was generated by TCases). I was thinking about how to build this bridge between model and executable code. In my opinion it could happen after test cases are created - this would allow not to pollute the input model with some non related stuff. My idea is that maybe it would be possible to deserialize generated testcases into classes which would contain information on how to generate executable testcase. I created small example basing on icecream example from TCases documentation: There is part of variables from the first generated testcase manually instantiated inside |
Beta Was this translation helpful? Give feedback.
-
Hi,
I use TCases from time to time. I think it is great concept and great tool. The biggest problem for me is input space creation. While it was great idea to change XML to JSON it is still problematic to create JSON file input space for me.
My real life scenario is:
There are drawbacks at this point:
I think there should exist "input space as code" approach which would have other advantages as well:
Did you ever consider such interface? Here is the example of similar project which tries to implement this idea:
https://github.com/RetailMeNot/pairwise
What do you think about it ?
(I just realized that maybe this should go to discussion section - I am sorry if I make some noise here.)
Beta Was this translation helpful? Give feedback.
All reactions