1/52
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
The goal of test selection is to find the maximum number of tests that can be successfully run.
A.True
B. False
B
Randomly testing is the poorest form of testing.
A. True
B. False
B
The developer of the code is the best person to test that code.
A. True
B. False
B
Manually created tests can use randomly selected inputs to maximize defect finding.
A. True
B. False
B
Code coverage includes statement coverage, ensuring all code statements are executed at least once by at least one test case and all tests pass.
A. True
B. False
A
Requirements testing is difficult because the tests can't be created until the code is written, which is quite far into the development process.
A. True
B. False
B
Program testing helps find defects, but testing cannot prove there are no bugs.
A. True
B. False
A
A test case is a set of inputs written to try and "break the code", i.e. find a defect.
A. True
B. False
B
Test obligations come from Structural Analysis, that is, from the code itself.
A. True
B. False
B
Tests which meet the code coverage criteria can still be poor tests.
A. True
B. False
A
New processes/reports are able to be added to the Jenkins Pipeline through plug-ins.
A. True
B. False
A
Continuous Integration alerts to submitting developer of build or test failure, but cannot remove the code committed.
A. True
B. False
B
Continuous Integration is a subset of the capabilities in a Continuous Delivery pipeline.
A. True
B. False
A
Pushing code to production without the need for developer action is one of the primary benefits of Continuous Delivery.
A. True
B. False
B
The difference between Continuous Delivery and Continuous Deployment is whether the deployment of code to production is manual or automated, respectively.
A. True
B. False
A
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.
A. True
B. False
B
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.
A. True
B. False
B
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.
A. True
B. False
A
Continuous Delivery is an update to the Blue-Green Deployment paradigm.
A. True
B. False
B
Statement coverage is the strongest form of code coverage, which is why it is required for many FAA and FDA regulated software projects.
A. True
B. False
B
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?
A. variable name should not be separated
B. method Airplane should be private
C. variable should have trailing underscore
D. Spacing between elements
E. order of access restrictions
F. variable name should be separated by underscore
G. variables should be public
H. method names should be lower case
I. method names should be CamelCase
J. method names should be separated by hyphens
K. indentation
L. variable name should be lowercase
M. variable name should be uppercase
Nclass name should be lowercase
O. variable should have no underscore
E, K
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?
A. variable should have trailing underscore
B. variable name should be separated by underscore
C. order of access restrictions
D. method names should be lower case
E. variable name should not be separated
F. indentation
G. method names should be separated by hyphens
H. variables should be public
I. variable should have no underscore
J. method Airplane should be private
K. class name should be lowercase
L. Spacing between elements
M. variable name should be uppercase
N. method names should be CamelCase
O. variable name should be lowercase
A, B, L, O
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?
A. variable should have no underscore
B. method names should be separated by hyphens
C. class name should be lowercase
D. variable name should be uppercase
E. method Airplane should be private
F. variable name should be lowercase
G. variable name should not be separated
H. variable should have trailing underscore
I. method names should be lower case
J. Spacing between elements
K. indentation
L. variable name should be separated by underscore
M. order of access restrictions
N. variables should be public
Omethod names should be CamelCase
F, H
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?
A. order of access restrictions
B. indentation
C. variables should be public
D. variable name should be lowercase
E. variable should have trailing underscore
F. method Airplane should be private
G. variable name should be separated by underscore
H. class name should be lowercase
I. variable name should not be separated
J. Spacing between elements
K. variable should have no underscore
L. method names should be CamelCase
M. method names should be separated by hyphens
N. variable name should be uppercase
O. method names should be lower case
A, B
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?
A. method names should be lower case
B. variable name should be uppercase
C. variable should have no underscore
D. variable name should be separated by underscore
E. indentation
F. variable name should be lowercase
G. variable name should not be separated
H. method Airplane should be private
I. order of access restrictions
J. variables should be public
K. class name should be lowercase
L. Spacing between elements
M. variable should have trailing underscore
N. method names should be CamelCase
O. method names should be separated by hyphens
L
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?
A. method names should be separated by hyphens
B. variable name should be lowercase
C. variable name should not be separated
D. indentation
E. method names should be CamelCase
F. variable should have no underscore
G. method names should be lower case
H. variable should have trailing underscore
I. class name should be lowercase
J. Spacing between elements
K. variables should be public
L. variable name should be uppercase
M. variable name should be separated by underscore
N. method Airplane should be private
O. order of access restrictions
E
Using a debugger can find all defects in code.
A. True
B. False
B
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?
(NOT YET)
(NOT YET)
Commits should happen only at the end of a daily coding session.
A. True
B. False
B
Only one line of code should change per commit.
A. True
B. False
B
Commit messages are only helpful to you at the time you make them.
A. True
B. False
B
Branching aids developers seeking to work on the same code simultaneously.
A. True
B. False
A
Project materials are stored in a remote repository through the WebHook functionality.
A. True
B. False
B
Compilers perform static analysis.
A. True
B. False
A
Static analysis can only be performed while code is being executed.
A. True
B. False
B
The logical (intended) dependency is that observer depends on subject.
A. True
B. False
A
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.
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?
Adapter
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?
Observer
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?
Strategy
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.
A. When the client is tasked with deciding which strategy to use
B. When using a Factory object to create Strategies
C. When the Strategy base class uses a static method to return the correct derived type
D. Under no circumstances should the Context hold references to the ConcreteStrategies
E. When the context is tasked with deciding which strategy to use
E
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.
A. True
B. False
B
Once a class has been had an Adapter pattern solution applied, it cannot be adapted again.
A. True
B. False
B
Factories are no longer useful when you apply the Strategy Pattern to a family of algorithms.
A. True
B. False
B
Observer is an implementation of the Dependency Inversion principle.
A. True
B. False
A
Strategy Pattern helps maintain the Open/Closed Principle.
A. True
B. False
A
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.
.714
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).
.333
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).
.5
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).
(Not Yet)
(Not Yet)
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
it != stops_.end(); it++) {
(*it)->Update();
}
}
bool Route::IsAtEnd() const {
return destination_stop_index_ >= num_stops_;
}
void Route::NextStop() {
destination_stop_index_++;
if (destination_stop_index_ < num_stops_) {
std::list
std::advance(iter, destination_stop_index_);
destination_stop_ = *iter;
} else {
destination_stop_ = (*stops_.end());
}
}
Stop * Route::GetDestinationStop() const {
return destination_stop_;
}
double Route::GetTotalRouteDistance() const {
int total_distance = 0;
for (std::list
iter != distances_between_.end();
iter++) {
total_distance += *iter;
}
return total_distance;
}
double Route::GetNextStopDistance() const {
std::list
std::advance(iter, destination_stop_index_-1);
return iter; // resolving the iterator gets you the Stop from the list
}
int Route::GenerateNewPassengers() {
// returning number of passengers added by generator
return generator_->GeneratePassengers();
}
2
Question 16:
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:
3
Question 17:
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:
4
Question 18:
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:
4