Test-Driven Development using FIT - PowerPoint PPT Presentation

About This Presentation
Title:

Test-Driven Development using FIT

Description:

Title: Test-Driven Development a Hands-On Introduction Author: kj Last modified by: Sawa Ito Created Date: 7/30/2003 12:55:51 AM Document presentation format – PowerPoint PPT presentation

Number of Views:168
Avg rating:3.0/5.0
Slides: 29
Provided by: kj75
Category:

less

Transcript and Presenter's Notes

Title: Test-Driven Development using FIT


1
Test-Driven Development using FIT
  • ?? ??
  • ?????????

2
????????
  • ??????Agile Development Conference 2003????? Ward
    Cunningham????????????????????????????????????????

3
Test-Driven Development
  • ???????????FIT(Framework for Integrated
    Test)??????????????????????????
  • FIT???????????????????????????????????????????????
    ????????????????

4
Guide Development
  • FIT???????????????????????????????
  • ????????????????????????????

5
Refactoring
  • TDD?????????Test-Driven-Design????????Refactoring?
    ????????????
  • ???????????

6
FIT
  • FIT????????????test-table????????test-fixture?????
    ????
  • Test-table??????????????????????
  • Test-fixture?????test-table?????????????

7
FIT??????????????
  • FITNESSE?????
  • FITNESSE???FITWiki??Wiki?????????????????????????
    ?
  • ?????????????Wiki????????????????????

8
Install FIT(NESSE)
9
FITNESSE???????
  • http//fitnesse.org/??????????
  • ?????sourceforge???
  • ???v20030728?
  • Fitnesse20030728.zip(????)
  • Fitnesse_src20030728.zip(???)
  • ???????????????

10
FITNESSE???
  • ?????????????Zip?????
  • Java??????PC??????run.bat?????
  • Java?http//java.sun.com/????????
  • http//localhost/?????

11
Fit Tasks
12
FIT Test 30/360 Calendar
  • ???????????1???30??1??360?????????(30/360Calendar?
    ??)
  • 30/360Calendar??????????????????
  • ????????form, to, days()
  • days()?from??to????????int?????
  • ColumnFixture???????????????
  • ??????????????????

13
FIT Test 30/360 Calendar
fitsample.ThirtyThreeSixty fitsample.ThirtyThreeSixty fitsample.ThirtyThreeSixty
from to days()
2001/01/10 2001/01/20 10
2001/01/10 2001/02/10 30
2001/01/10 2002/01/10 360
2001/01/10 2002/12/25 705
14
FIT 1. create new page
  • 30/360?????????????????Wiki???????????????
  • http//localhost/ FrontPage?????Edit???????Front
    Page???????????
  • ??????ThirtyThreeSixty?????Save????
  • FrontPage??ThirtyThreeSixty???????????????????????
    ???????

15
FIT 2. Edit Test
  • ????????ThirtyThreeSixty????Edit???????????????S
    ave????
  • ???????????????????
  • ?????????????????Fixture??????

ThirtyThreeSixty fromtodays() 2001/01/1020
01/01/2010 2001/01/102001/02/1030 2001/01/1
02002/12/25705 ---- ClassPath
16
FIT 3. Config Test
  • ThirtyThreeSixty????Properties???????Test?????
    ??Save????

17
FIT 4. Add ClassPath
  • ?????????????????????
  • ThirtyThreeSixty????ClassPath???????Classpath????
    Edit???????
  • Save???FrontPage??ThirtyThreeSixty?????????

!path fit.jar !path fitnesse.jar !path sample
18
FIT 5. Run Test
  • ????????????????
  • ?????????(ThirtyThreeSixty???)????????????????
  • ?(???) ThirtyThreeSixty??????!!

19
FIT 6. Create new class
  • ThirtyThreeSixty??????????
  • fitnesse/sample/fitsample?????ThirtyThreeSixty.jav
    a????????????????

package fitsample import fit.ColumnFixture publ
ic class ThirtyThreeSixty extends
ColumnFixture
gt javac -classpath fit.jar -d sample
sample\fitsample\.java
20
FIT 7. Re Run Test
21
FIT 8. Create from-to Field
  • from, to????????!?????????????????ThirtyThreeSixty
    ??????????
  • ?????????????

package fitsample import fit.ColumnFixture impor
t java.util.Date public class ThirtyThreeSixty
extends ColumnFixture public Date from
public Date to
22
FIT 9 Re-Re Run Test
  • ????????????
  • days()???????!????????????????

23
FIT 10. Create days() Method
  • days()??????????????????return 0
    ??????????????????????
  • Save??????????

package fitsample import fit.ColumnFixture impor
t java.util.Date public class ThirtyThreeSixty
extends ColumnFixture public Date from
public Date to public int days()
return 0
24
FIT 11. Re Re Re Run Test
  • ????????????
  • ??????????????????????????
  • ?????????????(????0?????)??????????

25
FIT 12. Fake IT
  • ????????????????????????????????????return
    10?????
  • Save?????????

package fitsample import fit.ColumnFixture impor
t java.util.Date public class ThirtyThreeSixty
extends ColumnFixture public Date from
public Date to public int days()
return 10
26
FIT 13. RE4 Run Test
  • ?????????????
  • ??????????????????????

27
FIT 14. Implementation
  • ??????????????????????????????????????????????????

28
??
  • actualDays()????????????????
  • ?????????????????????????????
  • FIT?ColumnFixture???????????????????
Write a Comment
User Comments (0)
About PowerShow.com