Clean Code



Download 3,58 Mb.
Pdf ko'rish
bet265/384
Sana05.04.2022
Hajmi3,58 Mb.
#530298
1   ...   261   262   263   264   265   266   267   268   ...   384
Bog'liq
Clean Code

Chapter 16: Refactoring 
SerialDate
Interestingly the code coverage in 
DayDate
has
decreased
to 84.9 percent! This is not
because less functionality is being tested; rather it is because the class has shrunk so much
that the few uncovered lines have a greater weight. 
DayDate
now has 45 out of 53 execut-
able statements covered by tests. The uncovered lines are so trivial that they weren’t worth
testing.
Conclusion
So once again we’ve followed the Boy Scout Rule. We’ve checked the code in a bit cleaner
than when we checked it out. It took a little time, but it was worth it. Test coverage was
increased, some bugs were fixed, the code was clarified and shrunk. The next person to
look at this code will hopefully find it easier to deal with than we did. That person will also
probably be able to clean it up a bit more than we did. 
Bibliography
[GOF]:
Design Patterns: Elements of Reusable Object Oriented Software
, Gamma et al.,
Addison-Wesley, 1996.
[Simmons04]:
Hardcore Java
, Robert Simmons, Jr., O’Reilly, 2004.
[Refactoring]:
Refactoring: Improving the Design of Existing Code
, Martin Fowler et al.,
Addison-Wesley, 1999. 
[Beck97]:
Smalltalk Best Practice Patterns
, Kent Beck, Prentice Hall, 1997.


285
17
Smells and Heuristics
In his wonderful book 
Refactoring
,
1
Martin Fowler identified many different “Code
Smells.” The list that follows includes many of Martin’s smells and adds many more of my
own. It also includes other pearls and heuristics that I use to practice my trade.
1.
[Refactoring].


286

Download 3,58 Mb.

Do'stlaringiz bilan baham:
1   ...   261   262   263   264   265   266   267   268   ...   384




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish