pencils ready ✎

Software Testing MCQs multiple-choice questions with answers & explanations

All 11 Software Testing quiz questions on one page. Pick an answer in your head, then open Show answer to check it and read why. Want a score and a timer? Take them as a quiz instead.

11 questions
  1. 1.

    For an inclusive allowed range of 1 to 100, which set best targets boundaries?

    easy
    1. A25, 50, 75
    2. B1 only
    3. C0, 1, 100, 101
    4. D50 repeated four times
    Show answer

    Answer: C (0, 1, 100, 101)

    Values at and just outside each limit exercise boundary acceptance and rejection. Mid-range tests alone miss off-by-one errors.

  2. 2.

    What is a regression test intended to detect?

    easy
    1. AA previously working behavior breaking
    2. BEvery possible security flaw
    3. COnly syntax mistakes
    4. DWhether a feature is profitable
    Show answer

    Answer: A (A previously working behavior breaking)

    Regression tests protect existing behavior as code changes. They cannot establish that every possible defect is absent.

  3. 3.

    What does 100% line coverage prove?

    easy
    1. AAll inputs were tested
    2. BEvery executed assertion is correct
    3. CEvery measured line was executed
    4. DNo bugs remain
    Show answer

    Answer: C (Every measured line was executed)

    Line coverage measures execution, not the strength of assertions or completeness of edge cases.

  4. 4.

    What is a unit test generally intended to exercise?

    easy
    1. AThe entire production infrastructure
    2. BA focused behavior of a small unit of code
    3. COnly the visual page layout
    4. DA manual deployment checklist
    Show answer

    Answer: B (A focused behavior of a small unit of code)

    Unit tests isolate a focused behavior for fast feedback. The precise unit boundary depends on design; smaller is not automatically better if tests become coupled to implementation details.

  5. 5.

    Which test is most clearly an integration test?

    easy
    1. ATesting a pure addition function
    2. BChecking a variable name
    3. CChecking that a repository writes and reads records in a test database
    4. DReviewing a screenshot manually
    Show answer

    Answer: C (Checking that a repository writes and reads records in a test database)

    An integration test exercises collaboration across a boundary, such as application code and a database. It can reveal mapping, query and transaction problems that isolated tests miss.

  6. 6.

    What is a test oracle?

    mid
    1. AA mechanism for deciding whether observed behavior is correct
    2. BA random test input
    3. CA production server
    4. DA mandatory testing vendor
    Show answer

    Answer: A (A mechanism for deciding whether observed behavior is correct)

    An oracle supplies the expected outcome or property. Examples include a specification, invariant or trusted reference implementation.

  7. 7.

    What is equivalence partitioning?

    easy
    1. ARepeating the same case many times
    2. BTesting only successful inputs
    3. CComparing two programming languages
    4. DGrouping inputs expected to behave similarly and testing representatives
    Show answer

    Answer: D (Grouping inputs expected to behave similarly and testing representatives)

    Equivalence classes reduce redundant examples while covering distinct behaviors. Boundary tests remain useful because errors often occur at class edges.

  8. 8.

    Which is a property-based test for a correct sorting function?

    mid
    1. AThe output is always empty
    2. BFor generated inputs, output is ordered and preserves the input multiset
    3. CThe implementation calls a specific helper
    4. DOnly one fixed array is checked
    Show answer

    Answer: B (For generated inputs, output is ordered and preserves the input multiset)

    Property-based tests check invariants over generated inputs. Checking both order and element multiplicities catches more defects than checking order alone.

  9. 9.

    What does mutation testing help evaluate?

    mid
    1. AWhether tests detect deliberately introduced code changes
    2. BWhether production data can be edited
    3. COnly how many lines ran
    4. DWhether builds use the newest compiler
    Show answer

    Answer: A (Whether tests detect deliberately introduced code changes)

    Mutation testing introduces small changes and checks whether tests fail. Surviving mutants can reveal weak assertions, though some mutations are behaviorally equivalent.

  10. 10.

    Which is a negative test for a login form?

    easy
    1. ALogging in with valid credentials
    2. BOpening the home page
    3. CSubmitting an invalid password and checking rejection
    4. DChanging the site theme
    Show answer

    Answer: C (Submitting an invalid password and checking rejection)

    Negative tests verify behavior for invalid inputs or disallowed actions. They should check appropriate rejection without unintended side effects.

  11. 11.

    Which practice best reduces order-dependent tests?

    mid
    1. ASharing mutable records across all tests
    2. BRequiring one test to run first
    3. CAdding a long sleep to every test
    4. DCreating and cleaning up each test’s own state
    Show answer

    Answer: D (Creating and cleaning up each test’s own state)

    Independent fixtures prevent earlier tests from changing later outcomes. Arbitrary delays do not resolve shared-state dependencies.

esc