dimanche 30 septembre 2018

How would you go about testing a method with a private threshold?

Image a following situation:

private final double THRESHOLD = 10d;
public boolean isHighEnough(double numberOfPeople, double arg2, ...) {
    return Math.pow(numberOfPeople) / 3 * arg2 ... >= THRESHOLD;
}

When writing tests for isHighEnough would you write something besides min (numberOfPeople = 0, arg2 = 0) and maxCase (numberOfPeople = 10^9), it's difficult to write a medium test because THRESHOULD may be changed soon ( first it's heuristically).

Thanks.

Aucun commentaire:

Enregistrer un commentaire