Should I write unit test for everything?

前端 未结 13 1492
太阳男子
太阳男子 2020-12-30 00:36

I am wondering should I write unit test for everything. There are some classes is very difficult to write unit test. For example, I am writing some program for handling audi

13条回答
  •  执念已碎
    2020-12-30 01:03

    Other example: If you develop a game engine, you want to test your shadowing and other functions, but you have to confirm it visually - that's nothing a classic UnitTest can decide.

    Your Case: As your application becomes more complex it gets painful always to click through your UI to test all your functions.

    I would write an "interactive TestSuite", where various dummy dialogs (customized for each test-case) are shown with only the functions you need to test. Once you close the Dialog, you will be prompted if the behaviour was expected. But I am not sure if there are solutions available which could help here.

提交回复
热议问题