ãã¡ãã®è¬æ¼æã«ããã ãã質åã¸ã®åçã§ãã
ããã¹ãèªååã¨ãã¹ãé§åéçºãè¬æ¼è³æ - ãã£ã¨ãã§ã½ã
質å7. TDDå°å ¥ã«é¢ãã質åã§ãã å®éã«ãã¹ãé§åã®å ´åã¯ãæåã®ãªãªã¼ã¹æã¯ä»¥åã«æ¯ã¹ãã¨å·¥æ°ãè²»ç¨ã¯ããããéç¨ä¿å®ã¾ã§èãã¦å¹æãã§ã¦ããã¯ããæåã®ãªãªã¼ã¹æã®è²»ç¨ã¯ã©ããã¦ãä¸ããããã§ãã ããã顧客ã«èª¬æããã¨ãã®èãæ¹ãä½æ¦ãæ¿æ²»ããªã©ãæ°ã«ãªãã¾ããä»ç¤¾å°å ¥æã®å·¥å¤«ãªã©äºä¾ã¯ããã¾ããï¼
é£ãã質åã§ããâ¦ã質åãããã¨ããããã¾ããåæã¨ãããããã¯ãã®ç¶æ³ã«ãã£ã¦ãèãæ¹ãå¤ãã£ã¦ããã¨æãã¾ããã1.åæéçºãªãããã¹ãé§åéçºã§å·¥æ°ãå¢ãããã¨ã¯ããã¾ããã2.æ¢åã·ã¹ãã ã®åéçºããä¿å®éç¨ã§ã¯ãå è¡æè³ãå¿ è¦ã«ãªãã¾ãããããã«ãã¦ãã3.ä¸äººåã«ä½æ¥ã§ããªããªããããã¯ä»äºã§ãã£ã¦å¤§ä¸å¤«ï¼ã¨ãã話ã«ãªãã¾ããããå°ã詳ãã説æãã¾ãã
æ°è¦éçºãªãã·ã³ãã«
æ°ããªã½ããã¦ã§ã¢ãæ°è¦éçºãã(1.)ã¨ãã幸éãªç¶æ³ã§ã¯ãæåãããã¹ãé§åéçºãå°å ¥ããã®ããã¹ãã§ããåã«ãã¹ããèªååã§ããã ãã§ãªããç®ã®åã®ä»äºãããå質ããå®è£ ãã¦ãããã®ã§ãé²ã¿ã¯éããªãã¾ããããããã°ãåãã¹ãã§åãããå·¥æ°ãæ¸ãã¾ããã¹ã©ã¤ãã§ã¯ãã¡ãã®ãã¼ã¿ãç´¹ä»ãã¾ãã(ã¹ã©ã¤ã81)ã
ããããããã¹ãé§åéçºã使ãããªãã人ã§ããã°ãããããã¾ã£ãã使ããªããã¨ããé¸æè¢ã¯ããã¾ããããããã¶ãã¹ãé§åã§æ¸ãããé¨åçã«ãã¹ãé§åã§æ¸ããã¨ãã£ãé¸æè¢ãããã¾ãããå®è£ ããé¨å(ããã³ããããã¯ã¨ã³ããããã¸ãã¹ãã¸ãã¯ããã¤ã©ã¼ãã¬ã¼ããããã¬ã¼ã ã¯ã¼ã¯ãå©ç¨ãããã©ããããªã©)ã§ãæé©ãªã¢ããã¼ããéãã¾ãããããã«ã¬ããã»ã°ãªã¼ã³ã»ãªãã¡ã¯ã¿ãªã³ã°ã®ãµã¤ã¯ã«ãå®ã度åãã調ç¯ã§ãã¾ããã«ã¼ã«åãããªããããããã¯ãã³ã¼ãã«ã¯ãã¹ãã³ã¼ããæ¸ããã¿ã¹ã¯å®äºæ(ã³ãããããã«ãªã¯ã¨ã¹ããã³ã¼ãã¬ãã¥ã¼ä¾é ¼ãªã©)ã«ã¯ãå¿ ã両æ¹æã£ã¦ãã¦ãã¹ãã¯ã°ãªã¼ã³ã§ãããã¨ãã¨ããããããããããããã¾ãããçç·´è ã§ããã°ç¶æ³ã«ãã£ã¦é¸æè¢ãé¸ã¹ãã®ã§ãå¿ ãããå³å¯ã«ãã¹ããå ã«æ¸ããªãã¦ãããµã¤ã¯ã«ã大ãã1æ¥1åãããåãã®ã§ããã¡ããã¨ããçµæãåºãã¾ã(ããã¯åç´è ã¯çä¼¼ããªãã»ããããã§ã)ã
åç°å人æ°(ã¿ã¯ã¼ãºã¯ã¨ã¹ã)ã®è¬æ¼ã質ã¨ã¹ãã¼ããã§ã¯ãã³ã¼ãã«å¯¾ããã¹ããæ¸ãã¦ããããªç¶æ ãç¶æãããã¨ããéçºã¹ãã¼ãã®åä¸ã«ã¤ãªããã¨ãã話ãç¹°ãè¿ãããã¦ãã¾ããã¾ãMartin Fowlerã®è¨èã¨ãã¦ããå質ã®ä½ãã³ã¼ãã¯ãæ°é±éã§ã¹ãã¼ããå¤§å¹ ã«é ããã¦ãã¾ãã(âDevelopers find poor quality code significantly slows them down within a few weeks.â)ã¨ç´¹ä»ãã¦ãã¾ãããã¡ãã®ã¹ã©ã¤ãã¯ãéçºã¹ãã¼ãã«é¢ããéè¦ãªç¥è¦ãå«ãã§ãããèªãã§ã¿ãã®ããå§ããã¾ãã
åéçºãä¿å®éç¨ã¯å·¥å¤«ãå¿ è¦
ãã¦ãæ°è¦éçºã§ã¯ãªããæ¢åã·ã¹ãã ãä¿å®éç¨ã®å ´å(2.)ã¯è©±ãå¤ãã£ã¦ãã¾ãããã¾ãããã¹ããèªååããã¨ããããªãé大ãªå è¡æè³ãå¿ è¦ã«ãªãããã§ãããã®è² æ ãã¾ããã¨ä¸æ¬ã§é¡§å®¢ã«æ±ããã®ã¯ãããªãé£ããã¨æãã¾ãã
ã²ã¨ã¤ã®ã¢ããã¼ãã¯ãç´°ãé·ããã¹ãèªååãå é¨ã§é²ãã¦ãããå¾ã ã«å é¨ã®å·¥æ°ãæ¸ã£ã¦ããå¹æããããã¨ãããã®ã§ããç´°ãé·ãå·¥æ°ã確ä¿ããªãã¨ãããªã話ã§ã¯ããã®ã§ãå³ããé¢ãããã¨ã¯æãã¾ãããã£ã½ããç¾å ´ã®ã¡ã³ãã¼ãä½åããã¦ãTDDããã¹ãèªååããã£ã¦ã¿ããã¨ããã¢ããã¼ã·ã§ã³ããã£ã¦ãä»äºã®ä¸ã§æéãæ»åºãã¦èªä¸»çã«é²ããã¨ããã®ã¯ãããè¦ã姿ã§ã(å·¥æ°ã確ä¿ãã¦ãããããªãã®ã¯ãã©ãã¯é¢¨å³ã§ã¯ããã¾ã)ãçµç¹ã®å ±éäºç®ã®ãããªã¨ãããããæ¦ç¥çã«ã©ããã®ãã¼ã ã«æè³ããã¨ããé¸æè¢ããããããããã¾ãããäºç®(å·¥æ°)確ä¿ã§ãã£ãããã¹ãã«ããã¡ã³ãã¼ããã£ã¦æ¥ã¦ãã¼ãã¿ã¤ã ã§æä¼ã£ã¦ããããªã©ã§ãã
ããããæè³ã§ãã
3çªç®ã®è«ç¹ã¯ããã¹ãé§åéçºãèªååãåãã¦ã§ããã¨ãã人ã«ã客æ§ã®ä»äºããããã®ã§ããããï¼ã¨ãã話ã§ã(3.)ãããã¯éçºãµã¤ãããè¦ãã¨æè³ã§ããéçºæ©æãææ°åããããæªç¥ã®è¨èªãåå¼·ããããæ°ããã¯ã©ã¦ãã¢ã¼ããã¯ãã£ã試ãã¦ã¿ãã¨ããã®ã¨ãåãæå³ã§æè³ã§ããããããæè³ã®è©±ãã客æ§ã¨ã§ããé¢ä¿æ§ãªã®ã§ããã°ããã²èª¬æãã¦ããã ããã°ã¨æãã¾ã(ã³ã³ãµã«çå½¹å²ã§èª¬æã®ãæä¼ããã§ããããããã¾ãã)ã
æè³ãã客æ§ã«æ±ããããç¶æ³ã«ãªãã®ã§ããã°ãåãã¦ã®ãã¹ãèªååãããã¸ã§ã¯ãã®äºç®ã§ããããã«ã¯ãããªãã§ããããåå¼·ãç·´ç¿ã®å·¥æ°ã¯å¥é確ä¿ãã¦ãã¡ããã¨ä»äºã§ä½¿ããããã«ãªã£ã¦ããä»äºã§ä½¿ãã¨ããæµãã«ãªãã¾ããã¹ã¯ã©ã ãå°å ¥ãã¦ãã¡ããã¨æ¹åãã¾ããã¦ãããã¼ã ã§ããã°ãæ¹åãããã¨ããæéã確ä¿ãã¦ããã¯ããªã®ã§ããã®ä¸ã§åå¼·ã»ç·´ç¿ããããã¨ã«ãªãã¾ãã
åå¼·ã¨ç·´ç¿ãããã®ã¯ãããªã«é·ãæéã§ã¯ãªãã¦å¤§ä¸å¤«ã§ããããåå¼·ã ãã®æéã1é±é(40æé)ãã£ããç´ æ´ãããã§ãããããã¾ã§ãããªãã¦ãããã£ããã§ããããã«ã¯ãªãã¨æãã¾ããããããã¯ä»äºã®ä¸ã§ãã£ã¦ãããã¨ã«ãªãã¾ãããæ¸ããã¹ãã®ç¨®é¡ãããã¬ã¼ã ã¯ã¼ã¯ã®åãæ±ãããã¼ã¿ãã¼ã¹ã®æ±ããªã©ãèªåãã¡ã®ãããã¯ãã®ç°å¢ã§å¿ è¦ã«ãªãããæ¹ã調ã¹ãããç·¨ã¿åºããããã¦ããå¿ è¦ãããã¾ããæåã®åå¼·ããããããã¯ãã§ãã¹ããæ¸ãããæ¹ãããã¦ãã©å®å®ããã¾ã§ã¯ãçµé¨è ãå¤é¨ã®ã¡ã³ã¿ã¼ãªã©ãããã»ããå®å¿ã§ãã
åå¼·ã¨ç·´ç¿ãããã®ã¯ãå®éã®ã¨ããèªåãã¡ã¯ã©ã®ãããã®ã¹ãã¼ãã§é²ããã®ãããããè¦æ¥µããããã«ãå¿ è¦ã§ããç´æã¨ã¹ã³ã¼ãã決ã¾ã£ã¦ãã¦ãããã«éã«åãããªãã¨ãããªãã®ãªããå®éã®ä»äºã®ç°å¢ã§ã¹ãã¼ããè¨æ¸¬ããã®ã¯ãªã¹ã¯å¯¾çã¨ãã¦ãå¿ é ã§ãããã£ã¦ã¿ã¦ãæããã«éã«åããªããªãããã¾ã¯è«¦ããã¨ããé¸æè¢ãæ¡ãã¾ãããã¹ãé§åéçºã§ããã¨æ±ºå®ãã¦ãããããã§ã¯éã«åããªãã¨ãããã®ã§ã¯ãæé ãã«ãªã£ã¦ãã¾ãããããã¾ãããç¾å®åé¡ã¨ãã¦ã¯ãç·´ç¿ãã¦ã§ããããã«ãªã£ãããã§ããã®åæã§è¦ç©ããã¯ãã§ãã
åçãé·ããªã£ã¦æ縮ã§ãããæ¸å¿µã¨ãªãç¹ãå³ã§æ´çããã¨ãããªãã®ããªã¨æãã¾ããã
(åãèªããªãã£ããããããªããããç¾å¨ã®çç£æ§ã¨ãããåºæºã¨ããè¦ç©ãããTDDåå¼·ä¸ï½è©¦è¡ãµã¯ã´ä¸ã®çç£æ§ããTDDä¸éå¾ã®çç£æ§ãã§ã)
- Bã®çç£æ§ã¯æ¬å½ã«Aããé«ããªãã®ããã©ã®ããããªãã®ãï¼
- åå¼·ã試è¡é¯èª¤ã§çç£æ§ãä¸ããCã®æéã¯ã©ã®ããããããã®ãï¼
- Cã®æéä¸ã®ä»äºã¯ã©ãè¦ç©ããã®ãï¼
- Dã®æè³ãã©ãæ»åºããã®ãï¼
ããããçåã«ã¯ãç³ã訳ãªãã§ããç§ã«ã¯åçã§ãã¾ãããç¾ç¶ã«ããã¨ããã¨ãããããããçµå±ã¯äººæ¬¡ç¬¬ã®é¢ãããã¾ããCãå§ç¸®ããããDãæ·±ãããããããã¯éã«Cãå¼ã延ã°ãã¦Dãèãããã¨ãããããªä½æ¦ãããããã«æãã¾ãã
ç§èªèº«ã®ãä½å¹´ãåã«ã¢ã¸ã£ã¤ã«ã³ã¼ãã¨ãã¦æ¯æ´ãããã¼ã ã§ãã¾ãæ®éã«ä½ã£ãã·ã¹ãã (ãã¹ããªã)ã«å¯¾ããã¨ã³ãã³ã¹(ä¿å®)ã®ä¸ã§ãã¹ãèªååã¨ãã¹ãé§åéçºå°å ¥ã«åãçµã¿ã¾ããããªã®ã§æ¢åã·ã¹ãã ã®ã·ããªãªããã ãåæã¡ã³ãã¼(ãã£ããåªç§)ããã®ã¾ã¾è¿½å éçºããã¦ããä½å¶ã§ããããã§ã¯ããªãæè¦çã§ããBã¯Aã®1.2ï½1.3åãCã¯åå¹´ããããDã¯ä¸»ã«ã¡ã³ãã¼ã®ã¢ããã¼ã·ã§ã³ã§æ»åºãã(ãã ãå 製ãªã®ã§æ¿æ²»çãªè©±ã«ã¯ãªããªããéçºãã¼ã ããã¸ãã¹å´ã説å¾ãã)ãã¨ããæãã§ãã
TDDã§ã¯ãªããã¹ãèªååã§èããã¨ãããã¸ã§ã¯ãå ¨ä½ã§è¦ã¦ãæåã§ãã¹ãããæ¹æ³ã¨ããã¹ããèªååããæ¹æ³ãã©ã¡ããå·¥æ°é¢ã§æå©ãã¯ãç¶æ³ã«ããã¨æãã¾ãããã¿ã¾ãããç§ã«ã¯ããã®ã¸ãã®ãã¦ãã¦ãããã¾ããããèªååããã ãã§å®ããªããã¯ã¾ãããã§ãããæåã¨èªåããã¾ã使ãåããã°ãã¼ã¿ã«ã®ã³ã¹ããä¸ããããå¯è½æ§ã¯ããã®ã§ã¯ãªãããå°ãªãã¨ãé¸æè¢ã¨ãã¦ä¿ä¸ã«è¼ããããã®ã§ã¯ãªããã¨ã¯æãã¾ãã