Rigor in capturing test cases for unit testing

后端 未结 5 1167
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 14:02

Let\'s say we have a simple function defined in a pseudo language.

List SortNumbers(List unsorted, bool ascending);
5条回答
  •  北恋
    北恋 (楼主)
    2021-02-09 14:31

    A good code coverage tool really helps.

    100% coverage doesn't mean that it definitely is adequately tested, but it's a good indicator.

    For .Net NCover's quite good, but is no longer open source.


    @Mike Stone - Yeah, perhaps that should have been "high coverage" - we aim for 80% minimum, past about 95% it's usually diminishing returns, especially if you have belt 'n' braces code.

提交回复
热议问题