Engineering Practices for Building Quality Software Quiz Answers

Welcome to your comprehensive guide for Engineering Practices for Building Quality Software quiz answers! Whether you’re tackling practice quizzes to deepen your understanding or preparing for graded quizzes to test your knowledge, this guide is here to help.

Covering all course modules, this resource will introduce you to essential engineering practices in software development, such as automated testing, code reviews, version control, and continuous integration, all aimed at ensuring high-quality software.

Engineering Practices for Building Quality Software Quiz Answers for All Modules

Engineering Practices for Building Quality Software Module 02 Quiz Answers

Quality in Design Quiz Answers

Q1. The logical (intended) dependency is that observer depends on subject.

Answer:

  • True
    Explanation: In the Observer pattern, the subject maintains a list of observers, and each observer depends on the subject to notify them of state changes.

Q2. Up until now, the great state of Foo has held a lottery to help fund education… What pattern does fit here?

Answer:

  • Adapter Pattern
    Explanation: Since the change requires adjusting the interaction between the lottery system and the new random number generator, the Adapter pattern can be used to adapt the new generator to the existing lottery system without modifying the system’s core logic.

Q3. Which pattern would fit well as a solution to this system’s needs?

Answer:

  • Chain of Responsibility
    Explanation: The Chain of Responsibility pattern fits well for handling different types of actions (cleaning, repair, etc.) for items with the same profile but varying steps.

Q4. What pattern would be best here?

Answer:

  • Strategy Pattern
    Explanation: The Strategy pattern is ideal for handling different player types (human, AI) in the game, where the general structure of actions is the same, but the implementation differs.

Q5. Consider the statement “In the Strategy pattern, the context should hold references to the ConcreteStrategies.” Under what circumstances would this be true? Select all that apply.

Answer:

  • When the context is tasked with deciding which strategy to use
  • When using a Factory object to create Strategies

Explanation: The context may hold references to ConcreteStrategies when it has the responsibility of selecting a strategy or when a Factory is used to instantiate strategies.


Q6. In the Observer pattern, one difficulty is that the Subject cannot pass an instance of itself to the Observer being updated, due to circular dependencies.

Answer:

  • True
    Explanation: Circular dependencies can arise if the subject passes itself to observers, causing infinite loops or unnecessary complexity.

Q7. Once a class has had an Adapter pattern solution applied, it cannot be adapted again.

Answer:

  • False
    Explanation: The Adapter pattern can be applied multiple times if further adaptations are necessary.

Q8. Factories are no longer useful when you apply the Strategy Pattern to a family of algorithms.

Answer:

  • False
    Explanation: Factories are still useful in the Strategy pattern for creating different strategy objects dynamically.

Q9. Observer is an implementation of the Dependency Inversion principle.

Answer:

  • False
    Explanation: While the Observer pattern deals with dependencies, it doesn’t inherently follow the Dependency Inversion principle, which focuses on high-level modules not depending on low-level modules.

Q10. Strategy Pattern helps maintain the Open/Closed Principle.

Answer:

  • True
    Explanation: The Strategy pattern allows behavior to be extended without modifying the existing code, thus adhering to the Open/Closed Principle.

Q11. (UML Diagram: Instability value for the Bus class)

Answer:

  • Instability Calculation: Cannot be answered without the actual class diagram data.

Q12. (UML Diagram: Instability value for the Stop class)

Answer:

  • Instability Calculation: Cannot be answered without the actual class diagram data.

Q13. (UML Diagram: Instability value for the PassengerUnloader class)

Answer:

  • Instability Calculation: Cannot be answered without the actual class diagram data.

Q14. (UML Diagram: Instability value for the Simulator class)

Answer:

  • Instability Calculation: Cannot be answered without the actual class diagram data.

Q15. LCOM4 Calculation for the given code:

Answer:

  • LCOM4 Calculation: Based on the provided code, you would calculate the LCOM4 using the method count and how they relate to class variables. In this case, more details are required for a specific value.

Q16 – Q18. Cyclomatic complexity calculations based on control flow diagrams:

