?????                              

???:

       jtest??parasoft??????????????java????????????в??????????????????java??????????????У?飬??????????????Jtest????????java????????????junit??????????????????????????????????????????????δ????????????????????????????????DbC??Design by Contract???淶???????????????????????????????????????????????????????????junit??????Jtest??????????е????350????????????鰱??????????????????????????????????????????Щ???????????????????????????????δ???????????????????й???????????????????????????????

       ????jtest ????parasoft?????AEP??????????????????ж?????????????????????????????parasoft???????????????????????????????????????????????????????????Ρ?


?????

1????????????????????????????????????????????????Ч??
2??????????????????С???????????????????
3???????淶??????????????????
4????????????????Э??????????????


??????

1???????????????????????????????????????????????????淶????
2??????????junit????????????????????м?????
3????????к?в????????????????????????
4??????????????в??????????????????????й???????????????????????
5??????????????Χ
6???????л?????
7?????DbC????淶
8?????鳬??350??????java????????淶
9?????????Υ??????160??????淶?????
10??????????????η????????????????????????淶
11???????????????в??????ú????????????
12??????IBM Websphere Studio /Eclipse IDE ????????


?????


??????????????jtest full?汾??full?汾????jtest??eclipse??jtest????????eclipse????????

1????windows??????裺
1?????jtest???????jtest5_win32.exe
2?????????????У????complete jtest installation???????????????

2????unix??????裺
1??????????jtest.linux.tar.gz??gzip ?dc jtest.solaris.tar.gz ?????????????jtest????
2??????????????

linux??gzip ?dc jtest.linux.tar.gz | tar xvf ?
solaris: gzip ?dc jtest.solaris.tar.gz | tar xvf ?

????????????????jtest????????????jtest??????????????
????jtest?????? ./jtest ?????ɡ?
 ??????????jtest?????????????????????????????????????????????

??????


        ??????jtest????????????????????????jtest????????????÷??????????????????£?

1??????Σ??????????????
2??????Σ???????淶
3???????Σ???????????淶????
4??????Σ????????淶?????????
5??????Σ?????/??????????????
6???????Σ?????jtest builtin ????
7??????Σ???fly???????????????????????
8?????Σ???????????
9?????Σ?????????С????junit????????
10??????Σ??????????????????????淶
11???????Σ??????????????????????????jtest????
12????????Σ???л?????
13????????Σ???????й?


 ???  ?????????????

jtest ???????£???????????java????????????????????????????????????????????????????????????????????????jtest???????????eclipse??????java??????ɡ?

????

?????δ???jtest??????

???裺

1????? file>new>jtest example project
2??????????????jtest example ?????finish????

??????????????????jtest ?????Package explore?????????????????г????jtest example??????????java????????????

1??            ?????????????????????java perspective ????????java perspective ???????????????????open perspective????????other????????java???????ɡ?
2??            ??????????????java perspective ???????jtest????????£?
 
        ??>jtest ???
        ??>java???
        ??>open ???

??????????淶

       ?????????淶?????????????Щ??????????????????????????????????

????

        ?????μ?????淶???????????????淶????

???裺

        ??????????simple???????jtest example??????example.eval??????????????java????淶??

1?????simple.java????
2?????????????play??????? ???????£????????????jtest????????淶?????????????У??????γ????????????????????????????????????н???????淶??????????????
3?????????н???????jtest????????????standards???????????????1??????淶???????

????淶?????????
?????????????
???????????
???????????
????????????
Υ???????淶????
4????????д????
5????jtest????????·??????errors found?????????????????????window>show view>other?????jtest>errors found?????ɡ?
6????errors found???????example.java???????????????????????淶???????????淶??????????????????????????????????????????
7??  ???[Line: 54] Text label ??case10?? may be typo for ??case 10?????simple.java??????????????????????Υ??????淶??????л??????????????????λ?????????

??????????????淶????     

jtest ???????????????????????淶?????????ü????eclipse quick fix ?????????????????????????????淶??????jtest configurations????standards??????????????????????    

????

        ??????????jtest quick fix ????????????????淶????

???裺

1????errors found ????????simple.java??????[Line: 54] Text label ??case10?? may be typo for ??case 10?????????????????????????и?????????????????????и???????????????????????????????????????quick fix ????????????????淶????
2???????????????????????£??????????????????????????????????quick fix????????????Υ???????淶???????????
3?????fix????????????????淶????jtest????????λ?????????????????????case10???滻case 10???????????????????????????????jtest???????????errors found?????????????????????
4?????????
 
