ã¡ã³ãããã«ãªã³ã¼ãããããã¹ããéè¦ã£ã¦ãããããªã?
ãã®æå³ã§ãå®ã¯ã³ã¼ãã£ã³ã°è¦ç´ãããã¡ã³ãããã«ãªã³ã¼ããããå½¹ã«ç«ã¤ã®ãããã¹ããè¦ã¯ãã¹ãããã¹ãã¦ãã¾ãã°ã©ãã³ã¼ããã¦ãæ§ããªããã¨ããã®ãTDD = Test Driven Development =ãã¹ãé§åéçºã®èãæ¹ã®ãã¼ã¹ã¨ãªã£ã¦ãã¾ãã
ãã¹ãã¯ãã©ãèãã¦ãããç®çãã§ã¯ãªãã¦ãæ段ãã§ããã
ã¡ã³ãä¸è½ãªã¹ãã²ãã£ã³ã¼ãã ãã©ããã¹ãã¯å®ç§ã£ã¦ã½ã¼ã¹ã«ä¿®æ£ãå
¥ãããã¾ããã
ããã¹ãããã¹ãã¦ãã¾ãã°ã©ãã³ã¼ããã¦ãæ§ããªããã¨ããã®ãTDDãã¨ããã®ã¯ãTDDãããªãçãæãã¦ããã£ã¦ãããã誤解ãã¦ããã
TDDã®å
ã«ãªã£ã¦ãã(ã¨æã)XPã¯ãã¡ã³ãããã«ãªã³ã¼ããæ¸ããã¨ãç®æãã¦ãã(ã¨æã)ãããã©ããã£ã¦ã¡ã³ãããã«ãªã³ã¼ããæ¸ããã¨ãããè¨è¨ææ³ããTDDãªããã§ãã
TDDã¯ãã¹ãææ³ãããªããè¨è¨ææ³ã§ãããã¹ãã£ã¦åèªãå
¥ã£ã¦ããã¨ããã¹ãã®ããã£ã¦èª¤è§£ãçãã®ã§ãæè¿ã¯ãBDD(Behavior Driven Development)ã¨ãã風ã«è¨ãæãããã¦ãã¦ããããã§ãã
ã¡ã³ãããã«ãªã³ã¼ããæ¸ãã£ã¦ãã¨ããä¸çªéè¦ã ã¨æãã¾ããã
ãTDDãPerlãé¤ãã¦ãã¾ãã¡æ®åãã¦ã¾ããããã£ã¦ã®ããã¾ãåæã§ããªããPerlã®ä¸çã¯ç¥ããªãã®ã§ãPerlã§æ®åãã¦ãããã¯ãªãã¨ããããªããã©ããã以å¤ããæ®åãã¦ããªãã£ã¦ã®ã¯è¨ãããã§ãããã
追è¨:ããã§ã¯ãã©ããã¦ãã¡ã³ãããã«ãªã³ã¼ããæ¸ãããã«ãã¹ããå¿
è¦ãªã®ãããä»æ§ã®è¦³ç¹ãããã¹ããæ¸ãããããã¹ããã¯ãªã¢ããå¿
è¦æå°éã®ã³ã¼ããæ¸ããã¨ãããã¨ãç¹°ãè¿ãã¦ããã¨ãã³ã¼ãã«éè¤ãåºã¦ããããè¤éåãã¦ããã¾ããããããã¨ãå¿
è¦æå°éã®ã³ã¼ããæ¸ããã¨ãã³ã¹ãããããããã«ãªã£ã¦ããã
追å ã»å¤æ´ã®ã³ã¹ããã§ããã ãå°ãªãããããã«è¡ãã®ãããªãã¡ã¯ã¿ãªã³ã°ãã§ãããªãã¡ã¯ã¿ãªã³ã°ã«ãã£ã¦ãã³ã¼ãã®éè¤ãè¤éãªé¨åãåãé¤ãããã¡ã³ãããã«ãªã³ã¼ãã«ãªãã
èªä¿¡ãæã£ã¦ããªãã¡ã¯ã¿ãªã³ã°ãè¡ãã«ã¯ãèªåã®è¡ã£ãå¤æ´ããéå»ã«ä½ã£ããã®ãå£ãã¦ããªããã¨ã確ãããããã«å¿
ããã¹ããå¿
è¦ã«ãªãã¾ãã
ã¡ã³ãããã«ãªã³ã¼ãã«ããããã«ã¯ããªãã¡ã¯ã¿ãªã³ã°ãå¿
è¦ã§ããããã¦ããªãã¡ã¯ã¿ãªã³ã°ãè¡ãããã«ã¯ããã¹ããå¿
è¦ã«ãªãã¾ãããã¹ããéãã¦ããã°ãã©ããªã³ã¼ããæ¸ãã¦ããã¾ããªãã¨ãããã¨ã¯ããã¾ãããã³ã¼ãã®éè¤ãè¤éãã¯ããªãã¡ã¯ã¿ãªã³ã°ã«ãã£ã¦åãé¤ããªããã°ãªããªãã®ã§ãã
追è¨2:ãææªã³ã¼ãã¯æ¸ãç´ãã°ãããã¯ãæé»çã«ãå
¨é¨æ¸ãç´ãã¦ããã¾ããªãã¨ããæå³ã ã¨æãã¾ããããªãã¡ã¯ã¿ãªã³ã°ã®è¦³ç¹ããè¨ãã°ãããã¯ãééãã§ããæ¸ãç´ãã¨ãã§ããä¸åº¦ã«è¡ãå¤æ´ã¯ãã§ããã ãå°ãªããã¦ã常ã«ãã¹ãããã¹ãã¦ããç¶æ
ãä¿ããªããã°ãããªãã
ãã¹ããéããªããä¸åº¦ã«å
¨é¨æ¸ãæãã¦ãè¯ããããã¨ããã®ã¯ããå°ããã¹ããæ¸ãã¦å°ãå®è£
ãããã¨ããã¹ã¿ã¤ã«ã§éçºãã¦ããã®ã¨çç¾ãã¾ããããããæ¸ãã¨ãããã ãééããå¯è½æ§ãå¢ãããã ããããå°ãå¤æ´ãã¦ãã¹ãããã¹ããããã£ã¦ãã¨ãä½åº¦ãç¹°ãè¿ãã®ã§ãã
ã©ããããããªãç¶æ
ãããªãã¡ã¯ã¿ãªã³ã°ããã®ã¯ãé常ã«å¤§å¤ã§ããã¡ãã£ã¨ã§ããä¸åãªã«ãããæããããç´ãã«ãªãã¡ã¯ã¿ãªã³ã°ããã»ããããããªãã¡ã¯ã¿ãªã³ã°ãå
ã«å»¶ã°ãã¦ãããã¨ã¯ä½ããªãã¨æãã¾ãã
ããã¯ãä¸äººã§éçºãã¦ãããããå¤ãã®äººã§éçºãã¦ããããåãã§ããèªåã®æ¸ããã³ã¼ãã§ããã¡ãã£ã¨æéããã£ãããç´ãã«ä»äººã®æ¸ããã³ã¼ãã®ããã«ãä¸èº«ãå¿ãã¦ãã¾ãããã
ä»®ã«è¨æ¶åã®ãã人ã§ãã£ã¦ããè¯ãããã°ã©ããªããæªãã¨ããã¯ãç´ãã«ç´ããã¨æãã¯ãã§ããæ°ã«ãªãã¨ããããã®ã¾ã¾ã«ããã®ã¯ãæ°åãè½ã¡çããªãããã