Answer:

  • Cyclomatic Complexity: Cannot be answered without the actual control flow graph data.

Engineering Practices for Building Quality Software Module 04 Quiz Answers

Quality in Implementation Quiz Answers

Q1. The logical (intended) dependency is that observer depends on subject.

  • Answer: True
    Explanation: In the Observer pattern, the observer depends on the subject to notify it of any changes.

Q2. Up until now, the great state of Foo has held a lottery to help fund education… What pattern does fit here?

  • Answer: Adapter Pattern
    Explanation: The Adapter pattern is best used here to adapt the new random number generator to the existing lottery system.

Q3. Which pattern would fit well as a solution to this system’s needs?

  • Answer: Chain of Responsibility
    Explanation: The Chain of Responsibility pattern is ideal when you have a set of actions that need to be handled differently, such as cleaning, repair, etc.

Q4. What pattern would be best here?

  • Answer: Strategy Pattern
    Explanation: The Strategy pattern works well here for handling different types of players (humans, AI) in a game, allowing for varying behavior but maintaining the same overall structure.

Q5. Consider the statement “In the Strategy pattern, the context should hold references to the ConcreteStrategies.” Under what circumstances would this be true?

  • Answer:
    • When the context is tasked with deciding which strategy to use.
    • When using a Factory object to create Strategies.

Q6. In the Observer pattern, one difficulty is that the Subject cannot pass an instance of itself to the Observer being updated, due to circular dependencies.

  • Answer: True
    Explanation: Circular dependencies should be avoided in the Observer pattern to prevent infinite loops or unnecessary complexity.

Q7. Once a class has had an Adapter pattern solution applied, it cannot be adapted again.

  • Answer: False
    Explanation: The Adapter pattern can be applied multiple times if the class needs further adaptation.

Q8. Factories are no longer useful when you apply the Strategy Pattern to a family of algorithms.

  • Answer: False
    Explanation: Factories can still be useful in the Strategy pattern for dynamically creating strategy objects.

Q9. Observer is an implementation of the Dependency Inversion principle.

  • Answer: False
    Explanation: While Observer involves dependencies between the subject and observer, it does not inherently follow the Dependency Inversion Principle, which focuses on reducing the dependency between high-level modules and low-level modules.

Q10. Strategy Pattern helps maintain the Open/Closed Principle.

  • Answer: True
    Explanation: The Strategy pattern allows new behavior to be added without modifying the existing code, adhering to the Open/Closed Principle.

Q11-Q14. (Instability calculations for UML diagrams)

  • Answer: Instability value calculations require the actual class diagram data to compute, so answers cannot be provided without the diagrams.

Q15. LCOM4 Calculation for the provided code

  • Answer: LCOM4 Calculation: Based on the code, you would need to calculate it based on method-to-variable connectivity in the class, excluding constructors.

Q16-Q18. Cyclomatic complexity calculations

  • Answer: Cyclomatic complexity cannot be calculated without the actual control flow diagrams.

Engineering Practices for Building Quality Software Module 05 Quiz Answers

Quality in Testing and Deployment Quiz Answers

Q1. The goal of test selection is to find the maximum number of tests that can be successfully run.

  • Answer: False
    Explanation: The goal of test selection is to find the relevant tests that effectively assess the functionality of the system, not to maximize the number of tests.

Q2. Randomly testing is the poorest form of testing.

  • Answer: True
    Explanation: Random testing often lacks structure and doesn’t focus on critical paths or requirements, making it less effective than other testing strategies.

Q3. The developer of the code is the best person to test that code.

  • Answer: False
    Explanation: While developers can identify defects in their code, independent testers (who were not involved in writing the code) are often better at identifying issues from a user perspective and avoid biases.

Q4. Manually created tests can use randomly selected inputs to maximize defect finding.

  • Answer: True
    Explanation: Random inputs can uncover unexpected issues that might not be covered by structured tests, but they shouldn’t be the only form of testing.

Q5. Code coverage includes statement coverage, ensuring all code statements are executed at least once by at least one test case and all tests pass.

  • Answer: False
    Explanation: Code coverage metrics like statement coverage focus on execution, but passing tests are also essential. Just achieving coverage doesn’t guarantee that tests validate correctness.

