Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Software testing course

        Equivalence partitioning

        Opening Software testing
        Your turn

        Equivalence partitioning

        One value from each class

        Most inputs behave like their neighbors: ages 30 and 41 both pay the adult price, so testing both adds nothing. Equivalence partitioning splits the possible inputs into classes the contract treats alike, then tests one representative from each. Find the classes in the contract, not in the code: child, adult and senior prices are three classes, an invalid country code is a fourth kind of input, and two inputs together can make a grid of classes, such as a member below the discount threshold.

        The forgotten class

        A bug that breaks only one class passes every test of the other classes. In these exercises your pytest tests run against the correct module and against two versions that each mishandle a single class: seniors charged the full price, a password with two problems reported as one. Your suite passes only when it catches both, so it has to cover every class. Hidden checks change the module’s constants, so build inputs from them. The next lesson, boundary value analysis, picks the values at the edge of each class.

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        New accounts get 12 hours of full access: every course, unit, project and exam. The clock starts when you open your first lesson.

        Plan your practice from a job ad or syllabus

        Have a referral code?

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.