同事在群里发了于娟的博客,有一点印象深刻,她说自己”争强好胜决不认输自控力不强”。嗯,自控力太重要了。
看于娟博客
April 27th, 2011单元测试
April 13th, 2011评论单元测试
1.测试用例就是需求,需求明确,减小了项目风险,有利于系统的持续进化;
2.测试用例就是接口,接口明确,rd开发轻松愉快;
3.测试用例就是工具,工具能减少人肉操作,qa测试轻松愉快;
4.测试用例就是文档,并且是最新的文档(测试用例一定会和代码同步更新),新人轻松愉快;
测试用例就在那里就在那里,希望你能得到它。。
不好的地方是初期投入大,需要培养习惯,需要强大的执行力。
程序员的抓狂
April 1st, 2011最近又抓狂了一次,总结一下
念书的时候,给人写java web 应用,单个访问没啥问题,做压力的时候发现不稳定,压着压着内存狂涨,就挂了,很抓狂,到各论坛上问人是啥原因,后来发现时sql驱动程序版本不对,换了一个叫jtds的驱动程序就好使了;
某次写个多线程抓图程序,每1000张总有那么几张不对,后来发现自己搞一个类似boost 加锁的guard,希望在函数开始的时候加锁,不管是啥原因结束,锁都能自动释放。结果没有给变量起名字,成了个临时变量,也就是说锁加上后就被释放了;
某次某人写个java swing程序,界面上的元素会不断更新。发现更新得不平滑,老闪。后来发现时更新得代码没有用SwingUtility执行,多个线程并发更新界面;
某次某多线程总core,把一个hashmap dump出来发现某个指针是1,几个月后,发现是框架中的的一个标志位;
某次某程序不稳定,内存里有两片cache,数据文件只有一个,cache误用;
时间管理
April 1st, 2011我每天都感觉挺忙,是不是因为我太懒了啊
用callgrind做profile
February 26th, 2011To use this tool, you must specify –tool=callgrind on the Valgrind command line.
Callgrind is a profiling tool that records the call history among functions in a program’s run as a call-graph. By default,
the collected data consists of the number of instructions executed, their relationship to source lines, the caller/callee
relationship between functions, and the numbers of such calls. Optionally, cache simulation and/or branch prediction
(similar to Cachegrind) can produce further information about the runtime behavior of an application.
The profile data is written out to a file at program termination. For presentation of the data, and interactive control of
the profiling, two command line tools are provided:
callgrind_annotate
This command reads in the profile data, and prints a sorted lists of functions, optionally with source annotation.
For graphical visualization of the data, try KCachegrind, which is a KDE/Qt based GUI that makes it easy to navigate
the large amount of data that Callgrind produces.
callgrind_control
This command enables you to interactively observe and control the status of a program currently running under
Callgrind’s control, without stopping the program. You can get statistics information as well as the current stack
trace, and you can request zeroing of counters or dumping of profile data.
为墙所迫
February 26th, 2011appspot又被盾了,导致我的博客不能被访问啊。。
换博客地址http://qichengblog.appspot.com/
September 16th, 2010还是换回
http://qichengblog.appspot.com/
觉得blog.lailicai.com应该属于更多的人,哈哈
大宅门换人
September 11th, 2010第二部和第一部的差距真是太大了,nnd,电视剧火了,大家就都要来插队。香秀,黄爷,敬业,田木,这都换的是啥,差距太大了,愤怒。。。。
推荐雅虎邮箱里的记事本功能
August 30th, 2010google doc有时候用不了,用用这个也挺好,甚至有更好,更简单更方便。
设计模式的一个大bug
August 25th, 2010斗胆说一下,设计模式的立意不对,软件设计不能和建筑设计类比。
1. 一个建筑怎么着也得撑个上百年,修好后一般不会大改,也改不了;
2. 建筑要追求美,为什么要追求美? 你要是一个不美的东西在那耸立个上百年,那不是给某著名建筑师脸上抹黑吗?所以这玩意得精雕细琢。
3. 软件不一样,软件要实用,公司要讲究投入产出比。另外软件更新快,特别是公司里做的软件,某人只会为软件的某个版本负责,做得就算不好,也不会像个建筑在那里耸立个上百年。
所以如果一定要拿设计软件通设计建筑类比,那也应该是同设计宿舍楼比
宿舍楼的特点有:
1. 实用,投入产出高,能满足用户的需求
2. 用户多,要能适应高负载,能防火防盗
所以,各位造宿舍楼的民工就不要像造教堂的民工那么纠结了。