Engineering Practices for Building Quality Software Quiz Answers

Get All Weeks Engineering Practices for Building Quality Software Quiz Answers

Engineering Practices for Building Quality Software Quiz Answers

Week 1 Quiz Answers

Quiz 1: Quality in Design

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

  • True
  • False

Q2. Up until now, the great state of Foo has held a lottery to help fund education in the state. The corporation tasked with the drawing of these numbers (the non-televised ones) is XYZ Numerical Tasking. You are the technical lead for the system which handles the drawings for the state’s lotteries. One of your developers, with a mathematical tilt, comes to you with a proposal: change how the random numbers are generated.

He suggests that the generation of random numbers could be better. NASA has released a random number generator which has been proven to be better than the one used by the company. He suggests that you make the change.

One of your more senior developers notes that using the new generator will require a change. He suggests that the team connect the existing lotto system, as seen in Figure 1, to the new generator (Figure 2) using the Facade pattern.

Figure 1

Figure 2

Facade, which seeks to simplify complex processes for a client by providing a API which hides the complicated calls/work needed, doesn’t seem to fit.

What pattern does?

Enter answer here

Q3. Within the Custodial Management System, there are are a variety of items that are being watched at any given time. Certain items can receive notifications that a response is needed immediately (rather than just tracking whether the regular upkeep has been done that week/month/etc.). These items may then need one of several possible actions: rapid cleaning, bodily fluid containment and/or removal, addressing traction/slip-danger, urgent repair, etc. Each of these actions fit the same profile (action) but not necessarily the same steps.

Which pattern would fit well as a solution to this systems needs?

Enter answer here

Q4. Early in our proof-of-concept work on the new game we are building, we effectively hard-coded the game to ask the user what action to take next, for both players. In this case, both users are tied into a single account, so that we can play against ourselves while we build out the game.

Now, however, we want to add a new player type to the system, EasyDifficultyBot. While the “player” actions fit the same high-level format for both humans and our AI, the details of making it happen vary pretty widely.

In order to allow for this change, we want to make use of a pattern that will allow this kind of expansion while minimizing changes to the existing code.

What pattern would be best here?

Enter answer here

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.
  • Under no circumstances should the Context hold references to the ConcreteStrategies
  • When the client is tasked with deciding which strategy to use
  • When the context is tasked with deciding which strategy to use
  • When the Strategy base class uses a static method to return the correct derived type
  • 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.

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

Q11. Notes: For questions 11-14, the diagram is a standard UML Class Diagram. You can view a larger version by right clicking and selecting “View image” (or similar) or by holding on the image and selecting “Open image in new tab” (or similar) if you’re on mobile. Use up to 3 significant digits (e.g. .5 for 1/2 and .333 for 1/3 are acceptable).

For the following class diagram, calculate the Instability value for the Bus class.

Enter answer here

Q12. For the following class diagram, calculate the Instability value for the Stop class. Use up to 3 significant digits (e.g. .5 for 1/2 and .333 for 1/3 are acceptable).

Enter answer here

Q13. For the following class diagram, calculate the Instability value for the PassengerUnloader class. Use up to 3 significant digits (e.g. .5 for 1/2 and .333 for 1/3 are acceptable).

Enter answer here

Q14. For the following class diagram, calculate the Instability value for the Simulator class. Use up to 3 significant digits (e.g. .5 for 1/2 and .333 for 1/3 are acceptable).

Enter answer here

Q15. While calculating LCOM4, we ignore constructors and destructors. Constructors and destructors frequently set and clear all variables in the class, making all methods connected through these variables, which increases cohesion artificially.

LCOM4 = 1 indicates a cohesive class, which is the “good” class.

LCOM4 >= 2 indicates a problem. The class should be split into so many smaller classes.

LCOM4 = 0 happens when there are no methods in a class. This is also a “bad” class.

Calculate the value of the LCOM4 measurement for the following code:

include “src/route.h”

Route::Route(std::string name, Stop ** stops, double * distances,
int num_stops, PassengerGenerator * generator) {
//Constructors ignored in LCOM4 calculation
}