Q6. Requirements testing is difficult because the tests can’t be created until the code is written, which is quite far into the development process.

  • Answer: False
    Explanation: Requirements testing can be done early through techniques like reviews and mockups before code is written, ensuring alignment with specifications.

Q7. Program testing helps find defects, but testing cannot prove there are no bugs.

  • Answer: True
    Explanation: Testing can reveal defects but can’t guarantee that all bugs are found, as there could be undiscovered issues.

Q8. A test case is a set of inputs written to try and “break the code”, i.e. find a defect.

  • Answer: True
    Explanation: Test cases are designed to check the behavior of the system and uncover potential defects, including edge cases that could “break” the code.

Q9. Test obligations come from Structural Analysis, that is, from the code itself.

  • Answer: True
    Explanation: Structural analysis identifies test obligations by analyzing the code structure, ensuring tests cover the code’s pathways and logic.

Q10. Tests which meet the code coverage criteria can still be poor tests.

  • Answer: True
    Explanation: Code coverage doesn’t ensure the quality of tests. Tests need to verify functionality and edge cases, not just execute code.

Q11. New processes/reports are able to be added to the Jenkins Pipeline through plug-ins.

  • Answer: True
    Explanation: Jenkins supports the addition of new processes and features through plugins, making it highly customizable.

Q12. Continuous Integration alerts to submitting developer of build or test failure, but cannot remove the code committed.

  • Answer: True
    Explanation: CI systems alert developers about failures but do not automatically revert code; it’s the developer’s responsibility to correct the issues.

Q13. Continuous Integration is a subset of the capabilities in a Continuous Delivery pipeline.

  • Answer: True
    Explanation: Continuous Integration focuses on the process of integrating and testing code, whereas Continuous Delivery extends this by automating deployments.

Q14. Pushing code to production without the need for developer action is one of the primary benefits of Continuous Delivery.

  • Answer: True
    Explanation: Continuous Delivery automates the deployment pipeline, allowing code to be pushed to production without manual intervention.

Q15. The difference between Continuous Delivery and Continuous Deployment is whether the deployment of code to production is manual or automated, respectively.

  • Answer: True
    Explanation: Continuous Delivery automates the pipeline but may still require manual approval for production deployment, while Continuous Deployment automates the entire process.

Q16. Canary is a system of alerts to developers based on build, test, release and/or deployment. The alerts are similar to “tweets” as on Twitter, hence the similarity of the names.

  • Answer: False
    Explanation: Canary typically refers to a deployment strategy (canary release) where a new version is tested on a small group before a full rollout. It’s not an alert system.

Q17. Since the goal is for every test to pass, tests should only include inputs which will result in successful operation/behavior when executed on correct code.

  • Answer: False
    Explanation: Tests should also include failure scenarios to ensure that the system handles invalid inputs and edge cases correctly.

Q18. The developer should first run the tests before adding anything new, as in to ensure that all tests passed before adding any new tests or code.

  • Answer: True
    Explanation: It’s a best practice to ensure that existing tests pass before introducing new changes to avoid breaking existing functionality.

Q19. Continuous Delivery is an update to the Blue-Green Deployment paradigm.

  • Answer: False
    Explanation: Continuous Delivery is a broader concept that automates the entire deployment pipeline, while Blue-Green Deployment focuses on minimizing downtime during deployments.

Q20. Statement coverage is the strongest form of code coverage, which is why it is required for many FAA and FDA regulated software projects.

  • Answer: False
    Explanation: Statement coverage is a basic metric. Stronger coverage, like branch coverage, is often required in regulated industries to ensure that all logical paths are tested.

Sources: Engineering Practices for Building Quality Software

Get All Course Quiz Answers of Software Development Lifecycle Specialization

Software Development Processes and Methodologies Quiz Answers

Agile Software Development Coursera Quiz Answers

Lean Software Development Coursera Quiz Answers

Engineering Practices for Building Quality Software Quiz Answers

Share your love

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *