Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 MCQs Various Testing Frameworks Available in Java

CSE376 — Automated Testing 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Testing Tools Selection Criteria Easy

    Which factor is important when selecting an automated testing tool?

  2. Question 2 of 60 Testing Tools Selection Criteria Easy

    Which criterion helps determine whether a testing tool is practical for a team?

  3. Question 3 of 60 Fundamentals of Jenkins Easy

    What is Jenkins mainly used for?

  4. Question 4 of 60 Fundamentals of Jenkins Easy

    What can Jenkins automatically do after code is committed?

  5. Question 5 of 60 TestNG Easy

    What is TestNG?

  6. Question 6 of 60 TestNG Easy

    Which annotation commonly identifies a test method in TestNG?

  7. Question 7 of 60 Maven Easy

    What is Maven primarily used for in a Java project?

  8. Question 8 of 60 Maven Easy

    Which file commonly contains Maven project configuration?

  9. Question 9 of 60 JUnit 5 Easy

    Which annotation is used in JUnit 5 to mark a test method?

  10. Question 10 of 60 JUnit 5 Easy

    Which component is the programming model used by JUnit 5?

  11. Question 11 of 60 Gherkin Easy

    What is Gherkin mainly used to write?

  12. Question 12 of 60 Gherkin Easy

    Which Gherkin keyword usually describes an initial condition?

  13. Question 13 of 60 Introduction to JUnit Framework Easy

    What is JUnit?

  14. Question 14 of 60 Introduction to JUnit Framework Easy

    What is the main purpose of a unit test?

  15. Question 15 of 60 Define a Test in JUnit Easy

    Which annotation defines a test method in a JUnit test class?

  16. Question 16 of 60 JUnit Naming Conventions Easy

    Which is a commonly recommended name for a JUnit test method?

  17. Question 17 of 60 JUnit Test Suites Easy

    What is the purpose of a JUnit test suite?

  18. Question 18 of 60 Example JUnit Test Easy

    Which assertion checks that two values are equal in JUnit?

  19. Question 19 of 60 JUnit Code Constructs Easy

    Which JUnit construct is used to check an expected result?

  20. Question 20 of 60 Eclipse Support for JUnit Easy

    Which Eclipse feature can run a JUnit test class?

  21. Question 21 of 60 Testing Tools Selection Criteria Medium

    A development team needs a Java testing tool that supports parameterized tests, parallel execution, and flexible grouping of tests. Which tool best satisfies these requirements?

  22. Question 22 of 60 Testing Tools Selection Criteria Medium

    A team is selecting an automated testing tool for a long-term project. Which factor is most important for reducing integration effort?

  23. Question 23 of 60 Fundamentals of Jenkins Medium

    A Jenkins pipeline must compile a Maven project and then execute its unit tests. Which sequence of stages is most appropriate?

  24. Question 24 of 60 Fundamentals of Jenkins Medium

    A Jenkins job should run automatically whenever code is pushed to a Git repository. Which mechanism is most suitable?

  25. Question 25 of 60 TestNG Medium

    A TestNG test method should run with three different username and password combinations. Which TestNG feature should be used?

  26. Question 26 of 60 TestNG Medium

    In TestNG, generateReport() must run only after executeTests() completes successfully. Which configuration expresses this requirement?

  27. Question 27 of 60 Maven Medium

    A Maven project stores its JUnit tests under src/test/java. Which command compiles the project and runs those tests without packaging the application?

  28. Question 28 of 60 Maven Medium

    JUnit should be available when compiling and running tests but should not be included as a runtime dependency of the application. Which Maven dependency scope is appropriate?

  29. Question 29 of 60 JUnit 5 Medium

    A JUnit 5 test must execute the same method for the values 2, 4, and 6. Which annotation combination is appropriate?

  30. Question 30 of 60 JUnit 5 Medium

    A JUnit 5 test should verify that calling withdraw(200) on an account with insufficient funds throws InsufficientFundsException. Which assertion should be used?

  31. Question 31 of 60 Gherkin Medium

    Which Gherkin scenario correctly describes a successful login using behavior-focused steps?

  32. Question 32 of 60 Gherkin Medium

    Several Gherkin scenarios require the user to be authenticated before their individual steps begin. Where should the shared authentication step be placed?

  33. Question 33 of 60 Introduction to JUnit Framework Medium

    A developer changes the implementation of a calculator while keeping its public behavior unchanged. How does a JUnit regression suite help?

  34. Question 34 of 60 Define a Test in JUnit Medium

    Which JUnit 5 method is correctly defined as a test?

  35. Question 35 of 60 JUnit Naming Conventions Medium

    Which test method name most clearly communicates the condition and expected result?

  36. Question 36 of 60 JUnit Test Suites Medium

    A JUnit 5 suite should include every test class in the package com.example.payment. Which suite configuration is appropriate?

  37. Question 37 of 60 Example JUnit Test Medium

    A method isEven(8) returns true. Which JUnit assertion most directly verifies this behavior?

  38. Question 38 of 60 JUnit Code Constructs Medium

    A fresh DatabaseConnection must be created before every JUnit 5 test to prevent tests from sharing state. Which annotation should be applied to the setup method?

  39. Question 39 of 60 Eclipse Support for JUnit Medium

    A JUnit test run in Eclipse displays a red progress bar, although most tests passed. What does the red bar indicate?

  40. Question 40 of 60 Installation of JUnit Medium

    A Maven-based Java project needs JUnit 5 tests to run during mvn test. Which setup is required?

  41. Question 41 of 60 Testing Tools Selection Criteria Hard

    A Java team must select a testing tool for a modular application. The build runs offline in a restricted network, tests require parallel execution, and reports must integrate with an existing CI server. Which evaluation approach best reduces adoption risk?

  42. Question 42 of 60 Testing Tools Selection Criteria Hard

    Two candidate tools satisfy all functional requirements. Tool X has lower license cost but requires proprietary test scripts, while Tool Y uses standard Java APIs and integrates with the current Maven lifecycle. Which factor most strongly favors Tool Y over the application's expected ten-year lifetime?

  43. Question 43 of 60 Fundamentals of Jenkins Hard

    A Jenkins Pipeline uses the following stage:

    stage('Test') { steps { sh 'mvn test' } post { always { junit 'target/surefire-reports/*.xml' } } }

    Several tests fail. Assuming Maven Surefire returns a nonzero exit code, what is the most likely behavior?

  44. Question 44 of 60 Fundamentals of Jenkins Hard

    A Jenkins controller has Linux and Windows agents. UI tests require Chrome installed only on agents labeled ui-linux, while compilation may run anywhere. Which Declarative Pipeline design most accurately enforces this constraint?

  45. Question 45 of 60 TestNG Hard

    A TestNG data provider is declared as @DataProvider(name = "users", parallel = true). Multiple invocations update the same mutable instance field in the test class. Which change most directly makes the tests reliable under parallel execution?

  46. Question 46 of 60 TestNG Hard

    In TestNG, createAccount() is annotated with @Test, and deleteAccount() is annotated with @Test(dependsOnMethods = "createAccount"). If createAccount() fails, what is the default outcome for deleteAccount()?

  47. Question 47 of 60 Maven Hard

    A Maven project has unit tests named PriceTest and integration tests named PaymentIT. The build must run unit tests during test and integration tests during integration-test, with integration-test failures checked during verify. Which plugin allocation is conventional?

  48. Question 48 of 60 Maven Hard

    A multi-module Maven build contains modules domain, service, and web, where web depends on service, and service depends on domain. From the reactor root, what does mvn -pl service -am test request?

  49. Question 49 of 60 JUnit 5 Hard

    A JUnit Jupiter parameterized test receives strings through @ValueSource(strings = {"42", "-1"}), but the method parameter type is int. Why can this test execute without a custom converter?

  50. Question 50 of 60 JUnit 5 Hard

    A JUnit Jupiter test class uses the default per-method lifecycle. Its non-static @BeforeAll method fails discovery with a validation error. Which change permits the method to remain non-static?

  51. Question 51 of 60 Gherkin Hard

    A Gherkin scenario outline contains placeholders <role> and <status>, with three rows in its Examples table. How should a runner normally interpret the outline?

  52. Question 52 of 60 Gherkin Hard

    Which Gherkin design best preserves business readability while avoiding unnecessary coupling to a web interface?

  53. Question 53 of 60 Introduction to JUnit Framework Hard

    A project contains JUnit 4 tests and newly written JUnit Jupiter tests. Maven discovers the Jupiter tests but ignores the JUnit 4 tests. Which additional JUnit Platform component is specifically intended to execute the older tests?

  54. Question 54 of 60 Define a Test in JUnit Hard

    Consider this JUnit Jupiter method:

    @Test void transfer() { assertThrows(InsufficientFundsException.class, () -> account.transfer(100)); }

    The transfer throws a subclass of InsufficientFundsException. What is the result?

  55. Question 55 of 60 JUnit Naming Conventions Hard

    A Maven project uses the default Surefire test-name patterns. Which JUnit test class is least likely to be discovered solely because of its filename?

  56. Question 56 of 60 JUnit Test Suites Hard

    A JUnit Platform suite is annotated with @Suite, @SelectPackages("com.example"), and @IncludeTags("fast"). What is the intended selection behavior?

  57. Question 57 of 60 Example JUnit Test Hard

    A JUnit Jupiter test uses assertAll("account", () -> assertEquals(10, account.balance()), () -> assertFalse(account.isLocked())). Both assertions fail. What behavior should be expected?

  58. Question 58 of 60 JUnit Code Constructs Hard

    A JUnit Jupiter test calls assertTimeout(Duration.ofMillis(100), () -> service.compute()), and compute() takes 150 ms before returning normally. Which statement is correct?

  59. Question 59 of 60 Eclipse Support for JUnit Hard

    A JUnit Jupiter test runs from Maven, but Eclipse reports that no tests were found when using an outdated Eclipse installation. The project classpath is otherwise correct. What is the most appropriate diagnosis?

  60. Question 60 of 60 Installation of JUnit Hard

    A Maven project should compile and run JUnit Jupiter tests without packaging JUnit APIs into the production artifact. Which dependency setup is most appropriate when dependency versions are managed separately?

That's unit 4

Answer a few questions and your score shows up here.