<?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/%e6%a6%82%e5%bf%b5%e6%9c%af%e8%af%ad/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>代码中的注释</title>
		<link>http://magustest.com/blog/computer/code-comment/</link>
		<comments>http://magustest.com/blog/computer/code-comment/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 16:12:11 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[计算机技术]]></category>
		<category><![CDATA[概念术语]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=661</guid>
		<description><![CDATA[我第一个实习的公司，是一个美资公司，在印度设立研发中心可能都已经有超过10年的经验了，那时候一些前辈们告诉我，印度人写的代码可能不如中国人那么聪明，但是他们的注释实在是非常详细，有时候甚至达到了1:1的比例，试想想，100行代码就有100行注释，这是多么的恐怖啊。 经常听到会有人抱怨道，怎么这段代码没有注释啊，这是为什么这样写的啊，如此云云。仿佛没有注释，这个世界就不转了。类似的事情也经常发生在QA们的身边，只不过注释换成了文档。 刚毕业的时候做白盒测试，现在回想起来，那时候的我测试的代码大部分都是不包含注释的，不过我测试起来并没有太大的困难，总结一下，应该有以下几点原因： 有意义的函数名、变量名。函数的命名让人一看就大概知道在做什么，例如PostBlog就是发布一篇博客，如果遇到一个叫SaveProfile的方法但做的却是加好友，那我想再多的注释我也会头晕 代码不会说谎。根据经验，如果一段代码理解起来很费劲，那么通常里面都会隐藏着问题。代码就是最好的注释，一些过时的注释，设置会对阅读代码的人产生误导 充分的沟通。虽然游走于几个项目组，跟不同的开发人员打交道，但是每当遇到问题的时候总会主动跟相关的人沟通，一个活生生的人坐在那里不问，却迷信什么文档，这真是本末倒置 注释，能不写就别写，实在要写，写WHY而不是WHAT。 联系一下最近在Team内写的一个新的回归测试工具，里面基本没有注释，希望过几个月以后，自己还能够看看代码就知道当时那段代码为什么这样写。 Share and Enjoy: No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>我第一个实习的公司，是一个美资公司，在印度设立研发中心可能都已经有超过10年的经验了，那时候一些前辈们告诉我，印度人写的代码可能不如中国人那么聪明，但是他们的注释实在是非常详细，有时候甚至达到了1:1的比例，试想想，100行代码就有100行注释，这是多么的恐怖啊。</p>
<p>经常听到会有人抱怨道，怎么这段代码没有注释啊，这是为什么这样写的啊，如此云云。仿佛没有注释，这个世界就不转了。类似的事情也经常发生在QA们的身边，只不过注释换成了文档。</p>
<p>刚毕业的时候做白盒测试，现在回想起来，那时候的我测试的代码大部分都是不包含注释的，不过我测试起来并没有太大的困难，总结一下，应该有以下几点原因：</p>
<ol>
<li>有意义的函数名、变量名。函数的命名让人一看就大概知道在做什么，例如PostBlog就是发布一篇博客，如果遇到一个叫SaveProfile的方法但做的却是加好友，那我想再多的注释我也会头晕</li>
<li>代码不会说谎。根据经验，如果一段代码理解起来很费劲，那么通常里面都会隐藏着问题。代码就是最好的注释，一些过时的注释，设置会对阅读代码的人产生误导</li>
<li>充分的沟通。虽然游走于几个项目组，跟不同的开发人员打交道，但是每当遇到问题的时候总会主动跟相关的人沟通，一个活生生的人坐在那里不问，却迷信什么文档，这真是本末倒置</li>
</ol>
<p>注释，能不写就别写，实在要写，写WHY而不是WHAT。</p>
<p>联系一下最近在Team内写的一个新的回归测试工具，里面基本没有注释，希望过几个月以后，自己还能够看看代码就知道当时那段代码为什么这样写。</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%2Fcomputer%2Fcode-comment%2F&amp;title=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A&amp;annotation=%E6%88%91%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AE%9E%E4%B9%A0%E7%9A%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E6%98%AF%E4%B8%80%E4%B8%AA%E7%BE%8E%E8%B5%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E5%9C%A8%E5%8D%B0%E5%BA%A6%E8%AE%BE%E7%AB%8B%E7%A0%94%E5%8F%91%E4%B8%AD%E5%BF%83%E5%8F%AF%E8%83%BD%E9%83%BD%E5%B7%B2%E7%BB%8F%E6%9C%89%E8%B6%85%E8%BF%8710%E5%B9%B4%E7%9A%84%E7%BB%8F%E9%AA%8C%E4%BA%86%EF%BC%8C%E9%82%A3%E6%97%B6%E5%80%99%E4%B8%80%E4%BA%9B%E5%89%8D%E8%BE%88%E4%BB%AC%E5%91%8A%E8%AF%89%E6%88%91%EF%BC%8C%E5%8D%B0%E5%BA%A6%E4%BA%BA%E5%86%99%E7%9A%84%E4%BB%A3%E7%A0%81%E5%8F%AF%E8%83%BD%E4%B8%8D%E5%A6%82%E4%B8%AD%E5%9B%BD%E4%BA%BA%E9%82%A3%E4%B9%88%E8%81%AA%E6%98%8E%EF%BC%8C%E4%BD%86%E6%98%AF%E4%BB%96%E4%BB%AC%E7%9A%84%E6%B3%A8%E9%87%8A%E5%AE%9E%E5%9C%A8%E6%98%AF%E9%9D" 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%2Fcomputer%2Fcode-comment%2F&amp;title=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A&amp;bodytext=%E6%88%91%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AE%9E%E4%B9%A0%E7%9A%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E6%98%AF%E4%B8%80%E4%B8%AA%E7%BE%8E%E8%B5%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E5%9C%A8%E5%8D%B0%E5%BA%A6%E8%AE%BE%E7%AB%8B%E7%A0%94%E5%8F%91%E4%B8%AD%E5%BF%83%E5%8F%AF%E8%83%BD%E9%83%BD%E5%B7%B2%E7%BB%8F%E6%9C%89%E8%B6%85%E8%BF%8710%E5%B9%B4%E7%9A%84%E7%BB%8F%E9%AA%8C%E4%BA%86%EF%BC%8C%E9%82%A3%E6%97%B6%E5%80%99%E4%B8%80%E4%BA%9B%E5%89%8D%E8%BE%88%E4%BB%AC%E5%91%8A%E8%AF%89%E6%88%91%EF%BC%8C%E5%8D%B0%E5%BA%A6%E4%BA%BA%E5%86%99%E7%9A%84%E4%BB%A3%E7%A0%81%E5%8F%AF%E8%83%BD%E4%B8%8D%E5%A6%82%E4%B8%AD%E5%9B%BD%E4%BA%BA%E9%82%A3%E4%B9%88%E8%81%AA%E6%98%8E%EF%BC%8C%E4%BD%86%E6%98%AF%E4%BB%96%E4%BB%AC%E7%9A%84%E6%B3%A8%E9%87%8A%E5%AE%9E%E5%9C%A8%E6%98%AF%E9%9D" 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%2Fcomputer%2Fcode-comment%2F&amp;title=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A&amp;notes=%E6%88%91%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AE%9E%E4%B9%A0%E7%9A%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E6%98%AF%E4%B8%80%E4%B8%AA%E7%BE%8E%E8%B5%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E5%9C%A8%E5%8D%B0%E5%BA%A6%E8%AE%BE%E7%AB%8B%E7%A0%94%E5%8F%91%E4%B8%AD%E5%BF%83%E5%8F%AF%E8%83%BD%E9%83%BD%E5%B7%B2%E7%BB%8F%E6%9C%89%E8%B6%85%E8%BF%8710%E5%B9%B4%E7%9A%84%E7%BB%8F%E9%AA%8C%E4%BA%86%EF%BC%8C%E9%82%A3%E6%97%B6%E5%80%99%E4%B8%80%E4%BA%9B%E5%89%8D%E8%BE%88%E4%BB%AC%E5%91%8A%E8%AF%89%E6%88%91%EF%BC%8C%E5%8D%B0%E5%BA%A6%E4%BA%BA%E5%86%99%E7%9A%84%E4%BB%A3%E7%A0%81%E5%8F%AF%E8%83%BD%E4%B8%8D%E5%A6%82%E4%B8%AD%E5%9B%BD%E4%BA%BA%E9%82%A3%E4%B9%88%E8%81%AA%E6%98%8E%EF%BC%8C%E4%BD%86%E6%98%AF%E4%BB%96%E4%BB%AC%E7%9A%84%E6%B3%A8%E9%87%8A%E5%AE%9E%E5%9C%A8%E6%98%AF%E9%9D" 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%2Fcomputer%2Fcode-comment%2F&amp;t=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A" 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%2Fcomputer%2Fcode-comment%2F&title=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A" 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%2Fcomputer%2Fcode-comment%2F&title=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A&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=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fcomputer%2Fcode-comment%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%2Fcomputer%2Fcode-comment%2F&amp;title=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A" 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%2Fcomputer%2Fcode-comment%2F&amp;title=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A&amp;body=%E6%88%91%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AE%9E%E4%B9%A0%E7%9A%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E6%98%AF%E4%B8%80%E4%B8%AA%E7%BE%8E%E8%B5%84%E5%85%AC%E5%8F%B8%EF%BC%8C%E5%9C%A8%E5%8D%B0%E5%BA%A6%E8%AE%BE%E7%AB%8B%E7%A0%94%E5%8F%91%E4%B8%AD%E5%BF%83%E5%8F%AF%E8%83%BD%E9%83%BD%E5%B7%B2%E7%BB%8F%E6%9C%89%E8%B6%85%E8%BF%8710%E5%B9%B4%E7%9A%84%E7%BB%8F%E9%AA%8C%E4%BA%86%EF%BC%8C%E9%82%A3%E6%97%B6%E5%80%99%E4%B8%80%E4%BA%9B%E5%89%8D%E8%BE%88%E4%BB%AC%E5%91%8A%E8%AF%89%E6%88%91%EF%BC%8C%E5%8D%B0%E5%BA%A6%E4%BA%BA%E5%86%99%E7%9A%84%E4%BB%A3%E7%A0%81%E5%8F%AF%E8%83%BD%E4%B8%8D%E5%A6%82%E4%B8%AD%E5%9B%BD%E4%BA%BA%E9%82%A3%E4%B9%88%E8%81%AA%E6%98%8E%EF%BC%8C%E4%BD%86%E6%98%AF%E4%BB%96%E4%BB%AC%E7%9A%84%E6%B3%A8%E9%87%8A%E5%AE%9E%E5%9C%A8%E6%98%AF%E9%9D" 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=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fcomputer%2Fcode-comment%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=%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fcomputer%2Fcode-comment%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/computer/code-comment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>单元测试的坏味道</title>
		<link>http://magustest.com/blog/automationtesting/test-smells/</link>
		<comments>http://magustest.com/blog/automationtesting/test-smells/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 08:59:47 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[自动化测试]]></category>
		<category><![CDATA[软件测试]]></category>
		<category><![CDATA[概念术语]]></category>
		<category><![CDATA[白盒测试]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=355</guid>
		<description><![CDATA[Martin Fowler有一本很出名的书《重构》，里面有个很出名的概念，Code Smell。前阵子我也刚发现一本很好的书，《XUnit Test Patterns》。这本书主要讲的是如何重构测试代码，这里的测试代码指的就是自动化测试的代码，再进一步细化就是单元测试为主的自动化测试代码的重构。由于此书已经让清华大学翻译烂了……所以建议大家下载英文版。 所谓的测试的坏味道，有三种： 项目（Project） 行为（Behavior） 代码（Code） 按照《重构》书中提出的坏味道的概念来看，如果说是有坏味道（Smell），那么大多数都是指代码级别的。什么的坏味道？就是程序有可能会有大问题的一种征兆（symptom）。个人理解就是不能被直接观察到的现象，可以称之为坏味道。 对于自动化测试代码来说，如果有了项目级的坏味道，通常变现就是生产环境出现了BUG。如果出现这样的情况，那么自动化测试代码就不是有味道那么简单了，而是有问题了，自动化测试的安全网没有能够抓住这个BUG。 而行为的坏味道，其中一个表现形式就是我以前写过的在自动化测试中需要避免“诡异”的测试脚本提到的现象。还有诸如编译错误、不能被重复运行的测试等。其实如果我们碰到行为级别的坏味道，那么可以肯定，我们必须要修改它。如果不修复好这些问题，自动化测试根本无法进行。 代码的坏味道，这个才是我们需要注意的问题，因为代码有了坏味道，并不代表着自动化测试代码会运行出错，通常人们是不会去修改没有出错的代码，人之常情。发现测试代码的味道，并且去修复它，会让我们的自动化测试更加健壮。《XUnit Test Patterns》这本书的前言部分给出一个典型的例子来说明单元测试代码中有哪些坏味道，如何去修改。例子中的一些对单元测试的重构方法，我在平时的工作中也应用到了，不过看完了以后真是觉得裨益良多，虽然做了快一年的单元测试，集成测试，但是却没有停下来总结一年中学到了什么，真的要借着读这本书的机会，好好总结。 最近在接回以前的一些测试项目，个人觉得如果测试代码里面不写注释，这样也是一种坏味道。对于一堆测试代码，半年后可能都忘记了当初为什么这样写，尤其是对于没有注释的测试代码。就像我在译言翻译的第一篇文章里面说的那样，“很多时候，你就是注释的第一位受益者，或者受害者”。对于有坏味道的自动化测试代码，你可以让他继续发酵，腐烂，总有一天，你自己要收拾这个残局。 Share and Enjoy: No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Martin Fowler有一本很出名的书<a href="http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Technology/dp/0201485672/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1236154183&amp;sr=8-2" target="_blank">《重构》</a>，里面有个很出名的概念，Code Smell。前阵子我也刚发现一本很好的书，<a href="http://xunitpatterns.com/index.html" target="_blank">《XUnit Test Patterns》</a>。这本书主要讲的是如何重构测试代码，这里的测试代码指的就是自动化测试的代码，再进一步细化就是单元测试为主的自动化测试代码的重构。由于此书已经让清华大学翻译烂了……所以建议大家下载英文版。</p>
<p>所谓的测试的坏味道，有三种：</p>
<ol>
<li>项目（Project）</li>
<li>行为（Behavior）</li>
<li>代码（Code）</li>
</ol>
<p>按照《重构》书中提出的坏味道的概念来看，如果说是有坏味道（Smell），那么大多数都是指代码级别的。什么的坏味道？就是程序有可能会有大问题的一种征兆（symptom）。个人理解就是不能被直接观察到的现象，可以称之为坏味道。</p>
<p>对于自动化测试代码来说，如果有了项目级的坏味道，通常变现就是生产环境出现了BUG。如果出现这样的情况，那么自动化测试代码就不是有味道那么简单了，而是有问题了，自动化测试的安全网没有能够抓住这个BUG。<br />
<span id="more-355"></span><br />
而行为的坏味道，其中一个表现形式就是我以前写过的<a href="http://magustest.com/blog/softwaretesting/automationtesting/avoid-flakey-automation-test/" target="_blank">在自动化测试中需要避免“诡异”的测试脚本</a>提到的现象。还有诸如编译错误、不能被重复运行的测试等。其实如果我们碰到行为级别的坏味道，那么可以肯定，我们必须要修改它。如果不修复好这些问题，自动化测试根本无法进行。</p>
<p>代码的坏味道，这个才是我们需要注意的问题，因为代码有了坏味道，并不代表着自动化测试代码会运行出错，通常人们是不会去修改没有出错的代码，人之常情。发现测试代码的味道，并且去修复它，会让我们的自动化测试更加健壮。<a href="http://xunitpatterns.com/index.html" target="_blank">《XUnit Test Patterns》</a>这本书的前言部分给出一个典型的例子来说明单元测试代码中有哪些坏味道，如何去修改。例子中的一些对单元测试的重构方法，我在平时的工作中也应用到了，不过看完了以后真是觉得裨益良多，虽然做了快一年的单元测试，集成测试，但是却没有停下来总结一年中学到了什么，真的要借着读这本书的机会，好好总结。</p>
<p>最近在接回以前的一些测试项目，个人觉得如果测试代码里面不写注释，这样也是一种坏味道。对于一堆测试代码，半年后可能都忘记了当初为什么这样写，尤其是对于没有注释的测试代码。就像我在译言翻译的第一篇文章里面说的那样，“很多时候，你就是注释的第一位受益者，或者受害者”。对于有坏味道的自动化测试代码，你可以让他继续发酵，腐烂，总有一天，你自己要收拾这个残局。</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%2Fautomationtesting%2Ftest-smells%2F&amp;title=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93&amp;annotation=Martin%20Fowler%E6%9C%89%E4%B8%80%E6%9C%AC%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E4%B9%A6%E3%80%8A%E9%87%8D%E6%9E%84%E3%80%8B%EF%BC%8C%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%AA%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E6%A6%82%E5%BF%B5%EF%BC%8CCode%20Smell%E3%80%82%E5%89%8D%E9%98%B5%E5%AD%90%E6%88%91%E4%B9%9F%E5%88%9A%E5%8F%91%E7%8E%B0%E4%B8%80%E6%9C%AC%E5%BE%88%E5%A5%BD%E7%9A%84%E4%B9%A6%EF%BC%8C%E3%80%8AXUnit%20Test%20Patterns%E3%80%8B%E3%80%82%E8%BF%99%E6%9C%AC%E4%B9%A6%E4%B8%BB%E8%A6%81%E8%AE%B2%E7%9A%84%E6%98%AF%E5%A6%82%E4%BD%95%E9%87%8D%E6%9E%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%EF%BC%8C%E8%BF%99%E9%87%8C%E7%9A%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%E6%8C%87%E7%9A%84%E5" 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%2Fautomationtesting%2Ftest-smells%2F&amp;title=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93&amp;bodytext=Martin%20Fowler%E6%9C%89%E4%B8%80%E6%9C%AC%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E4%B9%A6%E3%80%8A%E9%87%8D%E6%9E%84%E3%80%8B%EF%BC%8C%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%AA%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E6%A6%82%E5%BF%B5%EF%BC%8CCode%20Smell%E3%80%82%E5%89%8D%E9%98%B5%E5%AD%90%E6%88%91%E4%B9%9F%E5%88%9A%E5%8F%91%E7%8E%B0%E4%B8%80%E6%9C%AC%E5%BE%88%E5%A5%BD%E7%9A%84%E4%B9%A6%EF%BC%8C%E3%80%8AXUnit%20Test%20Patterns%E3%80%8B%E3%80%82%E8%BF%99%E6%9C%AC%E4%B9%A6%E4%B8%BB%E8%A6%81%E8%AE%B2%E7%9A%84%E6%98%AF%E5%A6%82%E4%BD%95%E9%87%8D%E6%9E%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%EF%BC%8C%E8%BF%99%E9%87%8C%E7%9A%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%E6%8C%87%E7%9A%84%E5" 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%2Fautomationtesting%2Ftest-smells%2F&amp;title=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93&amp;notes=Martin%20Fowler%E6%9C%89%E4%B8%80%E6%9C%AC%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E4%B9%A6%E3%80%8A%E9%87%8D%E6%9E%84%E3%80%8B%EF%BC%8C%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%AA%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E6%A6%82%E5%BF%B5%EF%BC%8CCode%20Smell%E3%80%82%E5%89%8D%E9%98%B5%E5%AD%90%E6%88%91%E4%B9%9F%E5%88%9A%E5%8F%91%E7%8E%B0%E4%B8%80%E6%9C%AC%E5%BE%88%E5%A5%BD%E7%9A%84%E4%B9%A6%EF%BC%8C%E3%80%8AXUnit%20Test%20Patterns%E3%80%8B%E3%80%82%E8%BF%99%E6%9C%AC%E4%B9%A6%E4%B8%BB%E8%A6%81%E8%AE%B2%E7%9A%84%E6%98%AF%E5%A6%82%E4%BD%95%E9%87%8D%E6%9E%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%EF%BC%8C%E8%BF%99%E9%87%8C%E7%9A%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%E6%8C%87%E7%9A%84%E5" 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%2Fautomationtesting%2Ftest-smells%2F&amp;t=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93" 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%2Fautomationtesting%2Ftest-smells%2F&title=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93" 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%2Fautomationtesting%2Ftest-smells%2F&title=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93&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=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Ftest-smells%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%2Fautomationtesting%2Ftest-smells%2F&amp;title=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93" 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%2Fautomationtesting%2Ftest-smells%2F&amp;title=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93&amp;body=Martin%20Fowler%E6%9C%89%E4%B8%80%E6%9C%AC%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E4%B9%A6%E3%80%8A%E9%87%8D%E6%9E%84%E3%80%8B%EF%BC%8C%E9%87%8C%E9%9D%A2%E6%9C%89%E4%B8%AA%E5%BE%88%E5%87%BA%E5%90%8D%E7%9A%84%E6%A6%82%E5%BF%B5%EF%BC%8CCode%20Smell%E3%80%82%E5%89%8D%E9%98%B5%E5%AD%90%E6%88%91%E4%B9%9F%E5%88%9A%E5%8F%91%E7%8E%B0%E4%B8%80%E6%9C%AC%E5%BE%88%E5%A5%BD%E7%9A%84%E4%B9%A6%EF%BC%8C%E3%80%8AXUnit%20Test%20Patterns%E3%80%8B%E3%80%82%E8%BF%99%E6%9C%AC%E4%B9%A6%E4%B8%BB%E8%A6%81%E8%AE%B2%E7%9A%84%E6%98%AF%E5%A6%82%E4%BD%95%E9%87%8D%E6%9E%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%EF%BC%8C%E8%BF%99%E9%87%8C%E7%9A%84%E6%B5%8B%E8%AF%95%E4%BB%A3%E7%A0%81%E6%8C%87%E7%9A%84%E5" 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=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Ftest-smells%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=%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E7%9A%84%E5%9D%8F%E5%91%B3%E9%81%93%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fautomationtesting%2Ftest-smells%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/automationtesting/test-smells/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>认证和授权的区别 Authentication vs. Authorization</title>
		<link>http://magustest.com/blog/computer/different-between-authentication-and-authorization/</link>
		<comments>http://magustest.com/blog/computer/different-between-authentication-and-authorization/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 03:40:51 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[计算机技术]]></category>
		<category><![CDATA[概念术语]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=129</guid>
		<description><![CDATA[简单来说，认证（Authentication ）是用来回答以下问题： 用户是谁 当前用户是否真的是他所代表的角色 通常来说，一个登陆系统，就是一个认证的系统。那么授权（Authorization）又是什么呢？授权通常是用来回答以下问题： 用户A是否被授权访问资源R 用户A是否被授权执行P操作 常见的例如密码相册那些应用，就是应用到了授权系统。 Share and Enjoy: No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: 宋体;">简单来说，认证（Authentication ）是用来回答以下问题：</span><br style="font-family: 宋体;" /></p>
<ul style="font-family: 宋体;">
<li>用户是谁</li>
<li>当前用户是否真的是他所代表的角色</li>
</ul>
<p><span style="font-family: 宋体;">通常来说，一个登陆系统，就是一个认证的系统。</span><br style="font-family: 宋体;" /><br style="font-family: 宋体;" /><span style="font-family: 宋体;">那么授权（Authorization）又是什么呢？授权通常是用来回答以下问题：</span><br style="font-family: 宋体;" /></p>
<ul style="font-family: 宋体;">
<li>用户A是否被授权访问资源R</li>
<li>用户A是否被授权执行P操作</li>
</ul>
<p><span style="font-family: 宋体;">常见的例如密码相册那些应用，就是应用到了授权系统。</span></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>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fmagustest.com%2Fblog%2Fcomputer%2Fdifferent-between-authentication-and-authorization%2F&amp;title=%E8%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization&amp;notes=%E7%AE%80%E5%8D%95%E6%9D%A5%E8%AF%B4%EF%BC%8C%E8%AE%A4%E8%AF%81%EF%BC%88Authentication%20%EF%BC%89%E6%98%AF%E7%94%A8%E6%9D%A5%E5%9B%9E%E7%AD%94%E4%BB%A5%E4%B8%8B%E9%97%AE%E9%A2%98%EF%BC%9A%0A%0A%09%E7%94%A8%E6%88%B7%E6%98%AF%E8%B0%81%0A%09%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%E6%98%AF%E5%90%A6%E7%9C%9F%E7%9A%84%E6%98%AF%E4%BB%96%E6%89%80%E4%BB%A3%E8%A1%A8%E7%9A%84%E8%A7%92%E8%89%B2%0A%0A%E9%80%9A%E5%B8%B8%E6%9D%A5%E8%AF%B4%EF%BC%8C%E4%B8%80%E4%B8%AA%E7%99%BB%E9%99%86%E7%B3%BB%E7%BB%9F%EF%BC%8C%E5%B0%B1%E6%98%AF%E4%B8%80%E4%B8%AA%E8%AE%A4%E8%AF%81%E7%9A%84%E7%B3%BB%E7%BB%9F%E3%80%82%E9%82%A3%E4%B9%88%E6%8E%88%E6%9D%83%EF%BC%88Authorization%EF%BC%89%E5%8F%88%E6%98%AF%E4%BB%80%E4%B9%88%E5%91" 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%2Fcomputer%2Fdifferent-between-authentication-and-authorization%2F&amp;t=%E8%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization" 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%2Fcomputer%2Fdifferent-between-authentication-and-authorization%2F&title=%E8%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization" 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%2Fcomputer%2Fdifferent-between-authentication-and-authorization%2F&title=%E8%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization&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%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization&amp;link=http%3A%2F%2Fmagustest.com%2Fblog%2Fcomputer%2Fdifferent-between-authentication-and-authorization%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%2Fcomputer%2Fdifferent-between-authentication-and-authorization%2F&amp;title=%E8%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization" 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%2Fcomputer%2Fdifferent-between-authentication-and-authorization%2F&amp;title=%E8%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization&amp;body=%E7%AE%80%E5%8D%95%E6%9D%A5%E8%AF%B4%EF%BC%8C%E8%AE%A4%E8%AF%81%EF%BC%88Authentication%20%EF%BC%89%E6%98%AF%E7%94%A8%E6%9D%A5%E5%9B%9E%E7%AD%94%E4%BB%A5%E4%B8%8B%E9%97%AE%E9%A2%98%EF%BC%9A%0A%0A%09%E7%94%A8%E6%88%B7%E6%98%AF%E8%B0%81%0A%09%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%E6%98%AF%E5%90%A6%E7%9C%9F%E7%9A%84%E6%98%AF%E4%BB%96%E6%89%80%E4%BB%A3%E8%A1%A8%E7%9A%84%E8%A7%92%E8%89%B2%0A%0A%E9%80%9A%E5%B8%B8%E6%9D%A5%E8%AF%B4%EF%BC%8C%E4%B8%80%E4%B8%AA%E7%99%BB%E9%99%86%E7%B3%BB%E7%BB%9F%EF%BC%8C%E5%B0%B1%E6%98%AF%E4%B8%80%E4%B8%AA%E8%AE%A4%E8%AF%81%E7%9A%84%E7%B3%BB%E7%BB%9F%E3%80%82%E9%82%A3%E4%B9%88%E6%8E%88%E6%9D%83%EF%BC%88Authorization%EF%BC%89%E5%8F%88%E6%98%AF%E4%BB%80%E4%B9%88%E5%91" 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=%E8%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization&uri=http%3A%2F%2Fmagustest.com%2Fblog%2Fcomputer%2Fdifferent-between-authentication-and-authorization%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%AE%A4%E8%AF%81%E5%92%8C%E6%8E%88%E6%9D%83%E7%9A%84%E5%8C%BA%E5%88%AB%20Authentication%20vs.%20Authorization%20-%20http%3A%2F%2Fmagustest.com%2Fblog%2Fcomputer%2Fdifferent-between-authentication-and-authorization%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/computer/different-between-authentication-and-authorization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
