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

面试题 相关文章推荐
Yahoo-PHP面试题3
Jan 14 面试题
浙大网新C/C++面试解惑
May 27 面试题
求∏的近似值,直到最后一项的绝对值小于指定的数
Feb 12 面试题
链表面试题-一个链表的结点结构
May 04 面试题
如何打印出当前源文件的文件名以及源文件的当前行号
Apr 05 面试题
以下为Windows NT 下的32 位C++程序,请计算sizeof 的值
Dec 07 面试题
一道SQL存储过程面试题
Oct 07 面试题
什么是makefile? 如何编写makefile?
Aug 08 面试题
Python是如何进行类型转换的
Jun 09 面试题
介绍一下Java的事务处理
Dec 07 面试题
金额转换,阿拉伯数字的金额转换成中国传统的形式如:(¥1011)-> (一千零一拾一元整)输出
May 29 面试题
J2EE模式面试题
Oct 11 面试题
某科技软件测试面试题
May 19 #面试题
英智兴达软件测试笔试题
Oct 12 #面试题
新媒传信软件测试面试题
Feb 24 #面试题
数字天堂软件测试面试题
Dec 23 #面试题
施惠特软件测试面试题以及笔试题
May 13 #面试题
品恩科技软件测试面试题
Oct 26 #面试题
飞利信loadrunner和软件测试笔试题
Sep 22 #面试题
You might like
关于页面优化和伪静态
2009/10/11 PHP
php使用Smarty的相关注意事项及访问变量的几种方式
2011/12/08 PHP
PHP利用str_replace防注入的方法
2013/11/10 PHP
PHP下使用mysqli的函数连接mysql出现warning: mysqli::real_connect(): (hy000/1040): ...
2016/02/14 PHP
javascript 操作文件 实现方法小结
2009/07/02 Javascript
JavaScript读取中文cookie时的乱码问题的解决方法
2009/10/14 Javascript
javascript中xml操作实现代码
2011/11/21 Javascript
JavaScript加强之自定义callback示例
2013/09/21 Javascript
jQuery实现动画效果的简单实例
2014/01/27 Javascript
jQuery Trim去除字符串首尾空字符的实现方法说明
2014/02/11 Javascript
JavaScript 事件对象介绍
2015/04/13 Javascript
Js数组排序函数sort()介绍
2015/06/08 Javascript
javascript实现跨域的方法汇总
2015/06/25 Javascript
jQuery实现的导航动画效果(附demo源码)
2016/04/01 Javascript
vue.js开发环境安装教程
2017/03/17 Javascript
Vue官方推荐AJAX组件axios.js使用方法详解与API
2018/10/09 Javascript
js实现简单音乐播放器
2020/06/30 Javascript
[02:24]DOTA2痛苦女王 英雄基础教程
2013/11/26 DOTA
详解如何在Apache中运行Python WSGI应用
2019/01/02 Python
Python实现对特定列表进行从小到大排序操作示例
2019/02/11 Python
获取django框架orm query执行的sql语句实现方法分析
2019/06/20 Python
Python企业编码生成系统总体系统设计概述
2019/07/26 Python
在Python中画图(基于Jupyter notebook的魔法函数)
2019/10/28 Python
Python Pandas 转换unix时间戳方式
2019/12/07 Python
python——全排列数的生成方式
2020/02/26 Python
python 3.8.3 安装配置图文教程
2020/05/21 Python
python爬取代理IP并进行有效的IP测试实现
2020/10/09 Python
如何利用python读取micaps文件详解
2020/10/18 Python
Python基于Socket实现简易多人聊天室的示例代码
2020/11/29 Python
澳大利亚购买最佳炊具品牌网站:Cookware Brands
2019/02/16 全球购物
Looking4Parking美国:全球排名第一的机场停车比较品牌
2019/08/26 全球购物
学校标语大全
2014/06/19 职场文书
Mysql Show Profile
2021/04/05 MySQL
Python爬虫基础初探selenium
2021/05/31 Python
一文了解MySQL二级索引的查询过程
2022/02/24 MySQL
win11电脑关机鼠标灯还亮怎么解决? win11关机后鼠标灯还亮解决方法
2023/01/09 数码科技