2 years ago

#56525

test-img

ranmeo123

How to write test cases using Equivalence Class, Boundary value, and Basis Path Testing

I have a method isPerfect(x) (with 4<=x<=10000) below, how to write test cases based on Equivalence Class, Boundary Value, and Basis Path Testing:

public boolean checkPerfectNumber(int x) {
        if(x >= 4 && x <= 10000) {
            int sum = 0;            
            for(int i = 1; i < x; i++) {
                if(x % i == 0) {
                    sum += i;
                }
            }           
            if(sum == x) return true;
        }
        return false;
    }

testing

boundary

black-box-testing

white-box-testing

equivalence-classes

0 Answers

Your Answer

Accepted video resources