<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technical Debt &#8211; Few Steps &#8211; ก้าวสั้นๆ แต่ไปเรื่อยๆ</title>
	<atom:link href="https://myifew.com/tag/technical-debt/feed/" rel="self" type="application/rss+xml" />
	<link>https://myifew.com</link>
	<description></description>
	<lastBuildDate>Tue, 22 May 2018 04:31:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://myifew.com/wp-content/uploads/2018/07/cropped-logo6-ts-32x32.png</url>
	<title>Technical Debt &#8211; Few Steps &#8211; ก้าวสั้นๆ แต่ไปเรื่อยๆ</title>
	<link>https://myifew.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ว่าด้วยเรื่อง &#8220;หนี้ทางเทคนิค&#8221; (Technical Debt) ทำไมต้องใส่ใจ</title>
		<link>https://myifew.com/4243/technical-debt/</link>
					<comments>https://myifew.com/4243/technical-debt/#respond</comments>
		
		<dc:creator><![CDATA[iFew]]></dc:creator>
		<pubDate>Mon, 06 Nov 2017 15:09:47 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Technical Debt]]></category>
		<category><![CDATA[Ward Cunningham]]></category>
		<guid isPermaLink="false">https://myifew.com/?p=4243</guid>

					<description><![CDATA[ถ้าไม่แก้ปัญหาทางด้านเทคนิคหรือไม่ทำมันให้ดี แล้วปล่อยมันทิ้งไว้ ก็อุปมาเหมือนเป็นหนี้สะสมไปเรื่อยๆ แถมยังต้องชดใช้ดอกเบี้ยในอนาคตด้วยอีกนะ!]]></description>
										<content:encoded><![CDATA[<h2>&#8220;Technical Debt&#8221; คืออะไร</h2>
<p>&#8220;Technical Debt&#8221; ถ้าแปลตรงตัวก็คือ &#8220;หนี้ทางเทคนิค&#8221; โดยถูกใช้ครั้งแรกจากลุง <a href="https://en.wikipedia.org/wiki/Ward_Cunningham">Ward Cunningham</a> ในขณะที่ลุงทำ Software ทางด้านการเงิน ชื่อ WyCash แล้วลุงต้องการสื่อสารให้เจ้านายที่รู้เรื่องทางด้านการเงินเข้าใจว่า ถ้าไม่แก้ปัญหาทางด้านเทคนิคหรือไม่ทำมันให้ดี แล้วปล่อยมันทิ้งไว้ ก็อุปมาเหมือนเป็นหนี้สะสมไปเรื่อยๆ แถมยังต้องชดใช้ดอกเบี้ยในอนาคตด้วยอีกนะ!<span id="more-4243"></span></p>
<p style="text-align: center;"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4251 aligncenter" src="https://myifew.com/wp-content/uploads/2017/11/230px-Ward_Cunningham_-_Commons-1.jpg" alt="" width="230" height="246" />ลุง Ward Cunningham ผู้ใช้คำว่า “Technical Debt” คนแรก<br />
แกเป็น 1 ใน 17 ที่แถลงการ Agile Manifesto, เป็นหนึ่งในผู้คิด Design Pattern และ Extreme Programming</p>
<p>ดังนั้นถ้าถามว่า &#8220;หนี้ทางเทคนิค&#8221; (Technical Debt) คืออะไร คือเป็นคำอุปมาที่เทียบกับ &#8220;หนี้ทางการเงิน&#8221; (Monetary Debt) นั่นเอง</p>
<p>ลองเทียบตัวอย่างง่ายๆ ถ้า ด้านซ้ายคือเรื่องทางเทคนิค และ ด้านขวาเรื่องการเงิน</p>
<ul>
<li><strong>การไม่ออกแบบหรือละเลยคุณภาพของงาน</strong> = การกู้เงิน</li>
<li><strong>การ Refactoring Code</strong> = การคืนเงินต้น</li>
<li><strong>การพัฒนางานได้ช้าลง ด้วยความซับซ้อนที่มากขึ้น</strong> = การจ่ายดอกเบี้ยที่จะมีมากขึ้นเรื่อยๆ</li>
</ul>
<p>ดูแล้ว &#8220;Technical Debt&#8221; จะเป็นสิ่งที่ไม่ดีต่างๆ ในด้านเทคนิค ทั้งนี้เกิดได้จากหลายปัจจัย เช่น การออกแบบระบบที่ไม่ดี การเขียนโค้ดที่ไม่ดี เป็นต้น</p>
<p>พอเกิดหนี้แล้ว ยังต้องมาใช้ดอกเบี้ยตามทีหลัง เช่น ต้องใช้เวลาเพื่อแกะโค้ดแก้ไขหรือเพิ่มฟีเจอร์ใหม่ ไปจนถึงเรื่องการใช้เงินหรือคนมากขึ้นเพื่อปรับปรุงโค้ดเก่าให้มันดี</p>
<h2>&#8220;Debt&#8221; เกิดได้ทุกที่ ไม่เฉพาะ &#8220;Technical&#8221; เท่านั้น</h2>
<p>เมื่อเริ่มทำโปรเจ็ค สิ่งที่เรียกว่า &#8220;Debt&#8221; หรือ &#8220;หนี้&#8221; ก็จะเริ่มเกิดขึ้นทันที เหมือนที่ลุง Ward Cunningham ได้บอกไว้เมื่อปี 1992 ว่า</p>
<blockquote><p>&#8220;Shipping first time code is like going into debt. A little debt speeds development so long as it is paid back promptly with a rewrite&#8230; The danger occurs when the debt is not repaid. Every minute spent on not-quite-right code counts as interest on that debt. Entire engineering organizations can be brought to a stand-still under the debt load of an unconsolidated implementation, object-oriented or otherwise.&#8221;</p></blockquote>
<p>การส่งมอบโค้ดออกไปครั้งแรกก็เปรียบเหมือนการเริ่มสร้างหนี้แล้ว ..</p>
<p>แต่ทั้งนี้ก็ได้มีการไปขยายความเพิ่มเติมขึ้นว่า &#8220;หนี้&#8221; ไม่เฉพาะกับโค้ดเท่านั้น แต่มันคือจุดไหนก็ได้ที่ทำให้เกิดผลกระทบไม่ดีต่องาน เช่น</p>
<ul>
<li><strong>Architecture Debt (หนี้ทางสถาปัตยกรรม)</strong> &#8211; การใช้สถาปัตยกรรมที่ไม่มีคุณภาพ หรือไม่เหมาะสมกับตัวงาน</li>
<li><strong>Design Debt (หนี้ทางการออกแบบ)</strong> &#8211; การละเลยที่จะทำตามหลักการ การออกแบบซอร์ฟแวร์ต่างๆ</li>
<li><strong>Code Debt (หนี้ทางโค้ด)</strong> &#8211; โค้ดที่เขียนไม่ดี ซับซ้อน อ่านยากง</li>
<li><strong>Test Automation Debt (หนี้ทางการทดสอบอัตโนมัติ)</strong> &#8211; ไม่ทำ Automate Test เพื่อรองรับการส่งมอบงานให้ไว</li>
<li><strong>Maintenance Debt (หนี้ทางด้านบำรุงรักษา)</strong> &#8211; มีการปรับปรุงซอร์ฟแวร์ล่าช้า</li>
<li><strong>Defect Debt (หนี้ทาง Defect)</strong> &#8211; รู้ว่ามีข้อบกพร่องของซอร์ฟแวร์ตรงไหน แต่ไม่แก้ไข</li>
<li><strong>Documentation Debt (หนี้ทางเอกสาร)</strong> &#8211; ลืมทำเอกสาร ทำแล้วไม่พอใช้ ทำไม่เสร็จ</li>
<li><strong>People Debt (หนี้ทางบุคคล)</strong> &#8211; คนที่มาชะลอหรือขัดขวางการพัฒนาของงาน</li>
</ul>
<p style="text-align: center;"><img decoding="async" class="alignnone size-large wp-image-4248" src="https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_52_12-Research-Technical-Debt-1.0.pdf-Foxit-Reader-1200x596.png" alt="" width="1024" height="509" srcset="https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_52_12-Research-Technical-Debt-1.0.pdf-Foxit-Reader-1200x596.png 1200w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_52_12-Research-Technical-Debt-1.0.pdf-Foxit-Reader-600x298.png 600w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_52_12-Research-Technical-Debt-1.0.pdf-Foxit-Reader-1024x508.png 1024w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_52_12-Research-Technical-Debt-1.0.pdf-Foxit-Reader-768x381.png 768w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_52_12-Research-Technical-Debt-1.0.pdf-Foxit-Reader-700x348.png 700w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_52_12-Research-Technical-Debt-1.0.pdf-Foxit-Reader.png 1273w" sizes="(max-width: 1024px) 100vw, 1024px" /><br />
Reference: <a href="http://slideplayer.com/slide/9275126/">Southern Methodist University</a></p>
<h2>จะรู้ได้อย่างไรว่าเรากำลังเป็น &#8220;หนี้ทางเทคนิค&#8221; (Technical Debt)</h2>
<p>ถ้าอยากลองสังเกตว่าทีมหรือในบริษัทของเรา มีอาการเป็นหนี้ทางเทคนิคหรือไม่ ลองดูได้ เช่น</p>
<ul>
<li>Productivity ลดลง, ขาดแรงจูงใจ</li>
<li>ใช้เวลาทดสอบระบบเยอะขึ้นเรื่อยๆ (เพราะเป็น manual test นี่นะ)</li>
<li>ส่งมอบงานได้ช้า</li>
<li>มีโค้ดซ้ำกันหลายๆ จุด</li>
<li>ไม่รู้ว่าซอร์ฟแวร์ทำงานอย่างไร</li>
<li>มี Code Coverage ต่ำ</li>
<li>มีบั๊กเพิ่มขึ้นเรื่อยๆ</li>
<li>คนทำงานจะเครียดและกดดัน เมื่อใกล้ถึงเวลาส่งมอบงาน</li>
<li>คนกลัวที่จะแก้ไขโค้ด</li>
<li>ทำการ Hack ระบบตัวเอง เพราะออกแบบผิดพลาด และไม่อยากแก้ไข</li>
<li>เลือกใช้เทคโนโลยีไม่เหมาะสมกับงาน</li>
<li>โค้ดอ่านไม่รู้เรื่อง</li>
<li>ความเร็วในการทำงานของคนหรือทีมลดลง</li>
<li>ใช้ Library หรือเทคโนโลยีเก่า</li>
</ul>
<p>หากเจอตามข้อต่างๆเหล่านี้ ต้องลองหาทางปรับปรุงดูครับ เพื่อไม่ให้เกิดหนี้สะสม และดอกเบี้ยในอนาคต</p>
<h2>สาเหตุของการทำให้เกิด &#8220;หนี้ทางเทคนิค&#8221; (Technical Debt)</h2>
<p>หนี้ต่างๆ เกิดขึ้นได้จากหลายสาเหตุ ตั้งแต่เริ่มโปรเจ็ค ขณะทำ หรือแม้แต่โปรเจ็คจบแล้ว และต้องดูแลต่อ เช่น</p>
<ul>
<li>การขาดกระบวนการทำงาน ต่างคนต่างทำ</li>
<li>ไม่วางแผนการทำงานก่อน</li>
<li>แรงกดดันทางธุรกิจ</li>
<li>ไม่เข้าใจและขาดเครื่องมือสำหรับ Test</li>
<li>ไม่ทำ Refactoring Code หรือทิ้งแย่ๆไว้นานๆ</li>
<li>ไม่ทำตามมาตรฐาน</li>
<li>ขาดเอกสารที่เหมาะสม เช่น คู่มือใช้งาน, สเป็กระบบ ฯลฯ</li>
<li>ขาดความร่วมมือการทำงาน</li>
<li>ทีมไม่มีความเข้าใจในสิ่งที่จะทำ</li>
<li>ทีมขาดความรู้ในเทคโนโลยีที่จะใช้</li>
<li>ทีมไม่มีความรู้สึกเป็นเจ้าข้าวเจ้าของ</li>
</ul>
<h2>ผลกระทบ เมื่อเกิด &#8220;หนี้ทางเทคนิค&#8221; (Technical Debt)</h2>
<p>หรือจะเรียกว่ามันเป็น &#8220;ดอกเบี้ย&#8221; (Interest) ก็ได้ เพราะแม้ว่าจะชดใช้เงินต้นคืนไปบ้างแล้ว เช่น Refactoring Code ทำตาม Standard หรืออื่นๆ แต่ยังคงมีผลกระทบทางอ้อมอยู่ ไม่ว่าจะเป็นเรื่องของ คน, เงิน, เวลา, ความเสี่ยงต่อธุรกิจ, ความเสี่ยงต่อความปลอดภัยของระบบ, ขวัญกำลังใจของคนตกลงเรื่อยๆ, ลูกค้าไม่พอใจ เป็นต้น</p>
<p style="text-align: center;"><img decoding="async" class="alignnone size-large wp-image-4245" src="https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_37_56-Research-Technical-Debt-1.0.pdf-Foxit-Reader-1200x392.png" alt="" width="1024" height="335" srcset="https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_37_56-Research-Technical-Debt-1.0.pdf-Foxit-Reader-1200x392.png 1200w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_37_56-Research-Technical-Debt-1.0.pdf-Foxit-Reader-600x196.png 600w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_37_56-Research-Technical-Debt-1.0.pdf-Foxit-Reader-1024x335.png 1024w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_37_56-Research-Technical-Debt-1.0.pdf-Foxit-Reader-768x251.png 768w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_37_56-Research-Technical-Debt-1.0.pdf-Foxit-Reader-700x229.png 700w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-20_37_56-Research-Technical-Debt-1.0.pdf-Foxit-Reader.png 1310w" sizes="(max-width: 1024px) 100vw, 1024px" /><br />
Reference: <a href="http://slideplayer.com/slide/9275126/">Southern Methodist University</a></p>
<h2>แล้วจะลด &#8220;หนี้ทางเทคนิค&#8221; (Technical Debt) ได้อย่างไร</h2>
<p>วิธีการลดหนี้ หรือป้องกันหนี้ทางเทคนิค สามารถทำได้หลายวิธี</p>
<p><strong>อย่าก่อหนี้</strong></p>
<ul>
<li>ไปหาความรู้และนำ engineering practice ต่างๆ มาใช้ เช่น
<ul>
<li>Clean Code</li>
<li>Pair programming</li>
<li>นำ Test-Drivent Development (TDD) มาใช้</li>
<li>ทำ Unit Testing และ Code Coverage</li>
<li>Refactoring Code สม่ำเสมอ</li>
</ul>
</li>
<li>การจัดการกระบวนการทำงาน เช่น
<ul>
<li>มี Review Code</li>
<li>วางแผนก่อนทำงานร่วมกัน</li>
<li>ออกแบบสถาปัตยกรรมก่อนทำงาน</li>
<li>เลือกใช้ Technology ให้เหมาะสม</li>
</ul>
</li>
</ul>
<p><strong>แล้วถ้าเป็นหนี้ จะทำอย่างไร?</strong></p>
<ul>
<li>หาจุดที่แย่ (หนี้) ให้เจอซะก่อน เช่น ใช้ซอร์ฟแวร์ <a href="https://myifew.com/4139/continuous-code-quality-with-sonarqube/">SonarQube ตรวจสอบคุณภาพโค้ด</a></li>
<li>หาความรู้และนำ Engineering Practice ต่างๆ มาใช้</li>
<li>ให้เวลากับมัน ค่อยๆ ปรับปรุงโค้ดแย่ๆ (ลดหนี้) ไปเรื่อยๆ</li>
<li>ถ้าเจอโค้ดแย่ๆ ให้ปรับปรุงทันที</li>
<li>จัดลำดับการปรับปรุงโค้ด ว่าอะไรสำคัญ ต้องทำก่อน-หลัง</li>
<li>ทำ Automate Testing</li>
</ul>
<h2>สรุป</h2>
<p>หลังจากรู้จัก Technical Debt กันแล้ว รู้ว่ามันเป็นผลเสียมากกว่าผลดี ดังนั้น ทางเลือกก็มีแค่ 2 ทาง คือ จะยอมใช้เวลาเพื่อทำของให้มันดี หรือ จะรีบร้อนแล้วได้ของไม่ดีกลับไป ข้อนี้เป็นหน้าที่ของทีม ที่จะต้องทำและป้องกันอย่าให้เกิด และจะต้องไปขายไอเดียให้กับผู้หลักผู้ใหญ่ต่อไป ว่าทำไม เราไม่ควรเป็นหนี้&#8230;</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4252" src="https://myifew.com/wp-content/uploads/2017/11/2560-11-06-22_01_42-Research-Technical-Debt-1.0.pdf-Foxit-Reader.png" alt="" width="908" height="742" srcset="https://myifew.com/wp-content/uploads/2017/11/2560-11-06-22_01_42-Research-Technical-Debt-1.0.pdf-Foxit-Reader.png 908w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-22_01_42-Research-Technical-Debt-1.0.pdf-Foxit-Reader-600x490.png 600w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-22_01_42-Research-Technical-Debt-1.0.pdf-Foxit-Reader-768x628.png 768w, https://myifew.com/wp-content/uploads/2017/11/2560-11-06-22_01_42-Research-Technical-Debt-1.0.pdf-Foxit-Reader-700x572.png 700w" sizes="auto, (max-width: 908px) 100vw, 908px" /></p>
<p><strong>Reference</strong></p>
<ul>
<li>Ward Cunningham &#8211; <a href="https://en.wikipedia.org/wiki/Ward_Cunningham">https://en.wikipedia.org/wiki/Ward_Cunningham</a></li>
<li><a href="http://wiki.c2.com/?ComplexityAsDebt">http://wiki.c2.com/?ComplexityAsDebt</a></li>
<li><a href="https://www.agilealliance.org/introduction-to-the-technical-debt-concept/">https://www.agilealliance.org/introduction-to-the-technical-debt-concept/</a></li>
<li><a href="https://en.wikipedia.org/wiki/Technical_debt">https://en.wikipedia.org/wiki/Technical_debt</a></li>
<li><a href="http://slideplayer.com/slide/9275126/">http://slideplayer.com/slide/9275126/</a></li>
<li><a href="https://www.slideshare.net/slideshare4tushar/technical-debt-info-graphic">https://www.slideshare.net/slideshare4tushar/technical-debt-info-graphic</a></li>
<li><a href="http://www.slideshare.net/lemiorhan/technical-debt-do-not-underestimate-the-danger">http://www.slideshare.net/lemiorhan/technical-debt-do-not-underestimate-the-danger</a></li>
<li><a href="http://www.somkiat.cc/technical-debt/">http://www.somkiat.cc/technical-debt/</a></li>
<li>header image &#8211; <a href="https://www.illinoispolicy.org/chicagos-63-billion-debt-burden/">https://www.illinoispolicy.org/chicagos-63-billion-debt-burden/</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://myifew.com/4243/technical-debt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
