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
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?
Select all that are examples of direct personal identifying information
It is ok to have conditional logic in a unit test
Calculate the Halstead volume of this piece of code
a = 1b = a + 1c = a + 2d = c + a / bb = b + d – c
Penetration testing
A method that encapsulates the creation of objects is called a/an
In testing, a piece of code that provides a simple replacement for a call to a remote service is called a
You’ve written an interface for a new API using good self-explanatory variable and method names. Does this require detailed commenting?
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)
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!