æ¥æ¥ä¸ã® James O. Coplien ã¨è©±ãããæ©ä¼ãããããã¾TDDãã¯ã©ã¤ã¢ã³ãã«æ¨è¦ãã¦ããã¨è©±ãããç®ãå¥ã㦠"Are you still doing TDD!?" ã¨è©°ãå¯ãããTDDã®åé¡ã«ã¤ãã¦å¤§å¤ç±çã«èªã£ã¦ããã¾ãã(ãã£ã¹ã«ãã·ã§ã³ãããä½ã§ã¯ãããã ãã©ãã ããã10対0ãããã§æ¼ããã¦ã¾ãã)ã
Cope ã¯ãã®å¾ãä¸å¯§ã«facebookä¸ã«ãTDDã®è©±ãæ¸ãã¦ããã¾ãããここã§èªãã¾ãã
ããã«ã¡ã¼ã«ã§ãTDDã®åé¡ãææããè«æãªã©ãããã¤ãæãã¦ãããã®ã§ãããããã§ç´¹ä»ãã¦ããã£ãè«æããèªåã®ç解ã®æ´çãå
¼ãã¦ããµããªããã¦ã¿ããã¨æãã¾ããã¨ãããã1ã¤ã ãã§ããã©ã
"A Comparative Case Study on the Impact of Test-Driven Development on Program Design and Test Coverage" Maria Siniaalto and Pekka Abrahamsson, Empirical Software Engineering and Measurement, 2007.
論文はこちらã§ãããææã§ãã
å 容ã«ã¤ãã¦èª¤è§£ãåéãããã¦ããé¨åãããããããã¾ããããäºæ¿ãã ããã
大ãã2ã¤ã®ç 究ããã¦ããè«æã§ãã1ã¤ãã¯ãTDDã«é¢ããæ¢åã®15ã®ç 究ãæ´çãã¦ãã¾ã¨ããã¨ãããã®ããã1ã¤ã¯ãTDDã¨éTDDã§ããããå®é¨ããã¸ã§ã¯ããå®æ½ããæ¸ãããããã°ã©ã ã®è¨è¨ã¨ãã¹ãã«ãã¬ãã¸ãè©ä¾¡ãã¦ãTDDã®å¹æã測å®ãããã®ã§ãã
ãã®ç 究ããããªã£ãèæ¯ã¨ãã¦ãTDDã®å¹æã¯ãããã謳ããã¦ããããå®éçã«æ¸¬å®ãã¦æ¯è¼ãã¦ãããã®ãå°ãªãã¨è¿°ã¹ããã¦ãã¾ãã2ã¤ãã®ç 究ã§ãããããå®éçãªçµæãåºãã¦ããã®ãéè¦ãªç¹ã§ãã
ååã§ã¯æ¢åã®ç 究ã®è©ä¾¡ããã¦ãã¾ããåã ã®ç 究çµæã¨ãã¦ã¯ãTDDã«å¥½æçãªçµæãåºã¦ãããã®ãå¤ããã®ã®ãä¸è¬åã§ããã®ããæå³ãããã»ã©å¤§ããªå¹æãªã®ãã¯æããã§ãªãã¨çµè«ãã¦ãã¾ããå質ã«ã¤ãã¦ã¯ç¢ºããªå¹æãããã¾ããä¸æ¹çç£æ§ã«ã¤ãã¦ã¯ãã¸ãã£ãããã¬ãã£ãã©ã¡ãã®çµæãããã¾ãã
å¾åã§ã¯ãTDDãè¨è¨ã«å¯ä¸ããå¹æã«ã¤ãã¦ãå®éçãªè©ä¾¡ããããªã£ã¦ãã¾ããããããããã®è«æã®æ¬å½ã«é¢ç½ãã¨ããã§ããå®ã¦ã¼ã¶ã¼åãã®ããã¸ã§ã¯ãã3ã¤ã2ã¤(Case1, 2)ã¯éTDDã1ã¤(Case3)ã¯TDDã§å®æ½ããçµæãã¡ããªãã¯ã¹ã§è©ä¾¡ãã¦ãã¾ãã
ããã¸ã§ã¯ãã¯ãããã4ã5åã®éçºè ããããããããJavaã§ã9é±éã®æé(åæã§ã¯ãªã)ãã¢ã¸ã£ã¤ã«éçºããã»ã¹ã§å®æ½ãã¾ãããéTDDã®2ã¤ã¯å®åçµé¨è ã§ãããTDDã¯å¦çã§ããè«æã§ã¯ãTDDã®ã¡ã³ãã¼ãéTDDã®ã¡ã³ãã¼ã¨åçã®ã¹ãã«ãããã¨èããããã¨è£è¶³ãã¦ãã¾ãã
èå¿ã®çµæã§ãããLCOM* (Lack of Cohesion in Methods)ã«ã¤ãã¦TDDã®ã»ããæªãçµæãåºã¦ãã¾ããCBO (Coupling between Object Classes)ã§ã¯TDDãè¥å¹²è¯ãçµæãåºãã¦ãããã®ã®ã大ããªéãã¯ããã¾ãããããã«ä»ã«4ã¤ã®ã¡ããªãã¯ã¹(WMC, DIT, NOC, RFC)ãè¨æ¸¬ãã¦ãã¾ããããã¡ããç¹ã«å·®ãããã¾ãããã¾ããã¹ãã®ã«ãã¬ãã¸ã¯TDDã®ã»ããè¯ãçµæãåºã¦ãã¾ãã
LCOM*ã§TDDã®ã»ããæªãçµæãåºã¦ãããã¨ã«ã¤ãã¦ãè«æã§ã¯ãTDDãã使ãã°èªåçã«åé度ã®é«ãè¨è¨ã«ãªãããã§ã¯ãªããçµé¨ã®æµ ãéçºè ãTDDã ãã使ã£ã¦ãè¯ãçµæãå¾ãããã¨ã¯éããªãã¨è¿°ã¹ã¦ãã¾ããã¾ãåæã«ãå®é¨ãã®ãã®ã¨åæã«ããã¾ã ä¸ååãªç¹ããããã¨ãèªãã¦ãã¾ãã
ææ³
TDDããå®è·µããã°ç´ æ´ãããè¨è¨ãã§ããã¨ã¯è¨ãã¾ãããè«æã¯ãã®ãã¨ã示ãã¦ãã¾ãããå®éã®çµé¨ã¨ãåã£ã¦ãã¾ãããªãã¡ã¯ã¿ãªã³ã°ããªãããã¨ããã®ã¯ãã¡ããè¨ãã¾ãããã©ããªãã¡ã¯ã¿ãªã³ã°ã ã£ã¦ä¸æä¸æãããããåæç¥èã¯éè¦ã§ããåæã«ãTDDã使ã£ã¦ãã¡ããªã¯ã¹ä¸ã¯ã»ã¨ãã©ã¡ãªããã示ããªãã¨ããã®ããèå³æ·±ãã¨ããã§ãã
TDDã ãã§ã¯ã ãã§ãã¬ãã-ã°ãªã¼ã³-ãªãã¡ã¯ã¿ãªã³ã°ãå°éã«ããã ãã§ãã ããããããªãã¦ããããä½ãå¿ è¦ãªã®ããTDDã§ããçµæãåºãã«ã¯ãä»ã«ã©ããªç¥èãã¹ãã«ããã¦ãã¦ãããã¨ããã®ãããã®ã¸ããå«ãããããTDDãã¨ã¯ã©ããªãã®ãªã®ãããããæ¢ç©¶ããªãã¨ãããªããªãã¨æãã®ã§ãã(ãã£ã¨ãTDDç 究ä¼ã®è©±ã®æ»ã£ã¦ãããã ãã)
ç 究ã¨ãã¦ã¯ãTDDã1ããã¸ã§ã¯ãã§ããå®æ½ãã¦ããããã¡ã³ãã¼ã®æ§æãåçã¨ã¯è¨ãããçµæãä¸è¬åãããã¨ã¯ã§ããªãããã«æãã¾ããè¤æ°ã®ããã¸ã§ã¯ãã§ã¡ã³ãã¼ããåçãã«ããã¨ããã®ã¯ããããå®é¨ã§ããã¾ãæå¾ ã§ããªãã§ãããCopeが別に教えてくれたブログã§ã¯ãTDDã«ã¯(å°ãªãã¨ã)4種é¡ããã¨è¨ã£ã¦ãã¾ãããTDDãã£ã¦ã¾ããã¨è¨ã£ã¦ããä½ããã¦ãã®ãå®ã¯ããããªãã人ã«ãã£ã¦éããã¨ã«ãªãã¾ãã
ã§ãèªãã§ã¿ããTDDãããã»ã©å¦å®ãã¦ããè«æã§ã¯ãªãã£ãã®ã§ãã¡ãã£ã¨æåæããã¦ããã¨ããã§ããã»ãã«ãããã®ã§ãã¡ããã¨èªã¾ãªãã¡ãã