3

我知道我可以使 scalacheck 测试确定性,但我有一个更普遍的问题:scalacheck 的默认非确定性行为是否会导致实际问题?我一直认为测试应该是确定性和可重复的,反之则表明测试设计不佳。Scalacheck 似乎被用于几个“严肃”的项目中,所以我想知道打破这个确定性原则是否实际上是现实生活中的(不仅仅是理论上的)问题?

4

1 回答 1

2

I'd say that "tests should be deterministic and repeatable" doesn't always apply. They obviously have their rather large place, but randomized testing is useful as well. In addition to QuickCheck/ScalaCheck and friends there are approaches such as fuzzing.

于 2014-02-02T07:44:04.917 回答