由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 大家写unit test的时间会花多少?
相关主题
unit testing有多么的重要对PyCharm屈服了……
各位的公司搞不搞test driven development?怎么做C++的unit testing?
自动生成unit test的软件推荐?agitar?菜鸟以为C++的unit test功能没有java强大,是一大缺点
Refactoring long class step by step (1)请教如何unit test for node.js REST+database
C++ IDE under Linux请教unit test的best practice
你身边有这样的人吗?--- code stylistHow does YAHOO calculate RSI? (转载)
写Java程序不用IDE,那心灵得多强大啊请教template和factory有啥区别?
FP的教材是怎么误导人的map是用什么data structure来implement的?
相关话题的讨论汇总
话题: test话题: code话题: cases话题: write话题: testing
进入Programming版参与讨论
1 (共1页)
d**e
发帖数: 6098
1
我太弱了,基本上和写source code各占一半时间,有时甚至更多,有时写着写着,发
现边边角角的case越来越多就越花时间。
g*****g
发帖数: 34805
2
这个不是问题,让QA帮你找出来,更花时间。

【在 d**e 的大作中提到】
: 我太弱了,基本上和写source code各占一半时间,有时甚至更多,有时写着写着,发
: 现边边角角的case越来越多就越花时间。

m*****e
发帖数: 4193
3
More than 50%
d**e
发帖数: 6098
4
那我平衡了
近来花得更多时间,所以越来越怀疑自己是不是有问题了

【在 m*****e 的大作中提到】
: More than 50%
a***y
发帖数: 2803
5
en,test code也很难写.所以写程序前先做好计划,分析狠重要.表想到哪里写到哪里.据
说很多早期的程序员依赖酒精甚至大麻来找到灵感和兴奋.

【在 d**e 的大作中提到】
: 我太弱了,基本上和写source code各占一半时间,有时甚至更多,有时写着写着,发
: 现边边角角的case越来越多就越花时间。

s***o
发帖数: 2191
6
这个时间还算合理吧

【在 d**e 的大作中提到】
: 我太弱了,基本上和写source code各占一半时间,有时甚至更多,有时写着写着,发
: 现边边角角的case越来越多就越花时间。

s***o
发帖数: 2191
7
有啥unit testing 尤其是TDD的好书推荐?

【在 g*****g 的大作中提到】
: 这个不是问题,让QA帮你找出来,更花时间。
g**********y
发帖数: 14569
8
Test-Driven Development (Kent Beck)
Refactoring (Martin Fowler), there is a chapter about test-driven dev. It's short but to the point. I learned a lot from that chapter, like:
- don't spend ages trying to write tests cover all areas
- the key to write test is think about features, guarantee those features are implemented as you thought
- a few good tests are better than thousands of marginal ones
- write tests where you have concern, where you cannot sleep well over it
...
When I worked for old company, they require ONE test per 10 lines of code. Well, we have 5000 lines of code, that needs 500 test cases to cover it. You know what I do? I write a test generator to generate those 500 test cases from source code. Of course, it is useless.
You force people to cheat, then people will cheat.

【在 s***o 的大作中提到】
: 有啥unit testing 尤其是TDD的好书推荐?
D*******a
发帖数: 3688
9
if your manager is not pushy and understands the important of testing, spend
as much time testing as you can.

【在 d**e 的大作中提到】
: 那我平衡了
: 近来花得更多时间,所以越来越怀疑自己是不是有问题了

g*****g
发帖数: 34805
10
TDD is good but shouldn't be followed religiously.
As I said, start with sunnyday cases, and add more
for marginal cases or when a bug is found.

s short but to the point. I learned a lot from that chapter, like:
are implemented as you thought
Well, we have 5000 lines of code, that needs 500 test cases to cover it.
You know what I do? I write a test generator to generate those 500 test
cases from source code. Of co

【在 g**********y 的大作中提到】
: Test-Driven Development (Kent Beck)
: Refactoring (Martin Fowler), there is a chapter about test-driven dev. It's short but to the point. I learned a lot from that chapter, like:
: - don't spend ages trying to write tests cover all areas
: - the key to write test is think about features, guarantee those features are implemented as you thought
: - a few good tests are better than thousands of marginal ones
: - write tests where you have concern, where you cannot sleep well over it
: ...
: When I worked for old company, they require ONE test per 10 lines of code. Well, we have 5000 lines of code, that needs 500 test cases to cover it. You know what I do? I write a test generator to generate those 500 test cases from source code. Of course, it is useless.
: You force people to cheat, then people will cheat.

l*********s
发帖数: 5409
11
Though it is essential, but writing testing is kind of killing the fun. :-(
a***n
发帖数: 584
12
If things are done in the right way, I might spend more time in writing unit
test, and to have at least 90% core code coverage.
Test code is usually twice as long as the production code, especially if you
want to incorporate mock test and integration test.
1 (共1页)
进入Programming版参与讨论
相关主题
map是用什么data structure来implement的?C++ IDE under Linux
再来讨论一直算法课的作业吧你身边有这样的人吗?--- code stylist
Refactoring long class step by step (2)写Java程序不用IDE,那心灵得多强大啊
郁闷FP的教材是怎么误导人的
unit testing有多么的重要对PyCharm屈服了……
各位的公司搞不搞test driven development?怎么做C++的unit testing?
自动生成unit test的软件推荐?agitar?菜鸟以为C++的unit test功能没有java强大,是一大缺点
Refactoring long class step by step (1)请教如何unit test for node.js REST+database
相关话题的讨论汇总
话题: test话题: code话题: cases话题: write话题: testing