do you have any Best Practice for testing


Posted in 面试题 onJune 04, 2016
Test everything that you want to work
More test methods in your TestCase than in the class you are testing
Tests should be as fine grained as possible
Tests should be independent
Should not take long to run (a few seconds)
Easy to understand and read
Make them safe
Developers must know they are not destructive
All developers must know about them
Everyone who touches the code must run the tests.
Determines how much of your code is covered by tests
If developer changes functionality, they may need to update test
Warning: you’ve changed the interface. Did you break someone else?
Even better, all tests pass AND new tests were added for new code
All tests pass all the time
Don’t allow even one test the “always fails”
Track down and fix the broken test immediately
Automate running of tests
Ex. All tests on tip revision of code get run automatically once per day with failures emailed.
Run tests on code check-in
Run tests before deployment
Have a reasonable copy of your production environment in a dev area.

Tags in this post...

面试题 相关文章推荐
mysql_pconnect()和mysql_connect()有什么区别
May 25 面试题
PHP解析URL是哪个函数?怎么用?
May 09 面试题
请说出你所知道的线程同步的方法
Apr 19 面试题
接口中的方法可以是abstract的吗
Jul 23 面试题
C语言如何决定使用那种整数类型
Nov 26 面试题
判断单链表中是否存在环
Jul 16 面试题
字符串str除首尾字符外的其他字符按升序排列
Mar 08 面试题
static全局变量与普通的全局变量有什么区别?static局部变量和普通局部变量有什么区别?static函数与普通函数有什么区别?
Feb 22 面试题
linux面试题参考答案(6)
Jun 23 面试题
Linux面试题LINUX系统类
Nov 25 面试题
软件配置管理有什么好处
Apr 15 面试题
JAVA招聘远程笔试题
Jul 23 面试题
某科技软件测试面试题
May 19 #面试题
英智兴达软件测试笔试题
Oct 12 #面试题
新媒传信软件测试面试题
Feb 24 #面试题
数字天堂软件测试面试题
Dec 23 #面试题
施惠特软件测试面试题以及笔试题
May 13 #面试题
品恩科技软件测试面试题
Oct 26 #面试题
飞利信loadrunner和软件测试笔试题
Sep 22 #面试题
You might like
pw的一个放后门的方法分析
2007/10/08 PHP
使用淘宝IP库获取用户ip地理位置
2013/10/27 PHP
php验证session无效的解决方法
2014/11/04 PHP
php通过前序遍历树实现无需递归的无限极分类
2015/07/10 PHP
PHP数组相加操作及与array_merge的区别浅析
2016/11/26 PHP
PHP文件管理之实现网盘及压缩包的功能操作
2017/09/20 PHP
Javascript写了一个清除“logo1_.exe”的杀毒工具(可扫描目录)
2007/02/09 Javascript
详谈 Jquery Ajax异步处理Json数据.
2011/09/09 Javascript
在myeclipse中如何加入jquery代码提示功能
2014/06/03 Javascript
jQuery ajax调用WCF服务实例
2014/07/16 Javascript
浅谈js函数的多种定义方法与区别
2016/11/29 Javascript
js通过指定下标或指定元素进行删除数组的实例
2017/01/12 Javascript
jQuery弹出窗口简单实现代码
2017/03/09 Javascript
AngularJS监听ng-repeat渲染完成的方法
2018/03/20 Javascript
解决vue项目打包后提示图片文件路径错误的问题
2018/07/04 Javascript
Python实现的数据结构与算法之快速排序详解
2015/04/22 Python
浅谈Python中函数的参数传递
2016/06/21 Python
python爬虫入门教程--HTML文本的解析库BeautifulSoup(四)
2017/05/25 Python
python3.5+tesseract+adb实现西瓜视频或头脑王者辅助答题
2018/01/17 Python
Python实现的各种常见分布算法示例
2018/12/13 Python
python线程中的同步问题及解决方法
2019/08/29 Python
Python获取一个用户名的组ID过程解析
2019/09/03 Python
opencv-python 读取图像并转换颜色空间实例
2019/12/09 Python
html5 canvas里绘制椭圆并保持线条粗细均匀的技巧
2013/03/25 HTML / CSS
Canvas实现贝赛尔曲线轨迹动画的示例代码
2019/04/25 HTML / CSS
美国最大的团购网站:Groupon
2016/07/23 全球购物
英国领先的男士服装和时尚零售商:Burton
2017/01/09 全球购物
国家地理在线商店:Shop National Geographic
2018/06/30 全球购物
暑期实践思想汇报
2014/01/06 职场文书
国旗下讲话演讲稿
2014/05/08 职场文书
高中教师考核方案
2014/05/18 职场文书
2014年银行柜员工作总结
2014/11/12 职场文书
2015年中个人总结范文
2015/03/10 职场文书
教你怎么用Python处理excel实现自动化办公
2021/04/30 Python
Python中json.dumps()函数的使用解析
2021/05/17 Python
vue实现水波涟漪效果的点击反馈指令
2021/05/31 Vue.js