如果单元测试这么好,为什么没有更多的公司去做呢? [英] If unit testing is so great, why aren't more companies doing it?

查看:20
本文介绍了如果单元测试这么好,为什么没有更多的公司去做呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的第一家真正的软件公司都是关于单元测试 (NUnit).我不知道当时我们是不是真的坚持它——我不知道我们的代码覆盖率是什么样的,而且我正在编写大部分单元测试.从那以后,我遇到了一些进行大量测试的公司,但它是椅子测试:依赖于在场的人,重复性低,捕捉错误的机会低.另一种态度是:这是他们想要在未来"进行的事情;基本上是当钱从天上掉下来的时候.

The first real software company that I worked at was all about the unit testing (NUnit). I don't know that we were real sticklers for it back then -- I have no idea what our code coverage was like and I was writing most of the unit tests. Since then I've run into some companies that do lots of testing, but it's chair testing: relies on a person being there, has low repeatibility and low chance of catching bugs. The other attitude is: it was something they wanted to get going with "in the future"; basically when money falls from the sky.

我怀念单元测试——它只是让生活更轻松.但我发现当我找一份新工作时,单元测试要么是公司希望在未来开始"的事情,要么是他们根本不做的事情(呃,它已经存在了一段时间了现在!).我想说的是,我在过去 2 年中看到的工作要求中有 60-75% 根本没有列出单元测试.我只能想到一两个具有单元测试经验的要求(对于中级开发人员职位).

I miss unit testing -- it just makes life easier. But I'm finding that when I look for a new job, unit testing is either something that companies would like to "get going with" in the future or something they don't do at all (uhh, it's been around for a while now!). I'd say that 60-75% of the job reqs I've looked at over the past 2 years have not listed unit testing at all. I can only think of one or two that had unit testing experience as a requirement (for a mid-level developer position).

那么问题是,缺少什么?我认为它可以提高人们的工作效率,但这只是在实际花费大量时间之后.没有关于单元测试成本节约的好的研究吗?这是我正在寻找的公司类型吗?

So the question is, what's missing? I think it makes people more productive, but that's only after spending a solid amount of time actually doing it. Aren't there any good studies about the cost savings of unit testing? Is it the type of company I'm looking at?

尽管标题有点恶魔般的拥护者,但我认为自己是单元测试的支持者.

even though the title is a bit devils-advocate, I consider myself a unit testing proponent.

推荐答案

根据我的经验,这涉及到几个因素:

In my experience, there are a couple of factors involved in this:

  1. 管理层并不真正了解单元测试到底是什么,或者为什么它对他们具有真正的内在价值.
  2. 管理层往往更关心产品的快速交付,并且(错误地)认为单元测试会适得其反.
  3. 有一种误解,认为测试只属于 QA 的范畴.开发人员是编码人员,无法编写测试.
  4. 一种普遍的误解是,尽管工具是免费提供的,但管理层必须花钱才能正确进行单元测试.(当然,开发人员需要花更多时间来考虑,但这并不是真的禁止.)
  5. Will 的回答将完善这个答案:确定测试代码的价值非常困难(编辑 jcollum)

当然,还有其他因素,但这些只是我目前遇到的.

Naturally, there are other factors, but those are just what I've run into so far.

这篇关于如果单元测试这么好,为什么没有更多的公司去做呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