logo

Crowdly

COM-306-1-SOFTWARE ENGINEERING-Spring 2025

Looking for COM-306-1-SOFTWARE ENGINEERING-Spring 2025 test answers and solutions? Browse our comprehensive collection of verified answers for COM-306-1-SOFTWARE ENGINEERING-Spring 2025 at moodle.conncoll.edu.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

The

refactoring method that moves code to its own method is called

0%
0%
100%
0%
0%
View this question

You have

the following code:

return order.quantity * order.itemPrice -

      Math.max(0, order.quantity - 500) *

      order.itemPrice * 0.05 +

      Math.min(order.quantity * order.itemPrice * 0.1, 100);

You

refactor it so that it becomes:

const basePrice = order.quantity * order.itemPrice;

const quantityDiscount = Math.max(0, order.quantity - 500) * order.itemPrice * 0.05;

const shipping = Math.min(basePrice * 0.1, 100);

return basePrice - quantityDiscount + shipping;

What type of refactoring is this?

0%
0%
0%
100%
0%
View this question

Select

all that are examples of direct personal identifying information

100%
0%
100%
0%
0%
100%
0%
0%
100%
View this question

It is ok

to have conditional logic in a unit test

View this question

Calculate

the Halstead volume of this piece of code

a = 1

b = a + 1

c = a + 2

d = c + a / b

b = b + d – c

0%
0%
100%
0%
0%
0%
View this question

Penetration

testing

0%
100%
0%
0%
View this question

A method

that encapsulates the creation of objects is called a/an

0%
0%
0%
100%
View this question

In

testing, a piece of code that provides a simple replacement for a call to a

remote service is called a

0%
0%
0%
0%
100%
View this question

You’ve written

an interface for a new API using good self-explanatory variable and method

names.  Does this require detailed

commenting?

100%
0%
View this question

What is

the cyclomatic complexity of the following code?

def calculate_discount(price, is_member, season):

   discount = 0

   if price > 100:

      if is_member:

         if season == ‘summer’:

            discount = 0.2

         else:

            discount = 0.1

      else:

         if season == ‘winter:

            discount = 0.15

         else:

            discount = 0.05

   return price * (1 – discount)

0%
0%
0%
0%
0%
0%
100%
View this question

Want instant access to all verified answers on moodle.conncoll.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!