void Route::Update() {
GenerateNewPassengers();
for (std::list::iterator it = stops_.begin();

Enter answer here

  1. Cyclomatic complexity is calculated by the formula:

M = E − N + 2P,

where

E = the number of edges of the graph.

N = the number of nodes of the graph.

P = the number of connected components.

Calculate the cyclomatic complexity for the following control flow graph:

Enter answer here

Q17. Cyclomatic complexity is calculated by the formula:

M = E − N + 2P,

where

E = the number of edges of the graph.

N = the number of nodes of the graph.

P = the number of connected components.

Calculate the cyclomatic complexity for the following control flow graph:

Enter answer here

Q18. Cyclomatic complexity is calculated by the formula:

M = E − N + 2P,

where

E = the number of edges of the graph.

N = the number of nodes of the graph.

P = the number of connected components.

Calculate the cyclomatic complexity for the following control flow graph:

Enter answer here

Week 3

Quiz 1: Quality in Implementation

Q1.

class Airplane {
private:
int customerCapacity;
string _Manufacturer;
public:
Airplane (int capacity, string manufacturer);
int load_Customers(Customer *);
};
Which of the following are style errors for the code on Line 2?
  • variable name should be uppercase
  • method names should be lower case
  • order of access restrictions
  • variable should have no underscore
  • variable should have trailing underscore
  • variable name should be lowercase
  • method names should be separated by hyphens
  • variable name should not be separated
  • variable name should be separated by underscore
  • variables should be public
  • class name should be lowercase
  • method names should be CamelCase
  • method Airplane should be private
  • Spacing between elements
  • indentation

Q2.

class Airplane {
private:
int customerCapacity;
string _Manufacturer;
public:
Airplane (int capacity, string manufacturer);
int load_Customers(Customer *);
};

Which of the following are style errors for the code on Line 3?

  • method names should be separated by hyphens
  • Spacing between elements
  • method names should be lower case
  • indentation
  • class name should be lowercase
  • variable name should be separated by underscore
  • method names should be CamelCase
  • variable name should not be separated
  • variable should have trailing underscore
  • variable should have no underscore
  • variable name should be uppercase
  • order of access restrictions
  • variable name should be lowercase
  • variables should be public
  • method Airplane should be private

Q3.

class Airplane {
private:
int customerCapacity;
string _Manufacturer;
public:
Airplane (int capacity, string manufacturer);
int load_Customers(Customer *);
};

Which of the following are style errors for the code on Line 4?

  • variables should be public
  • method Airplane should be private
  • method names should be CamelCase
  • order of access restrictions
  • variable name should be separated by underscore
  • Spacing between elements
  • variable name should be uppercase
  • variable name should not be separated
  • variable should have no underscore
  • class name should be lowercase
  • variable name should be lowercase
  • method names should be lower case
  • indentation
  • variable should have trailing underscore
  • method names should be separated by hyphens

Q4.

class Airplane {
private:
int customerCapacity;
string _Manufacturer;
public:
Airplane (int capacity, string manufacturer);
int load_Customers(Customer *);
};
  • Which of the following are style errors for the code on Line 5?
  • variable name should be lowercase
  • variable should have trailing underscore
  • variable name should be uppercase
  • variables should be public
  • Spacing between elements
  • class name should be lowercase
  • variable name should not be separated
  • method names should be separated by hyphens
  • method Airplane should be private
  • order of access restrictions
  • method names should be CamelCase
  • variable should have no underscore
  • indentation
  • variable name should be separated by underscore
  • method names should be lower case

Q5.

class Airplane {
private:
int customerCapacity;
string _Manufacturer;
public:
Airplane (int capacity, string manufacturer);
int load_Customers(Customer *);
};
  • Which of the following are style errors for the code on Line 6?
  • method names should be lower case
  • Spacing between elements
  • class name should be lowercase
  • variables should be public
  • order of access restrictions
  • method names should be CamelCase
  • variable should have no underscore
  • variable should have trailing underscore
  • variable name should be separated by underscore
  • variable name should not be separated
  • method Airplane should be private
  • variable name should be lowercase
  • variable name should be uppercase
  • indentation
  • method names should be separated by hyphens

Q6.

class Airplane {
private:
int customerCapacity;
string _Manufacturer;
public:
Airplane (int capacity, string manufacturer);
int load_Customers(Customer *);
};

Which of the following are style errors for the code on Line 7?

  • variable should have no underscore
  • method Airplane should be private
  • class name should be lowercase
  • variables should be public
  • Spacing between elements
  • variable name should be separated by underscore
  • method names should be separated by hyphens
  • variable name should be lowercase
  • variable should have trailing underscore
  • order of access restrictions
  • method names should be CamelCase
  • variable name should not be separated
  • variable name should be uppercase
  • indentation
  • method names should be lower case

Q7. Using a debugger can find all defects in code.

  • True
  • False

Q8. What is created to allow a compiler to temporarily stop processing code that is being executed to allow for the developer to see current state?

  • D​ebugging break
  • D​ebugging
  • B​reakpoint
  • P​ause
  • S​toppoint

Q9. Commits should happen only at the end of a daily coding session.

  • True
  • False

Q10. Only one line of code should change per commit.

True

False

Q11. Commit messages are only helpful to you at the time you make them.

  • True
  • False

Q12. Branching aids developers seeking to work on the same code simultaneously.

  • True
  • False

Q13. Project materials are stored in a remote repository through the WebHook functionality.

  • True
  • False

Q14. Compilers perform static analysis.

  • True
  • False

Q15. Static analysis can only be performed while code is being executed.

  • True
  • False

Week 4

Quiz 1: Quality in Testing and Deployment

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

  • True
  • False

Q2. Randomly testing is the poorest form of testing.

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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.

  • True
  • False

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.

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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

  • True
  • False

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.

  • True
  • False

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.

  • True
  • False

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.

  • True
  • False

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

  • True
  • False

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

  • True
  • False
Engineering Practices for Building Quality Software Course Review:

In our experience, we suggest you enroll in Engineering Practices for Building Quality Software courses and gain some new skills from Professionals completely free and we assure you will be worth it.

Engineering Practices for Building Quality Software course is available on Coursera for free, if you are stuck anywhere between a quiz or a graded assessment quiz, just visit Networking Funda to get Engineering Practices for Building Quality Software Quiz Answers.

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

Leave a Reply

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

error: Content is protected !!