Simple Review of Clean Code : ±… ´ë¦°½”ë“œ 간단 리뷰

  • View
    554

  • Download
    7

Embed Size (px)

Text of Simple Review of Clean Code : ±…...

Clean Code

WTFs/MINUTE

JoLet There Be Code!

, ! . . . . !

.

.

.

BUT

.

.

.

SRP(The Single Responsibility Principle)OCP(The Open Closed Principle)LSP(The Leskov Substitution Principle)DIP(The Dependency Inversion Principle)ISP(The Interface Segregation Principle)

SRP ,

OCP

LSP .

DIP , .

ISP .

int d; // (: ) - int elapsedTimeInDays;

XYZControllerForEfficientHandlingOfStringsXYZControllerForEfficientStorageOfStrings

s getActiveAccount();getActiveAccounts();getActiveAccountInfo();

s genymdhms (generate date, year, month, day, hour, minute, second)

s ( )

1

2

. . .

!

.

0, 1 2.3 . 4 . .

Boolean Parameter is ugly.

.

W. , P.J. . .

.

.

.

, !

s TODO

s ///////// HERE ///////////

. , .

.

TDD

One Assert Per One Test

TDD 3 : . : . : .

. , , .

3 ., ,

given-when-thenprecondition-invocation-assertion

Assertion One Assertion Per One Test Function

F.I.R.S.TFast-Independent-Repeatable-Self-Validating-Timely-

.

Processor, Manager, Super .

.

.

- .

DIP -

, . .

END

ReferenceClean Code