4)Railsãã¹ãã£ã³ã°ç°å¢ 2009 - Cucumber,Webrat and Rspec -
諸æ©æä»ããã®çºè¡¨(発表スライドはこちら)
ã¾ã¨ã
- Cucumberãç»å ´ããäºã«ãã£ã¦ããã°ã©ãã¼ã®ãã¹ãç°å¢ãå¤ãã£ã¦ãã
- åãå ¥ãå ´Cucumber
- TDDã¯RSpec
Choronicle of Rails Testing
1)Railsã§ã®ãã¹ãã®æ´å²
- ã2006ã¯UnitTest(ã¢ãã«),FunctionalTest(ç»é¢ã£ã½ãåä½)
- 2007ã2008ã¯RSpecãRailsã¨åæã«ä½¿ãããIntegrationTest(ã¢ã¯ã·ã§ã³ï¼è¤æ°ã®ç»é¢ãã¾ããï¼ãå ¥ã£ã¦ãã
- 2009ã«ãªã£ã¦ãIntegrationTesté¨åã«Cucumberãç»å ´
2)TestUnitã¨Functional Testã ãã®æ
- UnitTest
- ã¢ãã«ã®ãã¹ã
- ãã¼ã¿ã¯Fixtures
- FunctionalTest
- ã³ã³ããã¼ã©ã¼ï¼ãã¥ã¼ã®ãã¹ã
- IntegrationTest
- ã¢ã¯ã·ã§ã³ãã¾ãããã¹ã
- Railsã¢ããªãå¤é¨ããæä½ãã
Integration Test
- æ¸ãã®ãé£ãã
- æµè¡ããªãã£ãï¼ï¼
- ãããã ãã©ãã³ã¹ããé«ãã¦é£ãã
- BDDãã¬ã¼ã ã¯ã¼ã¯
- 沢山ã®matcher
- buil-in Stubs and Mocks
- çµæãã©ã¼ããããå¤æ°ãµãã¼ã
- æ¥æ¬èªã®æ å ±ã沢山ãã£ã¦ä¾¿å©
- MVCãåé¢ãã¦åå¥ã«ãã¹ãå¯è½
- Railsã®ãã¹ãã¡ã½ããã使ãã
- Unitã¨Functionalç¸å½ã¯ããã§ä½¿ãã
å¤é¨ããã®ãã¹ããã©ããããã¯ä¾ç¶ã¨ãã¦åé¡
5)Cucumberç»å ´!(http://cukes.info)
ãã¬ã¼ã³ããã¹ãããã¥ã¡ã³ãã«å¯¾å¿ããã³ã¼ããå®è¡ããããã®ã¢ããª
ãã¬ã¼ã³ããã¹ãã®å®è¡ï¼
- å®è¡ãããä»æ§ããã¬ã¼ã³ããã¹ãã§è¨è¿°(feature)
- äºç´èªã¯ãã
- "åæ","ãã","ãªãã°","ãã¤"
- ãã¬ã¼ã³ããã¹ãã«å¯¾å¿ããRubyã³ã¼ããæ¢ãã¦å®è¡ãã
- æ£è¦è¡¨ç¾ã§èªç¶è¨èªåã¨Rubyãããããããã³ã¼ããæ¸ã
- æ£è¦è¡¨ç¾ã¨ããããããããã¯ã®å é¨ã¯Rubyã®ã³ã¼ããªã®ã§èªç±ã«æ¸ãã
Better Integration Test
- Intergration Testã¯æ¸ãã®ãé£ãã
- ä¸è¨ãWebratã§ã«ãã¼ã§ãã(githubã§æ¢ãï¼
- Webã¢ããªãå¤å´ããæä½ããDSLã»ãã(ãªã³ã¯ããã©ãããã¿ã³ãæ¼ãããã©ã¼ã ã«å ¥åããï¼
Webrat
- ã©ãã«ã使ã£ã¦ãã¼ã¿ãå ¥åã§ãã
- ãªã³ã¯ãã¢ã³ã«ã¼ããã¹ãã§ã§ãã!
- ãªã³ã¯ã®æ¤è¨¼ãã§ããï¼(ãªã³ã¯ã§ããªãããªã³ã¯å ã§50Xç³»ã®ã¨ã©ã¼ãæ¤åºï¼
Cucumberã®ã¡ãªãã
- ãã®ä»æ§ãRubyã§å®è¡ã§ãã
- ãã©ãã¯ããã¯ã¹ãã¹ããã§ãã(RCovã¨åããã¦ã«ãã¬ãã¸ãåããï¼
- Webratã¨ä¸ç·ã«ä½¿ãäºã§ç°¡åã«ã§ãã
Cucumberã®éç
- Integration Testã¨åãéçã¯ãã
- Javascripté¨åãCSSçï¼ããã¯Seleniumçï¼
- 主è¦ãªå¦çãã¢ãã«ã«ããã¦ã³ã³ããã¼ã©ã¼ãèããã
- Modelã¯ãã¹ãããããã®ã§ããã§å¯¾å¿
- ãã³ã³ããã¼ã©ã®ã¢ã¯ã·ã§ã³ã§ã¯findãnew以å¤ã®ã¢ãã«ã¡ã½ããã¯ä¸ã¤ãããã«ããªãããã¨ãã£ãã¢ããã¤ã¹ããã
- ã¢ãã«ã«è¿½å ããã¡ã½ããã¯RSpecã§éç¹çã«ãã¹ã
- ã³ã³ããã¼ã©ã¼ããã¥ã¼ããã«ãã¼ã¯Cucumberã§ãã¹ã
éçºãµã¤ã¯ã«
- Cucumberã§åãå ¥ãæãªã©ã®ãã¹ãã«ä½¿ãããã
- TDDã«ããã¤ã³ãã°ã¬ã¼ã·ã§ã³ãããåãããã
ã¾ã¨ã
- ããã°ã©ãã«ã¨ã£ã¦ã®ãã¹ãæ¦ç¥ã¯å¤ãã£ã¦ããã
- éçºãµã¤ã¯ã«ãæ¹åã§ãã
質ç)
Q.ãã¬ã¼ã³ããã¹ãã§æ¸ããä»æ§ããã®ã¾ã¾ç´åãã¦ããã®ã§ããããï¼
A.ããã¹ãå½¢å¼ãªã®ã§å¿
è¦ãªå½¢ã«ã³ã³ãã¼ãããããããã¹ãã«æ¸ãã¦ãããã£ã¼ãã£ãéç´ããå½¢ã§ãããã¨æ³ã
- >ã¾ã 大è¦æ¨¡ãªã·ã¹ãã éçºã§ã¯ã¾ã 使ãããªãã®ã§ãã¨ã¯ã»ã«ã§ã®ä»æ§æ¸ãç¡ããªã£ã¦ãã訳ã§ã¯æªã ãªãï¼è£è¶³ï¼
Q.æ¥æ¬èªã§ãã¹ãä»æ§ãæ¸ããã®ã¯ä¾¿å©ã ã¨æ³ãããã©ãéçºè
éã§ã®æ¸ãæã®ææçµ±ä¸çã¯ã©ããã¦ããã®ã§ããããï¼
A.ãã¹ãæ¸å¼ãã®ãã®ã¯èªç±ã«æ¸ãã¦ãã¦ç¹ã«å
±ç¨ãã¦ããªãã
Q.ã³ã³ããã¼ã©ããªãã¹ãèãããã®ã¯ãããã¨æ³ã£ã¦ããããã³ã³ããã¼ã©ã¼ã®ã¢ã¯ã·ã§ã³æ¯ã«ã¢ãã«ã«ã¡ã½ãããçã¾ãããããã®ã§ãåç´ã«ä¸»å¼µããã¨å±éº
A.ãªãã»ã©ï¼
Q.Cukeã§Ajaxã®ãã¹ãã¯ã§ãã¾ããï¼
A.ã§ãã¾ãã
Q.èªè¨¼å¦çã¯ï¼
A.ãã¹ã¯ã¼ããã°ã¤ã³ã¯ä½è£ãOpenIDã¯ãªãã¨ããç¬èªSSOã¯ããªãå³ãã
Q.ã©ãã«ããªã³ã¯ããã¹ããå¤ããã¨ï¼
A.ãã¹ããä¿®æ£ããå¿
è¦ãããã¾ã