ãã ããæ€èšŒãã¹ããå®è¡ããããšã§è©äŸ¡ã§ããã³ãŒãããã©ãŒãã³ã¹ãšã¯ç°ãªããã³ãŒãã®å質ã¯TRUEãŸãã¯FALSEã®åçŽãªè©äŸ¡ã§ã¯ãããŸããã ããã«ãã³ãŒãå質ãšã¯ãä»ã®äººã«ããã³ãŒãã®èªèã®äž»èŠ³çè©äŸ¡ã®ã»ãããæããŸãã ãã ããå質ãè©äŸ¡ããã¿ã¹ã¯ãäœããã®åœ¢ã§åœ¢åŒåããå¯èœã§ããã°ããã®ã¿ã¹ã¯ãèªåçã«å®äºããæ¹æ³ãæäŸããŠã¿ãŸãããã
è©äŸ¡ã®ãã€ã³ãã®å°ãªããšãæåã®ãªã¹ãã¯äœã§ããããïŒ
- ãã¹ãŠã®ã³ãŒãã®ã³ã³ãã€ã«
- ãã¹ãŠã®ã³ãŒãã®ããã©ãŒãã³ã¹
- ãããžã§ã¯ãã§äœ¿çšãããã³ãŒãã®èšè¿°ã¹ã¿ã€ã«ãžã®æºæ
- åã³ãŒãã»ã¯ã·ã§ã³ã®ããã¥ã¡ã³ãã®å¯çšæ§
- åã ã®è¡ãé¢æ°ããã¡ã€ã«ã®ã¬ãã«ã§ã®ã³ãŒãã®å¯èªæ§
- ã³ãŒãã«è¿ éã«å€æŽãå ããæ¢åã®æå°éã®æ©èœã«åœ±é¿ãäžããæ©èœ
ç·šé
æ®å¿µãªãããç§ãã¡ã®ç掻ã«ã¯ããããžã§ã¯ãã®ã³ãŒããå®å šã«ã³ã³ãã€ã«ãããŠããªãç¶æ³ããŸã ãããŸãã ã³ãŒãããªãŒã«ã¯ãæ°å¹Žåã«æžãããã»ã¯ã·ã§ã³ãããã誰ã觊ããã誰ãå€æŽãããäœããã®åœ¢ã§æ©èœããªããªã£ãã ãã§ãªããã³ã³ãã€ã«ãããŸããã åæã«ãã³ãŒãã®ãããã®ã»ã¯ã·ã§ã³ã¯ã99ïŒ ã99.9ïŒ ããŸãã¯99.98ïŒ ã®ã±ãŒã¹ã§ã¯äœ¿çšãããŠããŸããããXãæ¥ããšïŒãââããŠããŒãã£ãŒã®æ³åã«ããã°ã圌ã¯ééããªãæ¬çªã·ã¹ãã ã«å ¥ããŸãïŒã顧客ã¯éåžžã«æã£ãŠããŸãã
ããã«å¯ŸåŠããããšã¯å¯èœã§ããïŒ å¿ èŠã§ãïŒ æå-ãããžã§ã¯ãå ã®ãã¹ãŠã®ã³ãŒããå®å šã«å®æçã«ã³ã³ãã€ã«ããã§ããã°èªåçã«ã³ã³ãã€ã«ããŸãã ããšãã°ãã³ãŒãã®æ¯é±ã®ã³ã³ãã€ã«ãã»ããã¢ããããã§ããã°ãã®ã³ãŒãããããããçµ±åãµãŒããŒãã«ã¢ããããŒãããŸããããã«ã¯ãããã€ãã®å Žæã«ææ°ã®ãããããåäœããªãã³ãŒãããããŸãã ãããããã®ãµãŒããŒã§ã¯ãåžžã«ãããžã§ã¯ãã®çŸåšã®ã¹ããŒã¿ã¹ãææ¡ã§ããã³ã³ãã€ã«ãšã©ãŒãèŠéãããšã¯ãããŸããã
å¥ã®è¡ã§ãJava以å€ã®ãã¡ã€ã«ã®ã³ã³ãã€ã«ã«èšåãã䟡å€ããããŸãã ã»ãšãã©ãã¹ãŠã®ã¹ã¯ãªããããã³JSPããŒãžã§ãã³ã³ãã€ã«ãšã©ãŒããªãããã¡ã€ã«ããã§ãã¯ããæ¹æ³ããããŸãã ããšãã°ãWebLogicã§ã¯ãWebã¢ããªã±ãŒã·ã§ã³ã®ããªã³ã³ãã€ã«ãã©ã¡ãŒã¿ãŒãæå®ã§ããŸãã JSPã«ãšã©ãŒãå«ãŸããŠããå Žåãããªã³ã³ãã€ã«ãäžæããããšã©ãŒããã°ã«èšé²ãããŸãã WebLogicã«ã¯ãåã ã®jspã«å¯ŸããŠåãæ©èœãå®è¡ããjspcãŠãŒãã£ãªãã£ãå«ãŸããŠããŸãã
æäœæ§
ã³ãŒãã¯æ©èœããŸããïŒ ã©ããã£ãŠç¥ã£ãŠããŸããïŒ ãã¹ãŠã®ã³ãŒããçŸåšæ©èœããŠããã®ãããŸãã¯äžéšãã¡ããã©2é±éåã«æ©èœããŠããã®ãã確èªã§ããŸããïŒ ããããå®éã«å€æŽãå ãããšãå¿ èŠãªå Žæã§ã¯ãªããå¿ èŠã§ãªãå Žåã§ãäœãããå£ããå¯èœæ§ãããããšã¯ãåãã§ãããã
ãŸãã¯ãããªãã®ä¿èšŒã¯ãQAéšéïŒå質ä¿èšŒïŒããã¹ãŠã®ãã°/åé¡/ãããã«ãåæ Œããããšããäºå®ã«åºã¥ããŠããŸããïŒ ãŸã äœã®æå³ããããŸããïŒ ãŸããäžéšã®äŒæ¥ã§ã¯ãQAã¯ã·ã¹ãã ã®å€æŽéšåã®ã¿ããã¹ãããŸãã 第äºã«ãQAã¯æ ãè ã§ãããã§ãã·ã§ãã«ã§ã¯ãªãå¯èœæ§ããããæè¿ã®ç¡åã®äŒæ¥ã§ã®çµéšã瀺ãããã«ãåæ Œããã«ã¯æ tooããããã¹ãã«åæ Œããããšãã§ããŸãã 第äžã«ãã»ãšãã©ã®äººã¯QAã§ãåããŠããã圌ããééããç¯ãå¯èœæ§ããããŸãã
ãããã£ãŠãããã©ãŒãã³ã¹ãè©äŸ¡ããããã«ãã©ãã§ãèªåãã¹ãããã§ã«äœ¿çšãããŠããŸãã ãããã¯ãã³ãŒãã100ïŒ æäœå¯èœã§ãããã©ãããè©äŸ¡ã§ããŸãã 確ãã«ãããã«ã¯ä»¥äžãå¿ èŠã§ãã
- èªåãã¹ãã¯
- ãããã®èªåãã¹ãã¯ãæ©èœã®100ïŒ ãã«ããŒããå¿ èŠããããŸã
æåã®é ç®ãçµç¹çãªã¿ã¹ã¯ã§ããå Žåã2çªç®ã®é ç®ã¯æè¡çãªãã®ã§ãã ãŸããã100ïŒ ãã§ã¯ãç¹å®ã®èŠä»¶ã®åèŠä»¶ã®ãã¹ãã§ã¯ãªããå°ãªããšã1ã€ã®ãã¹ãã®çµæãšããŠãã¹ãŠã®ã³ãŒãè¡ãå®è¡ããããšããäºå®ãç解ããå¿ èŠããããŸãã ãã®æ©èœã¯ã ã³ãŒãã«ãã¬ããž ããšåŒã°ããæåéããã¹ãã§ã³ãŒããã«ããŒããã床åããæå³ããŸãã 次ã®ã€ã³ãžã±ãŒã¿ãç°ãªããŸãã
- é¢æ°ã«ãã¬ããž-ã¡ãœããåŒã³åºãã®èšç®
- 決å®ã«ãã¬ããž-ã³ãŒãå®è¡ã®å¯èœãªæ¹åã«ããèšç®ïŒå¶åŸ¡æ§é å ã®then-elseãŸãã¯case-case-defaultïŒã ããããã®å Žåã«åäžã®ãã©ã³ããèæ ®ããŸãã
- ã¹ããŒãã¡ã³ãã«ãã¬ããž-ç¹å®ã®ã³ãŒãè¡ã§ã®èšç®
- ãã¹ã«ãã¬ããž-ã³ãŒãå®è¡ã®å¯èœãªæ¹æ³ã®èšç®ã ãã¹ãŠã®ãã©ã³ãã®çµæãèæ ®ã«å ¥ãããããææ決å®ã«ãã¬ããžãããåºãæŠå¿µã
- æ¡ä»¶ä»ãã«ãã¬ããž-ã³ãŒãå ã®ããŒã«åŒããã³éšååŒã®å€ã®èšç®ã®å¯èœãªçµæã®èšç®ã
äžéšã®ææšã¯çŽç²ã«çè«çã§ãããéåžžããã¹ã«ãã¬ããžãªã©ã®å®éã®ã¢ããªã±ãŒã·ã§ã³ã«ã¯äœ¿çšãããŸããã å埩åæ°ãå¯å€ã®ãµã€ã¯ã«ã§ãã®ã€ã³ãžã±ãŒã¿ãŒã«æ倧100ïŒ å°éãããšãå¯èœãªãã¹ãŠã®å埩åæ°ããã§ãã¯ããå¿ èŠããããŸã...ãããŠãããããŠãŒã¶ãŒã«äŸåãããã©ããïŒ ã¯ãã確èªããããšã¯ã»ãšãã©äžå¯èœã§ãã ãããã£ãŠãéåžžã¯ãæ©èœã«ãã¬ããžããŸãã¯ãã¹ããŒãã¡ã³ãã«ãã¬ããžãã®ããããã䜿çšãããŸãïŒåŸè ãã決å®ã«ãã¬ããžãååŸããã®ã¯ç°¡åã§ãïŒã ãªãŒãã³ãœãŒã¹ãããžã§ã¯ãããã次ã®ããšã«æ°ä»ãããšãã§ããŸãã
- emma.sourceforge.net -EMMA
- cobertura.sourceforge.net -Cobertura
EclEmma-Eclipseã®Javaã³ãŒãã«ãã¬ããž
ã¹ã¿ã€ã«
ã³ãŒãã¯èªã¿ããããæžãããããã®ã§ã¯ãªã
ã¹ãã£ãŒãããã³ãã«ãSD West '04
ïŒèšäºã®èè ã¯ãã®å£°æã«å®å šã«åæããŠããŸãããã
ããããæš©åšã®æš©åšããæèŠãšããŠåœŒãå°ãïŒ
OKãããªãã®ã³ãŒããæ©èœãããšä»®å®ããŸãã 圌ã«ãç解ããŠãããããã§ãã ãããè¡ãã«ã¯ãå€ãã®ææ³ãšã«ãŒã«ã䜿çšãããŸããæåã®æ¹æ³ã¯ãã³ãŒãã®èšèšãšç¹å®ã®ã¹ã¿ã€ã«ã®å¯Ÿå¿ã§ãã ããšãã°ãåœç€Ÿã§ã¯æ¬¡ã®ã¹ã¿ã€ã«ã䜿çšããŠããŸãïŒã Sun Java Conventions + {} on new lineãã ãã®ãããªç解å¯èœãªæŠå¿µã®èè ã«æè¬ããããšæããŸãã ç§ã®IDEã§ã¯ããJava Conventionsãã®ãã¶ã€ã³ã«ãŒã«ãæ¡çšããããããæ°ããã«ãŒã«ã«ã³ããŒããŠã1ã€ïŒãŸãã5ã€ïŒã®èšå®ã®ã¿ãå€æŽããã°ååã ããã§ãã
ãªãããã«IDEã«ã€ããŠã§ããïŒ ã¯ããã³ãŒãã®ã¹ã¿ã€ã«ã¯ããã°ã©ãã§ã¯ãªãIDEã§ãµããŒããããã¹ãã§ãããããã°ã©ãã¯ããã°ã©ã ãæ°ã«ããªãããšã ãã確èªããå¿ èŠãããããã§ãã ããããããã°ã©ã ãééã£ãŠããããããã°ã©ããŒãåŸããªãã£ãå Žåã¯ã©ããªããŸããïŒ ç¹°ãè¿ãã«ãªããŸãããæ€èšŒã®èªåæ段ã圹ç«ã¡ãŸãã
- checkstyle.sourceforge.net-ãã§ãã¯ã¹ã¿ã€ã«
ããããã¹ã¿ã€ã«ã¯ãã¶ã€ã³ãšã€ã³ãã³ãå ã®ã¹ããŒã¹ã®æ°ã§çµãã£ãŠããŸããã 次ã®ã¹ãããã¯ãã³ãŒãã§äžè¬ã«åãå ¥ããããŠããæšæºãŸãã¯äŒæ¥æšæºã®äœ¿çšã§ãã ããšãã°ã Serializableã¯ã©ã¹ã«ã¯serialVersionUIDãå¿ èŠã§ãããExceptionã¯äžå€ã§ããå¿ èŠããããcatchãããã¯ã®äŸå€å€ã¯å€æŽãããŸããã ãŸãããããã®å¥çŽã«éåããŠãçŸæç¹ã§ã¯ãšã©ãŒã¯çºçããŸããããæšæºã«ãŒã«ã«åŸãããšãæåŸ ããŠãã人ãã³ãŒããç解ãã«ããããŸãã ãã®ãããªççŸããªããã³ãŒãããã§ãã¯ããããã°ã©ã ã®äžã§ãåããã§ãã¯ã¹ã¿ã€ã«ãšFindBugsããã°ã©ã ã«ã€ããŠèšåããããšæããŸãã
- findbugs.sourceforge.net -FindBugs
ã³ãŒãæ€èšŒã®ãã®é åã¯ã éçåæãšåŒã°ããŸã ã ããã«ã¯ãããšãã°ãSerializableã¯ã©ã¹å ã®serialVersionUIDã®ååšãããªãŒãã³I / Oã¹ããªãŒã ãªã©ã®ããè€éãªãã§ãã¯ãªã©ã®åçŽãªãã§ãã¯ãå«ãŸããŸãã ç¹°ãè¿ããŸããããããã®ãŠãŒãã£ãªãã£ã¯ããã¹ãã®100ïŒ ã«åæ Œãã100ïŒ ã®ã«ãã¬ããžãæã€ã³ãŒãã§ãšã©ãŒãèŠã€ããããšãã§ããŸãã ãã®ãšãããããã®ãŠãŒãã£ãªãã£ã¯ãæœåšçãªãšã©ãŒãšããã°ã©ã ã®æšæºããã°ã©ãã³ã°ã¹ã¿ã€ã«ãšã®ççŸãæ€åºããŸãã
Eclipseã§FindBugsã䜿çšãã
éšåçãªçµ±èšåæã¯ãIDEã§å®è¡ã§ããŸãïŒEclipse-ã³ã³ãã€ã«æãIDEA-ãã³ãŒãæ€æ»ãïŒã ãŠãŒãã£ãªãã£ã¯2ã€ã®ã°ã«ãŒãã«åããããŸã-ãœãŒã¹ã³ãŒãïŒã»ãšãã©ïŒã§æ©èœããã°ã«ãŒããšãã³ã³ãã€ã«æžã¿ãã¡ã€ã«ã§æ¢ã«æ©èœããã°ã«ãŒãã§ãã FindBugsãã³ã³ãã€ã«ãããã³ãŒãã§åäœããããšã¯æ³šç®ã«å€ããŸããã€ãŸããäžåžãšé¡§å®¢ã®äž¡æ¹ãããããã§ãã¯ã§ããŸããè¯ãçµæïŒçµµæåïŒãããããšã«æ³šæããæ¹ãè¯ããšæããŸãã
ããã¥ã¡ã³ã
ã³ãŒãã®ããã¥ã¡ã³ããŒã·ã§ã³ã®å¿ èŠæ§ã«ã€ããŠå€ãã®èšèãèšãããŠããŸã...ç§ã¯ææ°ã®IDEã§ã¯javadocã³ã¡ã³ãããªãã³ãŒãã®å Žæãèªåçã«åŒ·èª¿ãããã®ãã¶ã€ã³ã®æ£ç¢ºæ§ãå¿ èŠãªãã¹ãŠã®ã¿ã°ã®ååšïŒ
@since
ã
@author
ã
@author
ããªã©ïŒã èšå®ã確èªããå°ãªããšããããªãã¯ã¡ãœãããšã¯ã©ã¹ã«å¯ŸããŠïŒããã³ä¿è·ãããã¯ã©ã¹ã«å¯ŸããŠïŒããæå¹ã«ããŠãã ããã
JavaDocã³ã¡ã³ãã®ååšã«ã€ããŠã³ãŒããåæã§ããç¹å¥ãªããã°ã©ã ããããŸãã ããšãã°ããã§ã«è¿°ã¹ãCheckStyleã
ãã¡ãããããã¯éçºè ããã®ããã¥ã¡ã³ãã®ããŒãžããããã€ãã®å³é¢ãåããã·ã³ãã«ãªããã¹ãã«çœ®ãæããŸãããããã§ã¯ãã³ãŒãã®ã©ãã«ãšã³ããªãåºå£ãã€ã³ãããããã説æããå°ãªããšããããã®éã®ãã¹ãæç»ããŸãã
ã³ãŒãã®èªã¿ããã
ãã¡ããããããŸã§ã®ãšãããMicrosoft WordïŒOpenOffice WriterïŒã§ãããè¯ãæç« ãšæªãæç« ãåºå¥ããããšã¯ã§ããŸããã æ倧ã¯ãææ³çããã³æäœçãªãšã©ãŒãä¿®æ£ããããšã§ãã ããã§ããå°ãªããšãäœãã
ãããã£ãŠãã³ãŒãããèªã¿ããããã®æŠå¿µã圢åŒåããããšã¯å°é£ã§ãããèªã¿åãå¯èœãªã³ãŒããèªã¿åãäžå¯èœãªã³ãŒãããããŒã¯ããããã€ãã®ç¹æ§ããããŸãã
- ç»é¢ã«åãŸã120è¡ä»¥å ã®åäžè¡ãµã€ãº
- ã¡ãœããã®ãµã€ãºã¯1ç»é¢ä»¥äžã§ãããããèªè ã¯ã¡ãœããå šäœãèŠãŠãèªåãäœãããŠããããç解ã§ããŸãã
- ã¯ã©ã¹ãµã€ãºã¯1000è¡ä»¥äž-BLOBã¢ã³ããã¿ãŒã³ãªã
- ãéæ³ã®ãå®æ°ããªãïŒããšãã°ã5ã7ã10 ...èªè ã¯ãããã®æ°åãäœã§ãããã©ãããæ¥ãã®ããç°¡åã«ç解ããå¿ èŠãããïŒ
ãããã®ãã§ãã¯ã®ã»ãšãã©ã¯ã³ãŒãã®ã¹ã¿ã€ã«ã«é¢é£ããŠããããã§ã«åŒã³åºãããŠãããŠãŒãã£ãªãã£ã«ãã£ãŠãã§ãã¯ãããŸãã
ãŸãšãããš
ãŠãŒãã£ãªãã£ãã³ãŒãã®å質ãèªåçã«ç£èŠããããã«ãæçµçã«äœãããå¿ èŠããããŸããïŒ
- ããŒãžã§ã³ç®¡çã·ã¹ãã ããªãå Žåã¯ãå ¥æããå¿ èŠããããŸãã ãšã¯ãããç§ã¯ãŸã ããªãããããæã£ãŠããããšãæã¿ãŸãã
- äŒç€Ÿãã³ãŒããå¶éãèšè¿°ããããã®ç¹å®ã®ã«ãŒã«ïŒãã³ãã¬ãŒãïŒãæã£ãŠããå Žåããããã¯åœ¢åŒåãããå¯èœã§ããã°ãèªåãŠãŒãã£ãªãã£ã®1ã€ãç解ã§ããèšèªã§èšè¿°ãããå¿ èŠããããŸãã
- å°çšãµãŒããŒïŒçµ±åïŒãã»ããã¢ããããŸããããã¯ãæ¯æ©çŸåšã®HEAD / Streamãããã¹ãŠã®ã³ãŒããååŸããã³ã³ãã€ã«ããŠãµãŒããŒã«ãã¢ããããŒããããŸãã ã§ããã°ãå°ãªããšãèšè¿°ããã³ãŒãã«ã€ããŠã¯ããµãŒããŒã¯-eaïŒã¢ãµãŒã·ã§ã³ãæå¹ã«ããïŒã¢ãŒãã§èµ·åããå¿ èŠããããŸãã
- ã³ã³ãã€ã«äžã«ããœãŒã¹ã³ãŒãã䜿çšãããŠãŒãã£ãªãã£ïŒCheckstyleãªã©ïŒã§ã³ãŒãããã§ãã¯ãããã®åŸããã€ãã³ãŒãã䜿çšãããŠãŒãã£ãªãã£ïŒFindBugsãªã©ïŒã§ã³ãŒãããã§ãã¯ããå¿ èŠããããŸãã
- ã³ã³ãã€ã«ã®çµæãç¹ã«ãšã©ãŒãããå Žåã¯ãé»åã¡ãŒã«ã«éä¿¡ããŸã
- ãµãŒããŒãåèµ·åããåŸããµãŒããŒã§äžé£ã®èªåãã¹ããå®è¡ããŸãã
- ãã¹ããå®è¡ãããšããã«ãã¬ããžãšããã€ãã®å éšããã©ãŒãã³ã¹çµ±èšãè©äŸ¡ãããŠãŒãã£ãªãã£ãå«ãããšäŸ¿å©ã§ãã çµæãããŒã¿ããŒã¹ã«ä¿åãããã°ãããããšãéçºããã»ã¹äžã«ã³ãŒããæ¹åãã¹ããŒãã¢ããããŸãã¯ã¹ããŒããŠã³ããæ¹æ³ã瀺ãé©åãªã€ã³ãžã±ãŒã¿ãŒãèç©ã§ããŸãã
ååäžã«å°çããããã°ã©ãã¯ãã¿ã¹ã¯ãµãŒããŒãããã®æ¥ã®ã¿ã¹ã¯ã®ãªã¹ããåãåããçµ±åããã³ãŒãã®çŸåšã®ç¶æ ãåãåãå¿ èŠããããŸãã
åç §è³æ
- www.theserverside.com/news/thread.tss?thread_id=29114-ãŠãŒã¢ã¢ïŒãªãã³ãŒãããã¡ãªã®ã§ããïŒ
- edocs.bea.com/wls/docs100/webapp/reference.html#wp57794-WebLogic JSPã³ã³ãã€ã©
- en.wikipedia.org/wiki/Code_coverage-ã³ãŒãã«ãã¬ããž
- en.wikipedia.org/wiki/Antipattern-ã³ãŒãå ã®ã¢ã³ããã¿ãŒã³