我试图理解这个主题并从最基本的主题(不是离散域)开始,我认为这是不正确的。
我还不能发布图片所以描述是这样的:
Income is greater than 0 and lesser than 500 = tax 0
Income is greater than 500 and lesser than 1300 = tax 30
Income is greater than 1300 and lesser than 5000 = tax 40
他们为负数定义了invalid class,对0-500和500到1300有效,对1300到5000无效。
我认为这是一个错误,无效类以 5000 为界并趋于无穷大。
我说得对吗?
最佳答案
正如您所提到的,我很确定其中存在错误。 有 3 个有效输入类和两个无效输入类,它们超出范围,即低于 0 或高于 5 000。
关于testing - 等价划分,这是书中的错误示例吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16129577/