??????????淶?????????

jtest ???????鳬??350??????淶???κ???????????????淶??????淶????????????????????????????????????????????????????????淶??

????

        ???????????????????淶???????

???裺

1??  ??errors found????????simple.java ???
2??  ???????[Line: 53] case 0 is missing either "break"?? "return"?? or /*falls through */??????????view rule description??jtest???????builtin help?????????????????淶?????????
3???????????back???????

???е????淶?????????????????jtest????????á?


?塢????/??????????????

?????????????ЩΥ??????淶??????????????????????????????????????????????????????????????????????????Щ???????淶????????????????????jtest configurations?????jtest????????????顣

????

?????κ???/??????????????

???裺

        ???simple.java?????????Utility class does not have a "private" default constructor: ??Simple?? ???????

1????errors found????????simple.java???
2????????Utility class does not have a "private" default constructor: ??Simple?? ??????????suppress error???
3??  ??????????????????????????????????????????????????????exploring suppressions?????????????????淶?????errors found?????????????????????????????????suppressed messages?????


           Suppressed messages????????????????????????jtest>show view>suppressed messages?????????????????????

message???????? jtest ????
reason???????????????
resource??????????????
user????к????????????
date????к???????????
???????????????????

??suppressed messages???????????CODSTA.UCDC: Utility class does not have a "private" default constructor: ??Simple?? ??????????remove suppression???ɡ?


????????jtest builtin ????

         jtest configuration??????????????????????????????????????jtest???в???????????????jtest configuration????????????????jtest configuration???????????jtest configuration???????jtest configuration??????????Щ???ò?????

??е?????????????淶??顢???????????ɡ???????????е??

???????????淶

???????????????????????

?????????е??Χ??????????е??

       jtest??????????jtest????????????builtin??????????????java coding conventions??java???????????sun?????java??????????????????????淶?????????http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html??


????

??????????jtest???????jtest configurations??


???裺

??????????simple.java????????sun?????java??????

1??            ???simple.java????
2??            ??play????????????jtest using>builtin>coding standards>code conventions for the java programming language by sun????????????????????
3??            ???????
4??            ??errors found???????????Υ??sun?????????

?????fly???????????????????????

 ????????????????????????????淶???????淶?????????fly????????????????????jtest builtin configuration??????????jtest???á?

????

  ?????????fly????μ????淶??顣

???裺

1?????simple.java????
2????play????????????jtest using>builtin>coding standards rules>formatting>check all rules in this category(???????????????)
3????errors found?????????????????

 ?????????????

??????????????tasks?????errors found??????????????????????γ????Щ?????????????????????′????г??????????????????

????

???????????tasks?????errors found??????????????

???裺

????shift??ctrl?????????????????????????????????delete error??delete all/clear all??

???????????С????junit????????

jtest ?????????????junit??????????????????????е?δ?????????????????????Щ?????????????????Χ????????????????????顢???????????????

????

??????????????????junit????????????β???????????????????????????????

???裺

1?????simple.java????
2?????play???
3???????к??????????run????????????13????????error????????????????failures??????????????????????
4?????????д???
5?????????jtest???????junit???????????simpletest.java?????????????jtest example.jtest??examples.eval????
6????error found???????????[Line: 107] java .lang. NullPointer Exception??????????quick fix???
7?????????????????????????
8??  ????????play?????????Jtest Using> Builtin> Generate and Run Unit Tests?????????в???
9??  ?????simple.java???????????????????????????????????????test class outline???????????????????????????test class outline?????????????Jtest Perspective>Jtest> Show View> Test Class Outline??
10?????test class outline???????????????????????inputs????outcomes???????????????????????????????????

????????????outcome??????????outcome??????verify??jtest??//unverified??????????????????????????????jtest????????????????????????????????
 ??????????outcome?????outcome??????????????????jtest????????????????????????????????????
?????????????jtest??????????????outcome??????????outcome??????ignore????????????????????????.
????????????????????????淶

??????????????????????????????play?jtest??е???????????????????á?

????

???????????jtest?????????????????

???裺

1???????????jtest-jtest configuration????play????????????????п???????????????????壬user defined???????????builtin???????????????????????
2?????example configuration?????????и????G????????????????ó???????á?
3????standards???????????????????????????????淶
4?????internationalization????????????jtest???ü?鰱???????????????jtest??в???????????????????????????ü???????????????????????????ɡ?
 

?????????????????????????????jtest????

