摘要: 上个星期测试道的Monkey老师和我聊到测试用例参数过多的问题,其实这样的问题在我这里也同样经历过。比如我的测试用例必须面对不同的测试环境,每个环境有无数的参数,开发的最初阶段,因为参数少,所以就放在执行的命令行里,随着测试用例的不断增长,参数从4-5个增长到30多个,而且每个用例使用的参数也不完全相同,有使用ABCD的,有使用ADHJ的。另外有些参数想传一个数组进去,用命令行参数的方法就很难处理。经过考虑,果断的使用配置文件来解决问题。选择配置文件当时有两个方案,一个是直接写成Ruby代码,但是考虑到要和自动化测试框架共享配置文件,所以最后决定使用YAML格式。Ruby对YAML的支持非常好 阅读全文
posted @ 2013-10-17 11:26 移山测试工作室黑灯老师 阅读(1380) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/reverse-integer/Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before coding. Bonus points for you if you have already thought through this 阅读全文
posted @ 2013-10-17 10:40 移山测试工作室黑灯老师 阅读(537) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/zigzag-conversion/The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I I GY I RAnd then read line by line: "PAHNAPLSI 阅读全文
posted @ 2013-10-15 13:47 移山测试工作室黑灯老师 阅读(415) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/longest-palindromic-substring/Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.思路:这题有牛B的算法,大家可以自己Google。这里用一种比较简单的算法,虽然不够快但是也能过OJ。如果一个字符串已经是回文字 阅读全文
posted @ 2013-10-14 21:22 移山测试工作室黑灯老师 阅读(351) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/add-two-numbers/You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.Input: (2 -> 4 -> 3) + (5 -> 6 -> 阅读全文
posted @ 2013-10-14 21:07 移山测试工作室黑灯老师 阅读(319) 评论(0) 推荐(0) 编辑
摘要: Why Are There So Many C++ Testing Frameworks? by Zhanyong Wan (Software Engineer)最近貌似有很多人正在开发他们自己的C++测试框架,如果还没能完工。Wiki上有一个此类框架的不完全列表。因为大多数面向对象编程语言只有1到2个主要的框架,对C++而言这就显得有趣了。例如,大多数Java开发者都使用JUnit或TestNG。难道C++程序员都是疯狂的DIY爱好者吗?当我们开发并将Google Test(Google的C++测试框架)开源后,人们开始好奇为什么我们要做这件事。简单的回答是我们没有能够找到一个已有的并且能够 阅读全文
posted @ 2013-10-11 18:21 移山测试工作室黑灯老师 阅读(2231) 评论(0) 推荐(0) 编辑
摘要: 目前手里有个测试项目各个feature的测试用例都放在对应的子目录下,虽然有自动化测试框架的帮助执行起来很方便,但是偶尔也有需要在本地执行某个feature的全部测试用例集合。因为本人对shell脚本不熟悉,所以Ruby的问题还是用Ruby来解决。每个测试脚本的命名遵循如下规范:Testlink ID + 测试用例名字。比如100_invalid_signature.rb表示该测试用例在Testlink里的ID是100,用来测试无效签名。在脚本的实现中,测试用例的名字就对应为TC_100。例子代码如下:1 class TC_100 < Test::Unit::TestCase2 # .. 阅读全文
posted @ 2013-10-11 15:39 移山测试工作室黑灯老师 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 前几天看了Google Testing Blog上的一篇文章讲到C++因为没有反射机制,所以如何注册测试用例就成了一件需要各显神通的事情。从我的经验来看,无论是Google的GTest还是微软的LTM,都是通过宏来解决问题。但是对于Ruby之流的动态语言,这种事情太小菜一叠了。请看以下代码例子: 1 class Test 2 def test_001 3 puts 'test_001' 4 end 5 6 def test_002 7 puts 'test_002' 8 end 9 end10 11 t = Test.new12 test_method... 阅读全文
posted @ 2013-10-11 15:03 移山测试工作室黑灯老师 阅读(485) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/longest-substring-without-repeating-characters/Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For & 阅读全文
posted @ 2013-10-11 15:01 移山测试工作室黑灯老师 阅读(278) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/median-of-two-sorted-arrays/There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).思路:对一维数组的二分查找进行扩展(findKthNumber函数的实现)。先分别定位在A,B的中点。现在分两种情况:(mid = middle)A,B前 阅读全文
posted @ 2013-10-11 14:46 移山测试工作室黑灯老师 阅读(723) 评论(2) 推荐(0) 编辑
count website visits
Buy Computers