Maintainability Foundation JAVA Practice Exam Questions, Exams of Technology

A practice exam for the 174 certified quality software developer maintainability foundation java certification. It includes multiple-choice questions covering topics such as iso/iec 25010 characteristics, maintainability, reliability, cyclomatic complexity, code smells, solid principles, refactoring, java language features, design patterns, and testing frameworks. Each question is followed by a detailed explanation of the correct answer, making it a valuable resource for exam preparation and understanding key concepts in software maintainability. The practice exam covers a range of topics relevant to software quality and maintainability, offering a comprehensive review of essential concepts. It is designed to help developers assess their knowledge and prepare for certification.

Typology: Exams

2024/2025

Available from 12/02/2025

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 114

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
174 Certified Quality Software Developer
Maintainability Foundation JAVA Practice Exam
**Question 1.** Which ISO/IEC 25010 characteristic directly describes the ease
with which a software product can be modified?
A) Reliability
B) Maintainability
C) Portability
D) Security
Answer: B
Explanation: Maintainability is defined by ISO/IEC 25010 as the degree of
effectiveness and efficiency with which a product can be modified.
**Question 2.** In the business context, high maintainability primarily reduces
which of the following?
A) System performance
B) Development costs for future changes
C) User interface complexity
D) Network latency
Answer: B
Explanation: High maintainability lowers the effort and cost required to make
future modifications, thus reducing overall development expenses.
**Question 3.** Which quality attribute is most closely related to maintainability
when considering the impact of fixing defects?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Maintainability Foundation JAVA Practice Exam Questions and more Exams Technology in PDF only on Docsity!

Maintainability Foundation JAVA Practice Exam

Question 1. Which ISO/IEC 25010 characteristic directly describes the ease with which a software product can be modified? A) Reliability B) Maintainability C) Portability D) Security Answer: B Explanation: Maintainability is defined by ISO/IEC 25010 as the degree of effectiveness and efficiency with which a product can be modified. Question 2. In the business context, high maintainability primarily reduces which of the following? A) System performance B) Development costs for future changes C) User interface complexity D) Network latency Answer: B Explanation: High maintainability lowers the effort and cost required to make future modifications, thus reducing overall development expenses. Question 3. Which quality attribute is most closely related to maintainability when considering the impact of fixing defects?

Maintainability Foundation JAVA Practice Exam

A) Reliability B) Efficiency C) Usability D) Compatibility Answer: A Explanation: Reliability concerns fault tolerance; maintainability affects how easily those faults can be corrected, linking the two attributes. Question 4. Which type of maintenance involves adding new features to meet evolving business needs? A) Corrective B) Adaptive C) Perfective D) Preventive Answer: C Explanation: Perfective maintenance focuses on improving or extending functionality, such as adding new features. Question 5. Cyclomatic Complexity measures which aspect of a unit? A) Number of lines of code B) Number of decision points

Maintainability Foundation JAVA Practice Exam

Explanation: The Code Duplication Ratio quantifies the proportion of identical or near‑identical code fragments. Question 8. A “Large Class” smell violates which SOLID principle? A) Single Responsibility Principle (SRP) B) Open/Closed Principle (OCP) C) Liskov Substitution Principle (LSP) D) Interface Segregation Principle (ISP) Answer: A Explanation: SRP states a class should have one reason to change; a large class typically has many responsibilities. Question 9. Feature Envy occurs when a method: A) Calls many methods of another class more than its own B) Contains many nested loops C) Declares many local variables D) Is never invoked Answer: A Explanation: Feature Envy indicates a method is more interested in another class’s data than its own, suggesting misplaced functionality.

Maintainability Foundation JAVA Practice Exam

Question 10. Which refactoring extracts a group of related fields and methods into a new class? A) Extract Method B) Extract Class C) Move Method D) Inline Class Answer: B Explanation: Extract Class creates a new class to hold a cohesive subset of members, improving modularity. Question 11. The “Replace Conditional with Polymorphism” refactoring primarily addresses which code smell? A) Long Method B) Switch Statements C) Data Clumps D) Magic Numbers Answer: B Explanation: It removes extensive if‑else or switch logic by delegating behavior to subclasses. Question 12. Which Java language feature helps avoid “raw type” code smells?

Maintainability Foundation JAVA Practice Exam

C. LSP

D. ISP

Answer: B Explanation: The Open/Closed Principle (OCP) promotes extending behavior via inheritance or composition without altering existing code. Question 15. An immutable class in Java must have all of the following EXCEPT: A. All fields declared final B. No setter methods C. A public mutable collection field D. All fields initialized in the constructor Answer: C Explanation: A public mutable collection would allow external modification, breaking immutability. Question 16. Which of the following is a sign of “Shotgun Surgery” in a codebase? A. One class contains many unrelated methods B. A single change requires edits in many classes C. A method is excessively long D. Multiple classes have identical code blocks

Maintainability Foundation JAVA Practice Exam

Answer: B Explanation: Shotgun Surgery forces a developer to modify many places for a single logical change. Question 17. The “Introduce Explaining Variable” refactoring improves: A. Performance B. Readability C. Security D. Concurrency Answer: B Explanation: Naming intermediate results clarifies complex expressions for future readers. Question 18. Which collection type provides O(1) average‑time complexity for key‑based lookups? A. ArrayList B. LinkedList C. HashMap D. TreeSet Answer: C Explanation: HashMap uses hashing to achieve constant‑time key retrieval on average.

Maintainability Foundation JAVA Practice Exam

