Understanding Code Smells in Software

Understanding Code Smells in Software

University

15 Qs

quiz-placeholder

Similar activities

Multimedia Video & Animation

Multimedia Video & Animation

University

20 Qs

Django-quiz

Django-quiz

5th Grade - University

20 Qs

Basic on Operating System

Basic on Operating System

University

10 Qs

Enterprise development - JEE

Enterprise development - JEE

University

10 Qs

DreamWeaver CS6

DreamWeaver CS6

University

20 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

CHAPTER 1: COMPUTER SECURITY REVIEW

CHAPTER 1: COMPUTER SECURITY REVIEW

University

10 Qs

Python Quiz For Starters

Python Quiz For Starters

3rd Grade - Professional Development

17 Qs

Understanding Code Smells in Software

Understanding Code Smells in Software

Assessment

Quiz

Computers

University

Practice Problem

Easy

Created by

Romualdo Bautista

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers