Unit Testing - What not to test

后端 未结 9 1137
悲哀的现实
悲哀的现实 2020-12-14 07:34

I have gone through a number posts on stackoverflow and numerous articles about Unit Tests. I am just trying to figure out that what I have understood is right.

相关标签:
9条回答
  • 2020-12-14 07:57

    Simple Answer - nothing

    Complex Answer - you should not test things you do not have the time for. Testing is driven by a complex planning of the needed and affordable tests, prioritized for the most significant parts and workflows of the softwaresystem. The more time is left for testing, the more sidecases can be tested.

    In UnitTesting is simply, every unit, in OOP every class has its own test. Test simply everything with values min, max, average usecases and do negativ tests - tests that have to fail if the software works correct. Test errorhandling as well.

    See ITSQB for more details on that topic

    0 讨论(0)
  • 2020-12-14 08:00

    Wait, by JS you mean JavaScript? I assume you are referring to client side validation then? You should never assume the client validates anything when building a website. JavaScript can be disabled, pages can be altered or faked, etc.

    0 讨论(0)
  • 2020-12-14 08:03

    Don't unit test the .NET framework. By that, I mean, don't test things that are Microsoft's responsibility.

    For example, don't bother to test setters and getters - unless there is actually code included there.

    0 讨论(0)
提交回复
热议问题