The answer is: YES. The unit tests are worth the effort. Once you created them:
- You know how the code should be used: the unit test is your documentation
- you will get a trigger if you change something for another usecase and break the code's original intent because the test will fail after that
- The alternative is testing the code by starting the application itself, clicking to the right place, and testing the different scenario's. This is a very dull and time-consuming way of testing, and not very thorough. Creating a unit test for testing the code is way faster than the alternative, and the test will behave exactly the same each time you start it.
No comments:
Post a Comment