Thẻ ghi nhớ: SWE201c - SP21 (Engineering Practices for Building Quality Software) | Quizlet

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/52

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:40 AM on 5/22/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

53 Terms

1
New cards

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

A.True

B. False

B

2
New cards

Randomly testing is the poorest form of testing.

A. True

B. False

B

3
New cards

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

A. True

B. False

B

4
New cards

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

A. True

B. False

B

5
New cards

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

6
New cards

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

7
New cards

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

A. True

B. False

A

8
New cards

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

9
New cards

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

A. True

B. False

B

10
New cards

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

A. True

B. False

A

11
New cards

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

A. True

B. False

A

12
New cards

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

A. True

B. False

B

13
New cards

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

A. True

B. False

A

14
New cards

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

A. True

B. False

B

15
New cards

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

16
New cards

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

17
New cards

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

18
New cards

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

19
New cards

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

A. True

B. False

B

20
New cards

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

21
New cards

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

22
New cards

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

23
New cards

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

24
New cards

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

25
New cards

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

26
New cards

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

27
New cards

Using a debugger can find all defects in code.

A. True

B. False

B

28
New cards

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)

29
New cards

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

A. True

B. False

B

30
New cards

Only one line of code should change per commit.

A. True

B. False

B

31
New cards

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

A. True

B. False

B

32
New cards

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

A. True

B. False

A

33
New cards

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

A. True

B. False

B

34
New cards

Compilers perform static analysis.

A. True

B. False

A

35
New cards

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

A. True

B. False

B

36
New cards

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

A. True

B. False

A

37
New cards

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

38
New cards

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

39
New cards

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

40
New cards

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

41
New cards

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

42
New cards

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

A. True

B. False

B

43
New cards

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

A. True

B. False

B

44
New cards

Observer is an implementation of the Dependency Inversion principle.

A. True

B. False

A

45
New cards

Strategy Pattern helps maintain the Open/Closed Principle.

A. True

B. False

A

46
New cards

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

47
New cards

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

48
New cards

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

49
New cards

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)

50
New cards

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();

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::const_iterator iter = stops_.begin();

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::const_iterator iter = distances_between_.begin();

iter != distances_between_.end();

iter++) {

total_distance += *iter;

}

return total_distance;

}

double Route::GetNextStopDistance() const {

std::list::const_iterator iter = distances_between_.begin();

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

51
New cards

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

52
New cards

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

53
New cards

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