nus-cs2103-AY1920S1 / forum

Forum
1 stars 1 forks source link

Null values in equivalence partitions #192

Open KendrickAng opened 4 years ago

KendrickAng commented 4 years ago

Should null values be included in equivalence partitions, or are they trivial enough to exclude from EPs? When should we include, or exclude them?

damithc commented 4 years ago

When an input is possible to be null, it should be considered. For example, when testing a Java method that has an int parameter, it is not possible for that input to be null as Java would not allow null for an int input.

tcgj commented 4 years ago

Does this mean that if it's an non-primitive object type, like String or Task etc, the only partitions are null and not null

damithc commented 4 years ago

Does this mean that if it's an non-primitive object type, like String or Task etc, the only partitions are null and not null

Testing would be much easier if that were the case :-)

not-null objects have state (i.e., attribute values), and can belong to different partitions based on the state. For example, a String object can be alpha-numeric or not alpha-numeric, a Person object can be sick or healthy and so on.

tcgj commented 4 years ago

Good point. Thanks