<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>进化的测试 &#187; 软件测试</title>
	<atom:link href="http://magustest.com/blog/tag/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://magustest.com/blog</link>
	<description>关注软件测试，白盒测试，自动化测试，性能测试</description>
	<lastBuildDate>Wed, 02 Jun 2010 16:12:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>TestLink不能连接BugZilla的解决办法</title>
		<link>http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/</link>
		<comments>http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:57:04 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[软件测试]]></category>
		<category><![CDATA[BugZilla]]></category>
		<category><![CDATA[TestLink]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=652</guid>
		<description><![CDATA[TestLink是一个基于Web的PHP开源测试管理系统，虽然用起来跟QC那些商业软件比起来不是那么爽，但是由于是开源、免费，所以越来越多的公司在用TestLink。BugZilla作为老牌的bug管理工具，同样有着很大的用户群。 TestLink有一个BugTracking的接口模块，可以使得TestLink可以与其他BugTracking系统集成。在集成的过程中发现TestLink提示错误：Bug ID does not exist on BTS（中文的话是&#8217;bug的ID在BTS中不存在！&#8217;），找到TestLink的代码文件bugAdd.php，找到下面这段代码块 if&#40;$args-&#62;bug_id != &#34;&#34;&#41; &#123; $msg = lang_get&#40;&#34;error_wrong_BugID_format&#34;&#41;; if &#40;$g_bugInterface-&#62;checkBugID&#40;$args-&#62;bug_id&#41;&#41; &#123; $msg = lang_get&#40;&#34;error_bug_does_not_exist_on_bts&#34;&#41;; // 问题在这里 if &#40;$g_bugInterface-&#62;checkBugID_existence&#40;$args-&#62;bug_id&#41;&#41; &#123; if &#40;write_execution_bug&#40;$db,$args-&#62;exec_id, $args-&#62;bug_id&#41;&#41; &#123; $msg = lang_get&#40;&#34;bug_added&#34;&#41;; logAuditEvent&#40;TLS&#40;&#34;audit_executionbug_added&#34;,$args-&#62;bug_id&#41;,&#34;CREATE&#34;,$args-&#62;exec_id,&#34;executions&#34;&#41;; &#125; &#125; &#125; &#125; 问题出在$g_bugInterface->checkBugID_existence($args->bug_id)这个方法中。在、TestLink的int_bugzilla.php文件中，并没有overload这个checkBugID_existence的方法，所以这个方法就会按照int_bugtracking.php中的默认实现，返回false。TestLink就会出现error_bug_does_not_exist_on_bts这个ERROR 解决这个问题很简单，就是在int_bugzilla.php中自己实现checkBugID_existence方法，简单的实现如下： function checkBugID_existence&#40;$id&#41; &#123; $status_ok = 0; //关键是下面这个Query bug id的语句，大家自己看看数据库是哪个表，根据实际情况自己修改 $query = &#34;SELECT bug_id FROM bugs [...]


Related posts:<ol><li><a href='http://magustest.com/blog/uncategorized/stringbuffer-in-lua/' rel='bookmark' title='Permanent Link: 在Lua中实现简单的StringBuffer'>在Lua中实现简单的StringBuffer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>TestLink是一个基于Web的PHP开源测试管理系统，虽然用起来跟QC那些商业软件比起来不是那么爽，但是由于是开源、免费，所以越来越多的公司在用TestLink。BugZilla作为老牌的bug管理工具，同样有着很大的用户群。</p>
<p>TestLink有一个BugTracking的接口模块，可以使得TestLink可以与其他BugTracking系统集成。在集成的过程中发现TestLink提示错误：Bug ID does not exist on BTS（中文的话是&#8217;bug的ID在BTS中不存在！&#8217;），找到TestLink的代码文件bugAdd.php，找到下面这段代码块</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$msg</span> <span style="color: #339933;">=</span> lang_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;error_wrong_BugID_format&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$g_bugInterface</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">checkBugID</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$msg</span> <span style="color: #339933;">=</span> lang_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;error_bug_does_not_exist_on_bts&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// 问题在这里</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$g_bugInterface</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">checkBugID_existence</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span> 	  
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>write_execution_bug<span style="color: #009900;">&#40;</span><span style="color: #000088;">$db</span><span style="color: #339933;">,</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$msg</span> <span style="color: #339933;">=</span> lang_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;bug_added&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				logAuditEvent<span style="color: #009900;">&#40;</span>TLS<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;audit_executionbug_added&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;CREATE&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_id</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;executions&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>问题出在$g_bugInterface->checkBugID_existence($args->bug_id)这个方法中。在、TestLink的int_bugzilla.php文件中，并没有overload这个checkBugID_existence的方法，所以这个方法就会按照int_bugtracking.php中的默认实现，返回false。TestLink就会出现error_bug_does_not_exist_on_bts这个ERROR</p>
<p>解决这个问题很简单，就是在int_bugzilla.php中自己实现checkBugID_existence方法，简单的实现如下：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> checkBugID_existence<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$status_ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//关键是下面这个Query bug id的语句，大家自己看看数据库是哪个表，根据实际情况自己修改	</span>
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT bug_id FROM bugs WHERE bug_id='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbConnection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbConnection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$status_ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>    
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$status_ok</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>OK。在int_bugzilla.php文件中添加了 checkBugID_existence() 方法后，就可以从TestLink中直接把BugZilla里面的BUG ID和某个测试关联起来了。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&amp;title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95&amp;annotation=TestLink%E6%98%AF%E4%B8%80%E4%B8%AA%E5%9F%BA%E4%BA%8EWeb%E7%9A%84PHP%E5%BC%80%E6%BA%90%E6%B5%8B%E8%AF%95%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%EF%BC%8C%E8%99%BD%E7%84%B6%E7%94%A8%E8%B5%B7%E6%9D%A5%E8%B7%9FQC%E9%82%A3%E4%BA%9B%E5%95%86%E4%B8%9A%E8%BD%AF%E4%BB%B6%E6%AF%94%E8%B5%B7%E6%9D%A5%E4%B8%8D%E6%98%AF%E9%82%A3%E4%B9%88%E7%88%BD%EF%BC%8C%E4%BD%86%E6%98%AF%E7%94%B1%E4%BA%8E%E6%98%AF%E5%BC%80%E6%BA%90%E3%80%81%E5%85%8D%E8%B4%B9%EF%BC%8C%E6%89%80%E4%BB%A5%E8%B6%8A%E6%9D%A5%E8%B6%8A%E5%A4%9A%E7%9A%84%E5%85%AC%E5%8F%B8%E5%9C%A8%E7%94%A8TestLink%E3%80%82BugZilla%E4%BD%9C%E4%B8%BA%E8%80%81%E7%89%8C%E7%9A%84bug%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%90%8C%E6%A0%B7%E6%9C" title="Google Bookmarks"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&amp;title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95&amp;bodytext=TestLink%E6%98%AF%E4%B8%80%E4%B8%AA%E5%9F%BA%E4%BA%8EWeb%E7%9A%84PHP%E5%BC%80%E6%BA%90%E6%B5%8B%E8%AF%95%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%EF%BC%8C%E8%99%BD%E7%84%B6%E7%94%A8%E8%B5%B7%E6%9D%A5%E8%B7%9FQC%E9%82%A3%E4%BA%9B%E5%95%86%E4%B8%9A%E8%BD%AF%E4%BB%B6%E6%AF%94%E8%B5%B7%E6%9D%A5%E4%B8%8D%E6%98%AF%E9%82%A3%E4%B9%88%E7%88%BD%EF%BC%8C%E4%BD%86%E6%98%AF%E7%94%B1%E4%BA%8E%E6%98%AF%E5%BC%80%E6%BA%90%E3%80%81%E5%85%8D%E8%B4%B9%EF%BC%8C%E6%89%80%E4%BB%A5%E8%B6%8A%E6%9D%A5%E8%B6%8A%E5%A4%9A%E7%9A%84%E5%85%AC%E5%8F%B8%E5%9C%A8%E7%94%A8TestLink%E3%80%82BugZilla%E4%BD%9C%E4%B8%BA%E8%80%81%E7%89%8C%E7%9A%84bug%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%90%8C%E6%A0%B7%E6%9C" title="Digg"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&amp;title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95&amp;notes=TestLink%E6%98%AF%E4%B8%80%E4%B8%AA%E5%9F%BA%E4%BA%8EWeb%E7%9A%84PHP%E5%BC%80%E6%BA%90%E6%B5%8B%E8%AF%95%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%EF%BC%8C%E8%99%BD%E7%84%B6%E7%94%A8%E8%B5%B7%E6%9D%A5%E8%B7%9FQC%E9%82%A3%E4%BA%9B%E5%95%86%E4%B8%9A%E8%BD%AF%E4%BB%B6%E6%AF%94%E8%B5%B7%E6%9D%A5%E4%B8%8D%E6%98%AF%E9%82%A3%E4%B9%88%E7%88%BD%EF%BC%8C%E4%BD%86%E6%98%AF%E7%94%B1%E4%BA%8E%E6%98%AF%E5%BC%80%E6%BA%90%E3%80%81%E5%85%8D%E8%B4%B9%EF%BC%8C%E6%89%80%E4%BB%A5%E8%B6%8A%E6%9D%A5%E8%B6%8A%E5%A4%9A%E7%9A%84%E5%85%AC%E5%8F%B8%E5%9C%A8%E7%94%A8TestLink%E3%80%82BugZilla%E4%BD%9C%E4%B8%BA%E8%80%81%E7%89%8C%E7%9A%84bug%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%90%8C%E6%A0%B7%E6%9C" title="del.icio.us"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&amp;t=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&amp;title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://ping.fm/ref/?link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F&amp;title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95&amp;body=TestLink%E6%98%AF%E4%B8%80%E4%B8%AA%E5%9F%BA%E4%BA%8EWeb%E7%9A%84PHP%E5%BC%80%E6%BA%90%E6%B5%8B%E8%AF%95%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%EF%BC%8C%E8%99%BD%E7%84%B6%E7%94%A8%E8%B5%B7%E6%9D%A5%E8%B7%9FQC%E9%82%A3%E4%BA%9B%E5%95%86%E4%B8%9A%E8%BD%AF%E4%BB%B6%E6%AF%94%E8%B5%B7%E6%9D%A5%E4%B8%8D%E6%98%AF%E9%82%A3%E4%B9%88%E7%88%BD%EF%BC%8C%E4%BD%86%E6%98%AF%E7%94%B1%E4%BA%8E%E6%98%AF%E5%BC%80%E6%BA%90%E3%80%81%E5%85%8D%E8%B4%B9%EF%BC%8C%E6%89%80%E4%BB%A5%E8%B6%8A%E6%9D%A5%E8%B6%8A%E5%A4%9A%E7%9A%84%E5%85%AC%E5%8F%B8%E5%9C%A8%E7%94%A8TestLink%E3%80%82BugZilla%E4%BD%9C%E4%B8%BA%E8%80%81%E7%89%8C%E7%9A%84bug%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%EF%BC%8C%E5%90%8C%E6%A0%B7%E6%9C" title="Ping.fm"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=TestLink%E4%B8%8D%E8%83%BD%E8%BF%9E%E6%8E%A5BugZilla%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Ftestlink-integrate-bugzilla-failed%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/uncategorized/stringbuffer-in-lua/' rel='bookmark' title='Permanent Link: 在Lua中实现简单的StringBuffer'>在Lua中实现简单的StringBuffer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>谁来保证测试工作的质量</title>
		<link>http://magustest.com/blog/softwaretesting/who-watches-the-watchers/</link>
		<comments>http://magustest.com/blog/softwaretesting/who-watches-the-watchers/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 14:25:15 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[软件测试]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=644</guid>
		<description><![CDATA[在一个公司或者是某个组织里面，测试人员扮演的角色通常都会被认为是软件质量的保证者，把关者，仿佛经过测试的产品都是没有任何缺陷的。但事实大家都知道，即使经过多么“完美”测试的产品，总免不了在发布以后还会发现或多或少的问题。 以前在MySpace做测试的时候，主要是写代码来测试一些接口、模块等。这样就会出现一个问题，我用一段程序A去测试层序B，那么测试代码也是程序，如何保证程序A的正确性呢？OK，我们可以写一个程序C去测试程序A，由此来保障程序A的正确性，但是程序C的正确性又由谁来保证呢？who watches the watchers？当时只有我一个人负责白盒测试，最多也就是让开发帮忙看看。其实对于一段程序，只要写的足够简单，那么就可以认为这段简单的程序的正确性是能得到保证的。所以我一直都给自己强调，单元测试的代码不要写的复杂，尽可能不用判断，让测试代码顺序执行下去。 但是对于功能测试来说，怎么样才能尽可能地保证测试的方法，测试的数据，测试的覆盖率是能达到某项标准的呢？在这次MRM 2.9 Release的测试过程中，我们引入了peer review的做法，一个功能点一般会以ticket的形式存在，每个人拿到ticket的时候首先自己设计测试用例，包括测试数据的准备，用什么样的方法等等。然后找另外一个同事来review自己的用例。这样做的好处有： 强迫自己有一个较为系统的测试用例设计，因为这个是需要给同事看，并且让别人看懂的 同事之间的knowledge share在不知不觉中就达到 两个人的review总是比一大群人坐到会议室里面要有效，帮助提高测试覆盖率，尽可能避免测试盲点 互相监督 Share and Enjoy: No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>在一个公司或者是某个组织里面，测试人员扮演的角色通常都会被认为是软件质量的保证者，把关者，仿佛经过测试的产品都是没有任何缺陷的。但事实大家都知道，即使经过多么“完美”测试的产品，总免不了在发布以后还会发现或多或少的问题。</p>
<p>以前在MySpace做测试的时候，主要是写代码来测试一些接口、模块等。这样就会出现一个问题，我用一段程序A去测试层序B，那么测试代码也是程序，如何保证程序A的正确性呢？OK，我们可以写一个程序C去测试程序A，由此来保障程序A的正确性，但是程序C的正确性又由谁来保证呢？who watches the watchers？当时只有我一个人负责白盒测试，最多也就是让开发帮忙看看。其实对于一段程序，只要写的足够简单，那么就可以认为这段简单的程序的正确性是能得到保证的。所以我一直都给自己强调，单元测试的代码不要写的复杂，尽可能不用判断，让测试代码顺序执行下去。</p>
<p>但是对于功能测试来说，怎么样才能尽可能地保证测试的方法，测试的数据，测试的覆盖率是能达到某项标准的呢？在这次MRM 2.9 Release的测试过程中，我们引入了peer review的做法，一个功能点一般会以ticket的形式存在，每个人拿到ticket的时候首先自己设计测试用例，包括测试数据的准备，用什么样的方法等等。然后找另外一个同事来review自己的用例。这样做的好处有：</p>
<ol>
<li>强迫自己有一个较为系统的测试用例设计，因为这个是需要给同事看，并且让别人看懂的</li>
<li>同事之间的knowledge share在不知不觉中就达到</li>
<li>两个人的review总是比一大群人坐到会议室里面要有效，帮助提高测试覆盖率，尽可能避免测试盲点</li>
<li>互相监督</li>
</ol>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fwho-watches-the-watchers%2F&amp;t=%E8%B0%81%E6%9D%A5%E4%BF%9D%E8%AF%81%E6%B5%8B%E8%AF%95%E5%B7%A5%E4%BD%9C%E7%9A%84%E8%B4%A8%E9%87%8F" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fwho-watches-the-watchers%2F&title=%E8%B0%81%E6%9D%A5%E4%BF%9D%E8%AF%81%E6%B5%8B%E8%AF%95%E5%B7%A5%E4%BD%9C%E7%9A%84%E8%B4%A8%E9%87%8F" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fwho-watches-the-watchers%2F&title=%E8%B0%81%E6%9D%A5%E4%BF%9D%E8%AF%81%E6%B5%8B%E8%AF%95%E5%B7%A5%E4%BD%9C%E7%9A%84%E8%B4%A8%E9%87%8F&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E8%B0%81%E6%9D%A5%E4%BF%9D%E8%AF%81%E6%B5%8B%E8%AF%95%E5%B7%A5%E4%BD%9C%E7%9A%84%E8%B4%A8%E9%87%8F&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fwho-watches-the-watchers%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fwho-watches-the-watchers%2F&amp;title=%E8%B0%81%E6%9D%A5%E4%BF%9D%E8%AF%81%E6%B5%8B%E8%AF%95%E5%B7%A5%E4%BD%9C%E7%9A%84%E8%B4%A8%E9%87%8F" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E8%B0%81%E6%9D%A5%E4%BF%9D%E8%AF%81%E6%B5%8B%E8%AF%95%E5%B7%A5%E4%BD%9C%E7%9A%84%E8%B4%A8%E9%87%8F&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fwho-watches-the-watchers%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E8%B0%81%E6%9D%A5%E4%BF%9D%E8%AF%81%E6%B5%8B%E8%AF%95%E5%B7%A5%E4%BD%9C%E7%9A%84%E8%B4%A8%E9%87%8F%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fwho-watches-the-watchers%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/who-watches-the-watchers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>敏捷测试只是手段不是目的</title>
		<link>http://magustest.com/blog/softwaretesting/about-agile-testing/</link>
		<comments>http://magustest.com/blog/softwaretesting/about-agile-testing/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 10:09:18 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[软件测试]]></category>
		<category><![CDATA[敏捷测试]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=592</guid>
		<description><![CDATA[首先我要声明：本人不懂敏捷测试。 敏捷开发在这两年一直很火，很多时候作为一个测试人员，经常会“被敏捷”。一些常见的现象有，当你所要文档的时候，相关人员可能会告诉你“我们是敏捷开发，没有文档”；当你索要进度表的时候，答案也是相似的。既然软件开发已经迈入了敏捷时代，那么软件测试还能原地踏步麽？那什么是敏捷测试？我不知道，不过我想说说我在“敏捷”组织里面进行软件测试的经历。 由于我不懂敏捷测试，所以我不知道它的定义，我只能通过“敏捷测试不是传统测试”这样的思路来开展工作。 首先，那种拿着各种需求文档设计文档来设计Test Case的日子是一去不复返了，因为敏捷开发强调的是能工作的软件比漂亮的文档要有用，人和人之间的沟通胜于文档。所以作为我，一个测试员，我对被测软件的知识的了解来源有2个方面，第一是代码，第二是开发人员。 其次，如果在测试过程中发现一个问题，第一件事情并不是把这个问题记录在Tracking system里面，而是找相关的开发和产品进行确认，究竟这是不是一个真的Defect。 然后，需要知道一个现在很流行的新玩意儿：探索性测试（Exploratory Testing）。每个人对Exploratory Testing的定义都不一样，最近两个大牛（James Bach, James Whittaker）也在掐架。我觉得如果简化这个定义的话，就是我们一边熟悉被测软件，一边进行测试，在测试进行的过程中，随着对软件的熟悉，继而设计出新的Test case来对被测软件进行测试，我个人觉得就像是一个小的迭代一样。 最后，忘记敏捷测试这个词。我觉得现在业界能说清楚这个概念的人很少，所以没有必要在这些定义上纠结。人们为什么要实施敏捷开发，是因为想交付更好的软件；我们为什么要实施敏捷测试，是想提高测试的质量以及生产力，从而帮助公司交付更加高质量的产品，至于是不是真正的敏捷，又有什么重要的呢 Share and Enjoy: Related posts:推荐阅读：5 Ways to Revolutionize Your QA


Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/5-ways-to-revolutionize-your-qa/' rel='bookmark' title='Permanent Link: 推荐阅读：5 Ways to Revolutionize Your QA'>推荐阅读：5 Ways to Revolutionize Your QA</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>首先我要声明：本人不懂敏捷测试。<br />
敏捷开发在这两年一直很火，很多时候作为一个测试人员，经常会“被敏捷”。一些常见的现象有，当你所要文档的时候，相关人员可能会告诉你“我们是敏捷开发，没有文档”；当你索要进度表的时候，答案也是相似的。既然软件开发已经迈入了敏捷时代，那么软件测试还能原地踏步麽？那什么是敏捷测试？我不知道，不过我想说说我在“敏捷”组织里面进行软件测试的经历。<br />
由于我不懂敏捷测试，所以我不知道它的定义，我只能通过“敏捷测试不是传统测试”这样的思路来开展工作。<br />
首先，那种拿着各种需求文档设计文档来设计Test Case的日子是一去不复返了，因为敏捷开发强调的是能工作的软件比漂亮的文档要有用，人和人之间的沟通胜于文档。所以作为我，一个测试员，我对被测软件的知识的了解来源有2个方面，第一是代码，第二是开发人员。<br />
其次，如果在测试过程中发现一个问题，第一件事情并不是把这个问题记录在Tracking system里面，而是找相关的开发和产品进行确认，究竟这是不是一个真的Defect。<br />
然后，需要知道一个现在很流行的新玩意儿：探索性测试（<a href="http://en.wikipedia.org/wiki/Exploratory_testing" target="_blank">Exploratory Testing</a>）。每个人对Exploratory Testing的定义都不一样，最近两个大牛（<a href="http://www.satisfice.com/" target="_blank">James Bach</a>, <a href="http://blogs.msdn.com/james_whittaker/default.aspx" target="_blank">James Whittaker</a>）也在掐架。我觉得如果简化这个定义的话，就是我们一边熟悉被测软件，一边进行测试，在测试进行的过程中，随着对软件的熟悉，继而设计出新的Test case来对被测软件进行测试，我个人觉得就像是一个小的迭代一样。<br />
最后，忘记敏捷测试这个词。我觉得现在业界能说清楚这个概念的人很少，所以没有必要在这些定义上纠结。人们为什么要实施敏捷开发，是因为想交付更好的软件；我们为什么要实施敏捷测试，是想提高测试的质量以及生产力，从而帮助公司交付更加高质量的产品，至于是不是真正的敏捷，又有什么重要的呢</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fabout-agile-testing%2F&amp;t=%E6%95%8F%E6%8D%B7%E6%B5%8B%E8%AF%95%E5%8F%AA%E6%98%AF%E6%89%8B%E6%AE%B5%E4%B8%8D%E6%98%AF%E7%9B%AE%E7%9A%84" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fabout-agile-testing%2F&title=%E6%95%8F%E6%8D%B7%E6%B5%8B%E8%AF%95%E5%8F%AA%E6%98%AF%E6%89%8B%E6%AE%B5%E4%B8%8D%E6%98%AF%E7%9B%AE%E7%9A%84" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fabout-agile-testing%2F&title=%E6%95%8F%E6%8D%B7%E6%B5%8B%E8%AF%95%E5%8F%AA%E6%98%AF%E6%89%8B%E6%AE%B5%E4%B8%8D%E6%98%AF%E7%9B%AE%E7%9A%84&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E6%95%8F%E6%8D%B7%E6%B5%8B%E8%AF%95%E5%8F%AA%E6%98%AF%E6%89%8B%E6%AE%B5%E4%B8%8D%E6%98%AF%E7%9B%AE%E7%9A%84&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fabout-agile-testing%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fabout-agile-testing%2F&amp;title=%E6%95%8F%E6%8D%B7%E6%B5%8B%E8%AF%95%E5%8F%AA%E6%98%AF%E6%89%8B%E6%AE%B5%E4%B8%8D%E6%98%AF%E7%9B%AE%E7%9A%84" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E6%95%8F%E6%8D%B7%E6%B5%8B%E8%AF%95%E5%8F%AA%E6%98%AF%E6%89%8B%E6%AE%B5%E4%B8%8D%E6%98%AF%E7%9B%AE%E7%9A%84&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fabout-agile-testing%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E6%95%8F%E6%8D%B7%E6%B5%8B%E8%AF%95%E5%8F%AA%E6%98%AF%E6%89%8B%E6%AE%B5%E4%B8%8D%E6%98%AF%E7%9B%AE%E7%9A%84%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fabout-agile-testing%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/softwaretesting/5-ways-to-revolutionize-your-qa/' rel='bookmark' title='Permanent Link: 推荐阅读：5 Ways to Revolutionize Your QA'>推荐阅读：5 Ways to Revolutionize Your QA</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/about-agile-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>避免用户用一个邮箱在网站上注册多个帐号(马甲)</title>
		<link>http://magustest.com/blog/softwaretesting/prevent-using-one-email-signuping-mass-account/</link>
		<comments>http://magustest.com/blog/softwaretesting/prevent-using-one-email-signuping-mass-account/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 09:54:34 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[软件测试]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=379</guid>
		<description><![CDATA[SNS的风已经刮过了，国内不少SNS网站正在刮第二阵风：游戏！像聚友网，开心网，山寨开心网，校内等社交网站都添加了大量的游戏，在这些游戏中都有一个共同之处&#8211;邀请朋友注册送积分（金币，道具等等……）。很多人就会多申请几个邮箱，然后再多注册几个马甲来获利。 我比较懒，一直想着有什么样的办法可以不申请更多的邮箱，而又能多注册几个马甲。可能大家都比较熟悉Google的Gmail邮箱，这个邮箱有一个特点就是它那神奇的“+”加号。例如现在我有这样一个邮箱abc@gmail.com那么我只需要在@符号和abc中间添加一个“+”，还有若干文字，就能“生成”一个新的邮箱，无需申请。例如abc+haha@gmail.com, abc+hi@gmail.com，这2个邮箱的邮件都发送到abc@gmail.com中，这就方便了我们注册马甲啦！ 那怎么对付这样投机取巧的人呢？其实可以获取他的真正的邮箱，因为万变不离其中，其实注册的邮箱就是abc@gmail.com，用一个小小的方法获取一下base email就OK了，参考代码如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public static string GetBaseEmail&#40;string email&#41; &#123; if &#40;string.IsNullOrEmpty&#40;email&#41;&#41; throw new ArgumentNullException&#40;&#34;email&#34;&#41;; string TrimedEmail = email.Trim&#40;&#41;; int PositionofAdd = TrimedEmail.IndexOf&#40;'+'&#41;; int PositionofAt = TrimedEmail.IndexOf&#40;'@'&#41;; if &#40;PositionofAdd &#62; 0 &#38;&#38; PositionofAt &#62; 0&#41; &#123; return TrimedEmail.Substring&#40;0, [...]


Related posts:<ol><li><a href='http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/' rel='bookmark' title='Permanent Link: 在VSTS中创建Web Test的插件'>在VSTS中创建Web Test的插件</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>SNS的风已经刮过了，国内不少SNS网站正在刮第二阵风：游戏！像聚友网，开心网，山寨开心网，校内等社交网站都添加了大量的游戏，在这些游戏中都有一个共同之处&#8211;邀请朋友注册送积分（金币，道具等等……）。很多人就会多申请几个邮箱，然后再多注册几个马甲来获利。</p>
<p>我比较懒，一直想着有什么样的办法可以不申请更多的邮箱，而又能多注册几个马甲。可能大家都比较熟悉Google的Gmail邮箱，这个邮箱有一个特点就是它那神奇的“+”加号。例如现在我有这样一个邮箱abc@gmail.com那么我只需要在@符号和abc中间添加一个“+”，还有若干文字，就能“生成”一个新的邮箱，无需申请。例如abc+haha@gmail.com, abc+hi@gmail.com，这2个邮箱的邮件都发送到abc@gmail.com中，这就方便了我们注册马甲啦！<br />
<span id="more-379"></span></p>
<p>那怎么对付这样投机取巧的人呢？其实可以获取他的真正的邮箱，因为万变不离其中，其实注册的邮箱就是abc@gmail.com，用一个小小的方法获取一下base email就OK了，参考代码如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> GetBaseEmail<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> email<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>email<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> ArgumentNullException<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;email&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #FF0000;">string</span> TrimedEmail <span style="color: #008000;">=</span> email.<span style="color: #0000FF;">Trim</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #FF0000;">int</span> PositionofAdd <span style="color: #008000;">=</span> TrimedEmail.<span style="color: #0000FF;">IndexOf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">'+'</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #FF0000;">int</span> PositionofAt <span style="color: #008000;">=</span> TrimedEmail.<span style="color: #0000FF;">IndexOf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">'@'</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>PositionofAdd <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">&amp;&amp;</span> PositionofAt <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">return</span> TrimedEmail.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">0</span>, PositionofAdd<span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> TrimedEmail.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span>PositionofAt<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0600FF;">else</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0600FF;">return</span> TrimedEmail<span style="color: #008000;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>这样就可以稍微减少一点恶意注册，增加注册马甲的成本。其实还有很多更加有效的防止注册马甲的方法，例如在浏览器里面记录一个COOKIE来唯一标示该浏览器，不过清一下COOKIE就能搞定，或者换一个浏览器。又或者记录下注册和登陆的IP，但是这个有可能会误伤了网吧用户。总之就是道高一尺魔高一丈。今天突然想起来以前曾经看过这样一个方法，拿出来分享一下。</p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://magustest.com/blog/feed/" title="RSS"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fprevent-using-one-email-signuping-mass-account%2F&amp;t=%E9%81%BF%E5%85%8D%E7%94%A8%E6%88%B7%E7%94%A8%E4%B8%80%E4%B8%AA%E9%82%AE%E7%AE%B1%E5%9C%A8%E7%BD%91%E7%AB%99%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%A4%9A%E4%B8%AA%E5%B8%90%E5%8F%B7%28%E9%A9%AC%E7%94%B2%29" title="Facebook"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fprevent-using-one-email-signuping-mass-account%2F&title=%E9%81%BF%E5%85%8D%E7%94%A8%E6%88%B7%E7%94%A8%E4%B8%80%E4%B8%AA%E9%82%AE%E7%AE%B1%E5%9C%A8%E7%BD%91%E7%AB%99%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%A4%9A%E4%B8%AA%E5%B8%90%E5%8F%B7%28%E9%A9%AC%E7%94%B2%29" title="豆瓣"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban.png" title="豆瓣" alt="豆瓣" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.douban.com/recommend/?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fprevent-using-one-email-signuping-mass-account%2F&title=%E9%81%BF%E5%85%8D%E7%94%A8%E6%88%B7%E7%94%A8%E4%B8%80%E4%B8%AA%E9%82%AE%E7%AE%B1%E5%9C%A8%E7%BD%91%E7%AB%99%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%A4%9A%E4%B8%AA%E5%B8%90%E5%8F%B7%28%E9%A9%AC%E7%94%B2%29&n=1" title="豆瓣九点"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/douban9.png" title="豆瓣九点" alt="豆瓣九点" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.friendfeed.com/share?title=%E9%81%BF%E5%85%8D%E7%94%A8%E6%88%B7%E7%94%A8%E4%B8%80%E4%B8%AA%E9%82%AE%E7%AE%B1%E5%9C%A8%E7%BD%91%E7%AB%99%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%A4%9A%E4%B8%AA%E5%B8%90%E5%8F%B7%28%E9%A9%AC%E7%94%B2%29&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fprevent-using-one-email-signuping-mass-account%2F" title="FriendFeed"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fprevent-using-one-email-signuping-mass-account%2F&amp;title=%E9%81%BF%E5%85%8D%E7%94%A8%E6%88%B7%E7%94%A8%E4%B8%80%E4%B8%AA%E9%82%AE%E7%AE%B1%E5%9C%A8%E7%BD%91%E7%AB%99%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%A4%9A%E4%B8%AA%E5%B8%90%E5%8F%B7%28%E9%A9%AC%E7%94%B2%29" title="Live"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<img src="http://magustest.com/blog/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://shuqian.qq.com/post?jumpback=1&title=%E9%81%BF%E5%85%8D%E7%94%A8%E6%88%B7%E7%94%A8%E4%B8%80%E4%B8%AA%E9%82%AE%E7%AE%B1%E5%9C%A8%E7%BD%91%E7%AB%99%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%A4%9A%E4%B8%AA%E5%B8%90%E5%8F%B7%28%E9%A9%AC%E7%94%B2%29&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fprevent-using-one-email-signuping-mass-account%2F" title="QQ书签"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/qq.png" title="QQ书签" alt="QQ书签" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%E9%81%BF%E5%85%8D%E7%94%A8%E6%88%B7%E7%94%A8%E4%B8%80%E4%B8%AA%E9%82%AE%E7%AE%B1%E5%9C%A8%E7%BD%91%E7%AB%99%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%A4%9A%E4%B8%AA%E5%B8%90%E5%8F%B7%28%E9%A9%AC%E7%94%B2%29%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fsoftwaretesting%2Fprevent-using-one-email-signuping-mass-account%2F" title="Twitter"><img src="http://magustest.com/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>

<p>Related posts:<ol><li><a href='http://magustest.com/blog/automationtesting/create-web-test-plugin-in-vsts/' rel='bookmark' title='Permanent Link: 在VSTS中创建Web Test的插件'>在VSTS中创建Web Test的插件</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/prevent-using-one-email-signuping-mass-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
