Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration and Unit Tests #107

Open
JoshuaStorm opened this issue Jun 11, 2019 · 2 comments
Open

Integration and Unit Tests #107

JoshuaStorm opened this issue Jun 11, 2019 · 2 comments
Assignees

Comments

@JoshuaStorm
Copy link
Collaborator

I think we would all like a slight upgrade to the stability of the MantaMate. Here's an approach I had in mind and think I will try to bust out over this summer. The main motivating factor here is (1) to make the MantaMate releases more stable, and (2) to have more confidence when editing the MantaMate code that you didn't break anything.

Here's one way I could see us testing MantaMate code:

  1. Refactoring the MantaMate code to be oriented around "Actions," in essence everything would be defined by handler functions such as pressHex(hexNumber) and pressSlider(sliderNumber). I think the code is already sort like this in some ways, but it'd need to be a bit stricter I believe

  2. Then we could serialize behavior in such a way that, given a starting MantaMate state and Manta UI state, and a sequence of "Actions," we could define an Expected EndMantaMate state and EndMantaUIState. In effect, we could define our tests with those parameters
    (BeginMantaMateState, BeginMantaUIState, [Actions], EndMantaMateState, EndMantaUIState). With the code refactored to be oriented around these Actions, writing code to run through a a set of actions and assert it ends on the EndStates would be fairly easy.

  3. The main issue with the above is writing the beginning and end states out by hand might be particularly cumbersome, so I have been using this as an opportunity to play around with some C# to see how hard it'd be to make a little application that could spit out C-style structs for us, given some simple GUI input. (https://github.com/JoshuaStorm/MantaMateTestBuilder)

Considering (3) will only really work out if my refactor actually makes sense in practice, I think I'm gonna hit pause on the MantaMateTestBuilder and try getting the refactor done on a separate MantaMate branch. Then I'll write a few tests out by hand to see if the testing system will actually work out how I think it will.

@JoshuaStorm JoshuaStorm self-assigned this Jun 11, 2019
@JoshuaStorm
Copy link
Collaborator Author

JoshuaStorm commented Jun 11, 2019

My brother @0x00ify (Sam), may help out on this one too :)

@spiricom
Copy link
Owner

spiricom commented Jun 11, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants