Posts tagged programming

คุณว่าอยากจะเขียนยูนิตเทสรึ

เรื่อง : คุณอยากจะเขียนยูนิตเทสอย่างนั้นรึ
Translated from : So You Wanna Write A Unit Test
Author : Russ Olsen
Thanks to Russ who allow me to translate his blog here
Russ is also the author of Design Patterns in Ruby

ผมเห็นนักพัฒนา (developers) หลายๆคน มองการเขียนยูนิตเทส ในทำนองเดียวกับที่ นักบุญออกัสตินคิดต่อการสำรวมในกาม: ข้าแต่พระเจ้า ประทานพลังแก่ข้าในการเขียนยูนิตเทสเถิด, แต่ยังก่อนอย่าพึ่งเป็นตอนนี้. เรารู้ดีว่าเราควรจะเขียนยูนิตเทส แต่เราก็คอยแต่จะผัดผ่อนมันเรื่อยมา ต่อไปนี้เป็น 5 ประการที่พึงท่องไว้ในใจ ขณะที่คุณพยายามสร้างความมุ่งมั่นในการเขียนเทส
1. อย่าเสียเวลาไปทั้งวัน
ยูนิตเทสที่ใช้เวลาประมวลผลหนึ่งชั่วโมง จะถูกประมวลผลอย่างมากสุด ชั่วโมงละหนึ่งครั้ง นี่ไม่ได้ล้อเล่นนะ [...]

Inversion of Control and Dependency Injection are not the same

The term IOC (Inversion of Control) and DI (Dependency Injection) have often been used interchangeably. Both concepts have been around in software design for a long time and just have became in spotlight recently due to, I guess, the concept of decoupling software components to increase maintainability , make cleaner code and encourage unit-testing has [...]