没有合适的资源?快使用搜索试试~ 我知道了~
Test Driven .NET Development with FitNesse
3星 · 超过75%的资源 需积分: 11 7 下载量 4 浏览量
2012-05-08
17:56:13
上传
评论
收藏 3.41MB PDF 举报
温馨提示
试读
278页
How to use Fitnesse Test Driven .NET Development
资源推荐
资源详情
资源评论
Test Driven .NET Development
with FitNesse
second edition
Gojko Adzic
Test Driven .NET Development with FitNesse: second edition
Gojko Adzic
Copy-editor: Marjory Bisset
Cover picture: Brian Samodra
Published 2009
Copyright © 2008-2009 Neuri Limited
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where these designations appear in this book, and the publisher was aware of a trademark
claim, the designations have been printed with initial capital letters or in all capitals.
The author has taken care in the preparation of this book, but makes no expressed or implied warranty
of any kind and assumes no responsibility for errors or omissions. No liability is assumed for incidental
or consequential damages in connection with or arising out of the use of the information or programs
contained herein.
All rights reserved. This publication is protected by copyright, and permission must be obtained from the
publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form
or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding
permissions, write to:
Neuri Limited
25 Southampton Buildings
London WC2A 1AL
United Kingdom
You can also contact us by e-mail: contact@neuri.com
Register your book online
Visit http://gojko.net/fitnesse and register your book online to get free PDF updates and
notifications about corrections or future editions of this book.
ISBN: 978-0-9556836-2-6 REVISION:2009-12-08
Preface to the second edition ........................................................... vii
What's new in this version? ..................................................... vii
Training and consultancy ................................................................ ix
Acknowledgements ......................................................................... xi
About the author ........................................................................... xiii
I. Getting started .............................................................................. 1
1. Introduction ......................................................................... 3
Who should read this book? .............................................. 3
Why bother with TDD? .................................................... 4
Beyond unit tests .............................................................. 6
Getting FIT ...................................................................... 7
FitNesse or NUnit? ........................................................... 9
The next step .................................................................. 12
2. Installing FitNesse ............................................................... 15
Setting up FitNesse ......................................................... 16
A quick test .................................................................... 17
How FitNesse connects to .NET classes ............................ 22
Don't forget the test ........................................................ 23
Playtime ......................................................................... 25
II. FitNesse and TDD in practice ..................................................... 27
3. Our Project ......................................................................... 29
Lottery rules ................................................................... 29
Selected user stories ........................................................ 29
Applying TDD to our project .......................................... 30
The next step .................................................................. 39
4. Writing basic tests ............................................................... 41
ColumnFixture — the Swiss Army knife of FitNesse ........ 43
Testing in plain English .................................................. 47
Playtime ......................................................................... 51
5. Writing simple test scripts ................................................... 53
Passing values between tables .......................................... 54
Writing a simple test script ............................................. 56
Use data-transfer objects directly .................................... 59
Using symbols to check dynamic values ........................... 61
Checking for errors ......................................................... 62
Playtime ......................................................................... 64
6. Writing efficient test scripts ................................................ 67
Better test scripts with DoFixture .................................... 69
iii
Use DoFixture keywords for better control ...................... 73
Keep ActionFixture in mind ............................................ 75
Playtime ......................................................................... 76
7. Removing duplication ......................................................... 79
Group related tests into test suites ................................... 79
Include pages and use them as components ..................... 82
Reuse entire suites with symbolic links ............................ 83
Use markup variables to parameterise test pages .............. 84
Defining common actions ............................................... 85
Remove irrelevant information ....................................... 86
Acceptance tests should focus on business rules ............... 88
Hide parts of the page ..................................................... 88
Playtime ......................................................................... 88
8. Coordinating fixtures .......................................................... 91
Embed fixtures for best results ........................................ 92
Use SetUpFixture to prepare the stage for tests ................ 94
Create test suites in flow mode ........................................ 99
Wrapping business objects with DoFixture .................... 101
Playtime ....................................................................... 102
9. Working with collections ................................................... 103
Testing lists of objects ................................................... 104
Checking for empty collections ...................................... 108
Beware of test extensions ............................................... 109
Use RowFixture for better precision .............................. 111
Playtime ....................................................................... 114
III. Advanced FitNesse usage ......................................................... 117
10. Working in a team ........................................................... 119
Options for team setup .................................................. 119
Organising the files ....................................................... 123
Integrating with automated build tools .......................... 127
11. Testing web interfaces ..................................................... 135
Choosing the right thing to test ..................................... 135
Introducing Selenium ................................................... 138
Connecting from FitNesse ............................................. 142
Running tests on a remote server ................................... 147
More Selenium tests ...................................................... 149
12. Testing database code ...................................................... 151
Connecting to the database ........................................... 151
iv
Test Driven .NET Development with FitNesse
Working with stored procedures ................................... 155
Preparing test data ........................................................ 156
Executing statements .................................................... 157
Verifying query results .................................................. 157
Other DbFit features ..................................................... 158
13. Testing legacy code .......................................................... 161
Covering legacy code with tests ..................................... 161
Use blank cells to print out results ................................. 162
Use show and check with FitLibrary ............................... 163
Wrap existing objects for tests ....................................... 163
Use ArrayFixture and RowFixture to capture data
batches ......................................................................... 164
Using existing forms for regression tables ...................... 165
14. Using business domain objects directly ............................ 169
System under test with ColumnFixtures ........................ 169
Changing the system under test ..................................... 170
Using collections directly .............................................. 172
Setting the system under test from FitNesse ................... 174
Using named fixtures .................................................... 175
Don't go too far ............................................................ 175
15. Tips and tricks ................................................................. 177
What really happens during a test? ................................ 177
Attaching the Visual Studio debugger ............................ 182
Load non-standard cell operators for simpler comparis-
ons ............................................................................... 183
Simplify verifications with a custom cell operator .......... 184
Avoid conversions by supporting custom data types ....... 186
Implement domain-specific tests using custom
fixtures ......................................................................... 187
IV. Appendices ............................................................................. 191
A. Formatting text ................................................................ 193
B. Test smells ........................................................................ 195
C. Resources ......................................................................... 197
Web sites ...................................................................... 198
Blogs with good articles on FitNesse and FitSharp .......... 199
Articles ......................................................................... 200
Video presentations and slides ...................................... 201
D. Source code ...................................................................... 203
v
剩余277页未读,继续阅读
资源评论
- warmworm2014-05-13gojko.net有免费版 这里有点贵
yaoxiaoliang
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 笔记实验六,spark,大数据分析
- ####蓝桥杯python的详细的信息介绍
- 电子万年历软件仿真(经过多次修改,保证正确性)
- Unity XR 手势射击控制脚本(适用于任何可手势识别的设备)
- 机械设计全自动电表(NB和IC卡表)控制和上壳装配线sw16可编辑非常好的设计图纸100%好用.zip
- 基于matlab的EAN-13条形码识别系统GUI界面.zip代码53
- matlab基于bp神经网络交通信号标志识别GUI界面13个标志.zip代码54
- 电子万年历答辩实物展示视频mp4格式
- 基于python实现的程序,包括哈希感知算法cvHash,图像切割cvsplit,固定目标检测cvRec(附文档ppt)等
- 计算0-10000之间所有偶数的和
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功