Should we introduce a way for mapmakers to produce engine tests? #10579
Replies: 4 comments 2 replies
-
I think the idea goes in the right direction, however I think your proposal does try to achieve too many things at once. Do we need more regression testing? Yes, definitely! Do I think those kind of regression tests should count towards coverage? Probably not, I think this would create a false sense of correctness for helper functions that work in the common cases, but actually miss out to check edge cases that might be never touched in a test scenario. How easy should it be to setup those tests? This is where I think you're raising a pretty good point. I personally have no Idea on how to properly create a test scenario in code. I would probably be able to copy existing test cases and fiddle around with the values a bot to achieve the desired result, but from scratch I'd be pretty clueless. So having some sort of structured setup for test cases could come in pretty handy. But as mentioned earlier this is where we need to decide which direction we want to chose. Do we want to test certain functions pretty close to unit tests where coverage is relevant, or do we want to provide map creators and/or power-users with the tools to simulate small to medium-sized scenarios? Those are 2 different things, both with their own purpose. Also I think yaml suits this task more than xml. |
Beta Was this translation helpful? Give feedback.
-
Smoke testing sounds good and the separate coverage sounds like an interesting idea (I don't think our tools support this out of the box though).
Not necessarily. As of yaml 1.2 json is a subset of yaml which means that you can use json notation within yaml to shorten lists or key-value pairs. The main benefit in my opinion is the reduced boilerplate you can avoid in yaml. Closing tags are not required for example and if you have a list of the same tags (units for example) there's no need to repeat the type "unit" for every individual entry and you can just provide the actual content that differs. In the end it's just personal preference though. I personally think having new lines for properties is not even a bad thing, modern editors allow you to collapse item trees if they are in the way |
Beta Was this translation helpful? Give feedback.
-
Sorry to not have enough time right now for a very detailed response. To add some fodder to this conversation:
Overall, I think TripleA needs to be re-modularized and that would allow for a lot of new/better tests than what we can do now as compared to the current spagettic & BBOM structure. 3.0 would operate largely 'game state change objects', those would be serialized as plain text and could be crafted for these kind of test cases. I somewhat think then that if we accomplish that, we could pretty readily say "given this map, and this change state change, validate that the change works", or "validate that the territory owner is now X". Another concern is that we might invest and/or lock ourselves into a pattern that we later need to throw away or would want to drastically change - where we could potentially invest in 3.0 directly and then have this kind of thing be easier and much more natural compared to what we would need to build today. |
Beta Was this translation helpful? Give feedback.
-
I will volunteer to help with this, for a short time. We could test each of the properties in the xml and that should be portable to v3, yes? |
Beta Was this translation helpful? Give feedback.
-
@DanVanAtta @RoiEXLab and others, I'd like to get your thoughts on this.
We know that TripleA lacks a lot of test coverage. So it's easy to introduce bugs and hard to find them without manual testing.
At the same time, mapmakers and rule experts sometimes help test new engine versions and report bugs. However, this is pretty manual and then the issue needs to be reproduced and confirmed / debugged by a developer. Sometimes there is user error involved where someone may claim there's a bug somewhere, but they made a mistake in testing, etc.
Then, when it comes time to fixing something, we don't always add a test case to cover the behavior - it's often a lot of work to do so.
So, my idea is this - what if we introduce the ability for mapmakers who don't know Java programming to produce test cases that the engine could run? They can be specified in XML or some other declarative language, where programming is not required.
For example, the test can specify a specific map to use and to set up the board state (e.g. set phase, add units, do moves). Then it can provide some expectations - for example, a simple test could be something like:
Something like the above can be authored by mapmakers when reporting bugs. When we fix the bugs, the test can be added to the repository expanding test coverage. WDYT?
Beta Was this translation helpful? Give feedback.
All reactions