jtest??????jtest configurations???????????????????????????????????????????????builtin??????????????????jtest?????????????????в????????????????ò????????????

????

        ?????δ??????????jtest??????????淶

???裺

1????jtest-jtest configuration???
2?????user defined??
3?????new??????????????μ?jtest?????????jtest??????????????example configuration??1??
4??????ó??????????????????metrics????????????jtest??????淶
5????standards???
6?????disable all visible rules????????????б?????????????????????????????????????????
7?????class metrics????????????????????????class metrics?????????淶
8????generation????????enable unit test generation???????????????????????????????????????淶????????????????????????????????jtest???ü??ɡ?
9????execution??????enable unit test execution?????????????????
10??        ???close????????????????yes
11??        ???иò?????????????????????????play????????????user defined-metrics????

???????л?????

        ??jtest???????????????????????????????????????????????????????junit????????????????????????????????????????????????????????????????????????????????в?????????????????????

????

???jtest?????л?????

???裺

1????simple.java?????????
2????add()??????????????ɡ?????????????????return 11??12
3??????????
4?????simple.java????

???play??????л??????jtest?????????junit.framework.AssertionFailedError: expected:<14> but was:<0>????????????????add()??????????????β?????????????????????????????????????????????????????????????????????????????????????????????????outcome??

???????????й?

        jtest???????е?????????????й???????????????????????????У?jtest?????????й???

????

        ???jtest????????????м?????й?

???裺

1????example configuration
2????execution???
3????options????
4??????detect memory leaks???
5??apply??close
6?????library.java????????jtest example?????example.leaks??library.java
7????play????????????Jtest Using> User-Defined> Example Configuration
8??????????????????й????????
9?????[Line 37] Memory Leak: 3.8 megabytes per call?????????????????????????й?????????????addbook()?????????????????????37?д????????????б????
10?????????β??hashcode()??equals()??????????????????????й??????ɡ?

??????

???????Щ????????????о???Щ???????????涼??????????????Щ?????jtest????????????????д????????jtest?????????????????????????????????????????????????????????

Rulewizard????????????jtest????????????????jtest4.5??????汾?????????????????????Jtest4.5?汾????y??????????и??????Jtest??????Rulewizard????????κ???Ч???????????????????????????????????????

???Rulewizard??????淶???????η??????????????????????????????????????????????淶???????????

Rulewizard??jtest architect edition??????汾????????á???仰?????????????????????full?????????????????full?????????Rulewizard??ɡ?????????£?

??δ?Rulewizard???

1????Jtest> Jtest Configurations
2?????κ?jtest configuration??standards???
3????????rules???????????add user-defined rule??Rulewizard????????????????????????????????????????ο????????view in the Rulewizard UI????????????????????????parasoft???????????????????α??????Щ?淶????????????????????????????????jtest??????????????????????????jtest????д???????????????^-^??
??????

???????jtest?Щ????????????????????????2?????????????????Щ????????????

????????в???????

jtest????????в??????????????????????????????????????в?????????????????????????jtest????????????????????????????????????????????????????

??ζ?????????

1??            ???jtest-preferences
2??            ???jtest-scheduled testing
3??            ????enable scheduled testing???
4??            ?? execution time??????????????????????????????С???0??23??????????????????????0??59?????????????pm 10??30??????????????????????22??????????????30????
5??            ???configuration to run??edit???????????е?jtest configuration
6??            ?????edit?????????????????????????????????????
7??            ???apply

??????jtest????????д??????????????????????????

????????????????

???????????error found????????????????ο??????????????????

??????????????????

jtest?????????junit???????????????????????????????????????????Χ???????????????????????????????????????jtest???????????????????????75%??????????????????????????????????? 75%??

????????????????????????????????????????

1????Jtest> Jtest Configurations
2??????????????????????execution??????????option?????????report code coverage?????????

??????к???????????????????????????????????

1??????????????????????????????????????/?????????????????У???????????и???????У??????????б????????е????
2????coverage view??壬??????????????????????????????????????????????е??С???????У????????

         ???????jtest?????????????????????????????в?????????AutoRunner??robot???й????????????????????????д?????????????ü?????????????Щ????н????????????????????Χscope??????teamserver????????????Щ?????????????????jtest??????????????????????jtest???????????????????????????????????????????

???????????????????????????????????????????????????????????????????????????ν????????鹲??????????????????????????κ????????????????????????????????????????????????????????????κ??????????????????http://bbs.spasvo.com????????