Question 21. Which metric assesses the balance of responsibilities among components? A. Component Coupling B. Component Balance C. Fan-in D. Depth of Inheritance Tree Answer: B Explanation: Component Balance measures how evenly responsibilities are distributed across components. Question 22. The “Extract Interface” refactoring is most useful for: A. Reducing code duplication B. Improving testability by decoupling clients from implementations C. Increasing cyclomatic complexity D. Eliminating magic numbers Answer: B Explanation: Introducing an interface allows clients to depend on abstractions, facilitating mocking and substitution. Question 23. Which of the following best describes “Message Chains”? A. A series of method calls that traverse multiple objects to get a needed value

Maintainability Foundation JAVA Practice Exam

B. Repeated identical code blocks C. Classes that expose many public fields D. Methods that have too many parameters Answer: A Explanation: Message Chains indicate a violation of Law of Demeter, making code fragile. Question 24. A “Lazy Class” is identified when: A. The class has no public methods B. The class does not contain enough functionality to justify its existence C. The class inherits from many super‑classes D. The class contains only static methods Answer: B Explanation: Lazy Class indicates an unnecessary abstraction that can be merged elsewhere. Question 25. Which design pattern replaces a complex conditional with a family of interchangeable objects? A. Singleton B. Strategy C. Factory Method

Maintainability Foundation JAVA Practice Exam

Explanation: Vague abbreviations reduce readability; constants should be self‑explanatory. Question 28. The “Depth of Inheritance Tree” metric measures: A. Number of interfaces implemented B. Maximum length from a class to the root of the inheritance hierarchy C. Number of overridden methods D. Amount of code duplication across subclasses Answer: B Explanation: DIT reflects inheritance depth, influencing complexity and understandability. Question 29. Which principle encourages small, client‑specific interfaces rather than one large interface? A. SRP B. OCP C. ISP D. DIP Answer: C Explanation: Interface Segregation Principle (ISP) advises splitting interfaces so clients only depend on what they use.

Maintainability Foundation JAVA Practice Exam

Question 30. In Java, which construct is preferred for handling resources that must be closed, such as streams? A. finally block B. try‑with‑resources C. System.gc() D. Thread.sleep() Answer: B Explanation: try‑with‑resources automatically invokes close() on resources, ensuring proper cleanup. Question 31. Which of the following best describes “Dead Code”? A. Code that is never executed at runtime B. Code that throws unchecked exceptions C. Code that uses deprecated APIs D. Code that has high cyclomatic complexity Answer: A Explanation: Dead code is unreachable or never called, adding maintenance overhead without functional benefit. Question 32. Which refactoring technique would you apply to a method that takes ten parameters? A. Extract Method

Maintainability Foundation JAVA Practice Exam

D. They are typically automated. Answer: B Explanation: Unit tests verify individual components but do not cover interactions between components; integration testing is still needed. Question 35. Which of the following is a benefit of using the final keyword on method parameters? A. Improves runtime performance by enabling inlining B. Prevents the parameter from being reassigned within the method, enhancing readability C. Allows the method to be overridden in subclasses D. Enforces thread‑safety automatically Answer: B Explanation: Declaring a parameter final ensures it cannot be reassigned, making the method’s intent clearer. Question 36. In a CI pipeline, which automated check directly supports maintainability? A. Load testing B. Static code analysis for code smells C. Database migration scripts D. User acceptance testing

Maintainability Foundation JAVA Practice Exam

Answer: B Explanation: Static analysis tools detect violations of maintainability guidelines early in the development process. Question 37. Which of the following is an example of a “Magic Number”? A. final int MAX_RETRIES = 5; B. if (status == 200) { … } without a named constant C. enum Day { MONDAY, TUESDAY } D. String.format("%s", name) Answer: B Explanation: Hard‑coded literals like 200 without a descriptive name are magic numbers, reducing readability. Question 38. The “Law of Demeter” encourages which of the following? A. Deep inheritance hierarchies B. Limited knowledge of other objects’ internal structures C. Use of global variables for sharing state D. Frequent use of static methods Answer: B Explanation: It advises that a class should only talk to its immediate collaborators, preventing message chains.

Maintainability Foundation JAVA Practice Exam

A. One class is modified in many unrelated ways over time B. Multiple classes need to be changed for a single feature C. A class contains many static methods D. A method has a very high cyclomatic complexity Answer: A Explanation: Divergent Change indicates a class has multiple responsibilities, leading to frequent unrelated edits. Question 42. In Java, which annotation indicates that a method is intended to be a unit test? A. @Test B. @Override C. @Deprecated D. @FunctionalInterface Answer: A Explanation: @Test (from JUnit) marks a method as a test case. Question 43. Which metric is most directly affected by the number of if/else statements in a method? A. Lines of Code (LOC) B. Cyclomatic Complexity

Maintainability Foundation JAVA Practice Exam

C. Depth of Inheritance Tree (DIT) D. Weighted Methods per Class (WMC) Answer: B Explanation: Each decision point (if/else, case, while) increments cyclomatic complexity. Question 44. Which design principle is violated when a subclass overrides a method and changes its expected behavior for existing clients? A. Open/Closed Principle B. Liskov Substitution Principle C. Interface Segregation Principle D. Dependency Inversion Principle Answer: B Explanation: LSP requires that objects of a subclass can be substituted for objects of the superclass without altering desirable properties. Question 45. Which of the following is NOT a characteristic of a well‑structured Java package hierarchy? A. Logical grouping by feature or layer B. Mixing unrelated utilities with core domain classes in the same package C. Avoiding cyclic dependencies between packages D. Using meaningful package names that reflect purpose