游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1506|回复: 0

测试驱动

[复制链接]

193

主题

870

帖子

903

积分

高级会员

Rank: 4

积分
903
QQ
发表于 2010-2-25 23:12:00 | 显示全部楼层 |阅读模式
我发誓,从今天起,每行代码都要测试驱动!!(这个是2010年1月4日我个人的誓言,到今天以致以后都在坚决执行中。)

Today is a momentous day - first day of new year. Today I am going to start a new life. I am going to stop eating a greasy food, start attending a fitness club and today I am going to test programs I am writing. I can start right after the last line of a program is completed or, even better, I can write tests while I am coding. And maybe next time I will write tests before the coding, during the design stage. I have read a lot of literature on how to write the tests, I have the unit test framework in hand and an idea of new class. So let's get started.

今天是重要的一天 ? 新年的第一天。今天我要开始一种新的生活。我要停止吃充满油脂的食物,开始参加健身俱乐部, 并且今天我要开始测试写的程序。我会在程序最后一次结束后开始测试,更进一步,我可以在编码时编写测试。 下次我可以在编码前的设计阶段编写测试。 我已经阅读了大量关于如何编写测试的文献,我手头已经有了单元测试框架,并且已经有了新类的想法。 那么我们开始吧。

以上段落摘选自Boost手册。

如果你用过测试驱动开发,那么一定理解我所说的话,你会爱死它的,测试驱动就是一个最完美的软件开发指导者,帮助你写出好的正确的代码。

我用过几种不同的单元测试框架,但直到我遇到了Boost中的单元测试框架,我就没有再次更改过。他是专门为C++量身定做,没有任何额外的东西,简单而强大。

http://class.gd/node/33
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-6-14 13:14

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表