Page 1 of 1

More comprehensive tests

PostPosted: 23 Mar 2015, 19:00
by BetaSteward
I have also been playing with the idea of adding as many of the Examples in the Comprehensive Rules to the Test project. I'm a big fan of TDD and I believe that the more tests we have the better the quality of the product.

I would also like to encourage anyone doing development to add tests for each piece of non-trivial functionality that is added. Tests should ideally cover both positive and negative scenarios.

If you want to get really crazy you could write the tests first! Some people think that this helps you to work out the logic before you start writing the code.

Let me know what your thoughts/feelings/opinions are.

BetaSteward

Re: More comprehensive tests

PostPosted: 23 Mar 2015, 21:45
by LevelX
I also like the tests and think it's a very effective way to improve and keep the quality of XMage.

The complete rule construction of MTG is complex and it's hard to have always the complete spectrum of dependencies in mind if you start to change something. I'm more than happy to be able to build the test project after a change to the XMage framework to see what is broken (after my change).
Without the tests I guess it's a lot harder to become aware of the things you broke with your changes. So the more tests we have the more we can see if a change is well done and needs some more fine tuning to be completely correct.

If I try to fix an existing bug I really often write first a test that indicates the bug because it's very useful for debugging and to check if the fix works. Also I know that this specific situation is in the future covered by a test.