Midterm Study Guide: Code Smells & OO Design

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

1/22

flashcard set

Earn XP

Description and Tags

These flashcards cover key concepts and definitions related to code smells and object-oriented design principles for the midterm exam.

Last updated 6:15 AM on 4/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

23 Terms

1
New cards

Code Smells

Indicators of potential problems in the code, caused primarily by poor design.

2
New cards

Open-Closed Principle (OCP)

Software entities should be OPEN for extension but CLOSED for modification.

3
New cards

Lazy Class

A class with so little functionality it doesn't justify its existence.

4
New cards

Divergent Change

One class is modified for many different, unrelated reasons.

5
New cards

Shotgun Surgery

A single logical change requires making many small edits across different classes.

6
New cards

Feature Envy

A method/class relies more on another class's data and methods than its own.

7
New cards

Inappropriate Intimacy

Two classes are tightly coupled—one knows too much about the other's internals.

8
New cards

Bad Naming

Variables/methods/classes have unclear, misleading, or overly abbreviated names.

9
New cards

Long Methods

Methods that exceed ~15 lines and do too many things at once.

10
New cards

Large Classes

Classes with too many methods/responsibilities.

11
New cards

Duplicated Code

Same or very similar code appearing in multiple places.

12
New cards

Dead Code

Code that is never executed or whose result is never used.

13
New cards

Magic Numbers

Hard-coded numeric literals instead of named constants.

14
New cards

Message Chaining

A series of method calls chained together, violating the Law of Demeter.

15
New cards

Primitive Obsession

Overusing primitive data types instead of creating small objects.

16
New cards

Data Clumps

Groups of variables that are always passed together and should be encapsulated in an object.

17
New cards

Technical Debt

Accumulation of code smells and shortcuts ignored over time.

18
New cards

Single Responsibility Principle (SRP)

A class should have only ONE reason to change.

19
New cards

Liskov Substitution Principle (LSP)

Subtypes must be substitutable for their base types without breaking behavior.

20
New cards

Interface Segregation Principle (ISP)

Clients should not be forced to depend on interfaces they do not use.

21
New cards

Dependency Inversion Principle (DIP)

High-level modules should not depend on low-level modules; both should depend on abstractions.

22
New cards

High Cohesion

The degree to which the responsibilities of a class are related or focused.

23
New cards

Low Coupling

The degree to which classes are independent; changes in one do not affect others.