Understanding Code Smells in Software

Understanding Code Smells in Software

University

15 Qs

quiz-placeholder

Similar activities

Laboratory - Week 10 – 11 Facade Pattern

Laboratory - Week 10 – 11 Facade Pattern

University

20 Qs

Post-Test CoR AdvProg

Post-Test CoR AdvProg

University

10 Qs

String manipulation and Encapsulation

String manipulation and Encapsulation

University

15 Qs

Object-Oriented Software Engineering Quiz

Object-Oriented Software Engineering Quiz

University

20 Qs

4thQuarter Review Comprog 2

4thQuarter Review Comprog 2

11th Grade - University

20 Qs

Object Oriented Programming Assessment 1

Object Oriented Programming Assessment 1

University

15 Qs

MODULE 5

MODULE 5

University

20 Qs

STM 20483 QUIZ 1

STM 20483 QUIZ 1

University

10 Qs

Understanding Code Smells in Software

Understanding Code Smells in Software

Assessment

Quiz

Computers

University

Easy

Created by

Romualdo Bautista

Used 3+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a "code smell" in software development?

A syntax error in the code

A security vulnerability in the system

An indicator of a deeper problem in the codebase

A runtime exception

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a common cause of "Duplicate Code" smell?

Using polymorphism to extend functionality

Copying and pasting the same logic in multiple places

Using inheritance to share behavior

Applying encapsulation principles

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the recommended approach to eliminate "Long Methods"?

Increase the number of parameters to make the method more flexible

Split the method into smaller, single-responsibility methods

Use global variables to manage method complexity

Store all logic in a single utility function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a characteristic of "Shotgun Surgery"?

One class has too many responsibilities

Changing one functionality requires modifying multiple classes

A class inherits unnecessary methods from a parent class

A class contains too many instance variables

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can "Feature Envy" be resolved?

Move the method to the class that contains the data it heavily interacts with

Create additional helper methods to access the required data

Use global variables to reduce dependency on specific classes

Convert the method into a static utility function

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary issue with "Long Parameter Lists"?

They make it difficult to call the method correctly

They improve code readability

They enhance encapsulation

They reduce code duplication

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which principle helps avoid "Divergent Change"?

Separation of Concerns

Law of Demeter

DRY (Don't Repeat Yourself)

Singleton Pattern

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?