Why do we need Unit test


Posted in 面试题 onJanuary 03, 2013
The test is the executable specification
Focus on the purpose first, then about the possible implementations
Understand the program‘s behavior by looking at the tests – the tests tell you more than an API description, they show the dynamics, how to use the API.
You develop just enough
You get to the goal as quick as possible
You don‘t develop unnecessary code
There is no code without a test
There is no test without a user requirement
Once you get one test working, you know it is working now and forever
You use the tests as regression tests
The tests give us the courage to refactor
You can prove that everything still works after the refactoring by simply executing the tests
Code quality – only code that is tested is checked into versioning system!
Well-written tests provide documentation on expected and unexpected use
Tests are fined grained – can be run independently
Tests can be aggregated easily
Which tests fail give you a hint of where a bug was introduced
Helps ensure you made a shippable product

Tags in this post...

面试题 相关文章推荐
PHP数据运算类型都有哪些
Nov 05 面试题
PHP面试题附答案
Nov 28 面试题
什么是serialVersionUID
Mar 04 面试题
什么是"引用"?申明和使用"引用"要注意哪些问题?
Mar 03 面试题
一道写SQL的面试题和答案
Nov 19 面试题
写一个在SQL Server创建表的SQL语句
Mar 10 面试题
SQL面试题
Dec 09 面试题
TCP协议通讯的过程和步骤是什么
Oct 18 面试题
你们项目是如何进行变更控制的
Aug 26 面试题
几道Web/Ajax的面试题
Nov 05 面试题
九州传奇上机题
Jul 10 面试题
如何通过jdbc调用存储过程
Apr 19 面试题
百度软件工程师职位
Feb 14 #面试题
软件配置管理有什么好处
Apr 15 #面试题
中间件分为哪几类
Mar 14 #面试题
软件生产职位结构化面试主要考察要素及面试题库
Jun 12 #面试题
一套软件开发工程师笔试题
May 18 #面试题
软件工程师面试题
Jun 25 #面试题
UML设计模式笔试题
Jun 07 #面试题
You might like
在PHP中使用与Perl兼容的正则表达式
2006/11/26 PHP
php上传图片存入数据库示例分享
2014/03/11 PHP
kohana框架上传文件验证规则写法示例
2014/07/14 PHP
ThinkPHP中ajax使用实例教程
2014/08/22 PHP
php版微信开发Token验证失败或请求URL超时问题的解决方法
2016/09/23 PHP
浅析PHP echo 和 print 语句
2020/06/30 PHP
javascript arguments 传递给函数的隐含参数
2009/08/21 Javascript
Jquery中获取iframe的代码
2011/01/11 Javascript
整理的比较全的event对像在ie与firefox浏览器中的区别
2013/11/25 Javascript
js、jquery图片动画、动态切换示例代码
2014/06/03 Javascript
node.js中的path.basename方法使用说明
2014/12/09 Javascript
JavaScript中原型和原型链详解
2015/02/11 Javascript
javascript中select下拉框的用法总结
2016/01/07 Javascript
实现高性能JavaScript之执行与加载
2016/01/30 Javascript
Js调用Java方法并互相传参的简单实例
2016/08/11 Javascript
Vue.js实现一个自定义分页组件vue-paginaiton
2016/09/05 Javascript
jQuery中常用动画效果函数(日常整理)
2016/09/17 Javascript
Mongoose实现虚拟字段查询的方法详解
2017/08/15 Javascript
使用Angular CLI进行单元测试和E2E测试的方法
2018/03/24 Javascript
php结合js实现多条件组合查询
2019/05/28 Javascript
Vue替代marquee标签超出宽度文字横向滚动效果
2019/12/09 Javascript
jQuery实现中奖播报功能(让文本滚动起来) 简单设置数值即可
2020/03/20 jQuery
JavaScript构造函数原理及实现流程解析
2020/11/19 Javascript
Python编写电话薄实现增删改查功能
2016/05/07 Python
django限制匿名用户访问及重定向的方法实例
2018/02/07 Python
python数据处理 根据颜色对图片进行分类的方法
2018/12/08 Python
python多任务及返回值的处理方法
2019/01/22 Python
Python利用heapq实现一个优先级队列的方法
2019/02/03 Python
django框架实现一次性上传多个文件功能示例【批量上传】
2019/06/19 Python
Python调用SMTP服务自动发送Email的实现步骤
2021/02/07 Python
欢迎领导检查标语
2014/06/27 职场文书
评职称个人总结
2015/03/05 职场文书
预备党员群众意见
2015/06/01 职场文书
一篇文章看懂MySQL主从复制与读写分离
2021/11/07 MySQL
UNION CREATIVE《Re:从零开始的异世界生活》雷姆手办
2022/03/20 日漫
Python中的 enumerate和zip详情
2022/05/30 Python