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...

面试题 相关文章推荐
JDO的含义
Nov 17 面试题
Ibatis如何调用存储过程
May 15 面试题
精伦电子Java笔试题
Jan 16 面试题
构造方法和其他方法的区别?怎么调用父类的构造方法
Sep 22 面试题
C语言编程题
Mar 09 面试题
strstr()的简单实现
Sep 26 面试题
.NET程序员的数据库面试题
Oct 10 面试题
介绍一下HTTP、HTTPS和SSL
Dec 16 面试题
Shell如何接收变量输入
Sep 24 面试题
什么是lambda函数
Sep 17 面试题
怎样在 Applet 中建立自己的菜单(MenuBar/Menu)?
Jun 20 面试题
什么时候需要进行强制类型转换
Sep 03 面试题
某科技软件测试面试题
May 19 #面试题
英智兴达软件测试笔试题
Oct 12 #面试题
新媒传信软件测试面试题
Feb 24 #面试题
数字天堂软件测试面试题
Dec 23 #面试题
施惠特软件测试面试题以及笔试题
May 13 #面试题
品恩科技软件测试面试题
Oct 26 #面试题
飞利信loadrunner和软件测试笔试题
Sep 22 #面试题
You might like
深思 PHP 数组遍历的差异(array_diff 的实现)
2008/03/23 PHP
完美实现GIF动画缩略图的php代码
2011/01/02 PHP
php文件打包 下载之使用PHP自带的ZipArchive压缩文件并下载打包好的文件
2012/06/13 PHP
PHP启动windows应用程序、执行bat批处理、执行cmd命令的方法(exec、system函数详解)
2014/10/20 PHP
laravel 使用auth编写登录的方法
2019/09/30 PHP
根据地区不同显示时间的javascript代码
2007/08/13 Javascript
比Jquery的document.ready更快的方法
2010/04/28 Javascript
jQuery中outerWidth()方法用法实例
2015/01/19 Javascript
编写自己的jQuery提示框(Tip)插件
2015/02/05 Javascript
JS实现网页上随机产生超链接地址的方法
2015/11/09 Javascript
细数JavaScript 一个等号,两个等号,三个等号的区别
2016/10/09 Javascript
Bootstrap学习笔记之进度条、媒体对象实例详解
2017/03/09 Javascript
JS将时间秒转换成天小时分钟秒的字符串
2019/07/10 Javascript
[02:42]决战东方!DOTA2亚洲邀请赛重启荣耀之争
2017/03/17 DOTA
Python入门篇之面向对象
2014/10/20 Python
快速实现基于Python的微信聊天机器人示例代码
2017/03/03 Python
Python爬虫实例爬取网站搞笑段子
2017/11/08 Python
python PyTorch预训练示例
2018/02/11 Python
python3解析库lxml的安装与基本使用
2018/06/27 Python
python 图片去噪的方法示例
2019/07/09 Python
python实现Oracle查询分组的方法示例
2020/04/30 Python
阿迪达斯比利时官方商城:adidas比利时
2016/10/10 全球购物
波兰补充商店:Muscle Power
2018/10/29 全球购物
Bose美国官网:购买Bose耳机和音箱
2019/03/10 全球购物
标准导师推荐信(医学类)
2013/10/28 职场文书
酒店人事专员岗位职责
2013/12/19 职场文书
校园奶茶店创业计划书
2014/01/23 职场文书
农村结婚典礼司仪主持词
2014/03/14 职场文书
优秀三好学生事迹材料
2014/08/31 职场文书
医药公司采购员岗位职责
2014/09/12 职场文书
投诉信格式范文
2015/07/02 职场文书
给校长的建议书范文
2015/09/14 职场文书
社区挂职锻炼个人工作总结
2015/10/23 职场文书
go goroutine 怎样进行错误处理
2021/07/16 Golang
Vue实现跑马灯样式文字横向滚动
2021/11/23 Vue.js
Go归并排序算法的实现方法
2022/04/06 Golang