Unit Test 筆記-introduction

1.1 Coding With Condence

Dale would write a new routine and a short test to go alongwith it.

Nothing fancy, just a simple test to see if the routine just written actually did what it was supposed to do.

It took alittle longer to think of the test, and write it, but Dale refused to move on until the new routine could prove itself

1.2 What is Unit Testing?

Unit tests are performed to prove that a piece of code does what the developer thinks it should do.

After all, if we aren't sure the code is doing what we think,then any other forms of testing may just be a waste of time.


1.3 Why Should I Bother with Unit Testing?

Unit testing will make your life easier . It will make your designs better and drastically reduce the amount of time you
spend debugging.

When basic, low-level code isn't reliable, the requisite xesdon't stay at the low level. You x the low level problem, but
that impacts code at higher levels, which then need xing,and so on. Fixes begin to ripple throughout the code, getting
larger and more complicated as they go. The house of cardsfalls down, taking the project with it

1.4 What Do I Want to Accomplish?

Many developers who claim they do testing only ever write onetest. That's the test that goes right down the middlE


Code that you can't depend on is useless. Worse, code thatyou think you can depend on (but turns out to have bugs) can
cost you a lot of time to track down and debug. There arevery few projects that can afford to waste time, so you want to
avoid that “one step forward two steps back” approach at all costs,
and stick to moving forward.


It's not polite to expect others to clean up our own messes,
and in extreme cases submitting large volumes of buggy code
can become a “career limiting” move.
On the other hand, if the testers or QA group nd it very
difcult to nd fault with your code, your reputation will grow
rapidly—along with your job security!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值