<?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>Google Data &#187; Alberto Savoia</title>
	<atom:link href="/author/alberto-savoia/feed/" rel="self" type="application/rss+xml" />
	<link>https://googledata.org</link>
	<description>Everything Google: News, Products, Services, Content, Culture</description>
	<lastBuildDate>Thu, 19 Mar 2015 22:49:02 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.7.5</generator>
	<item>
		<title>This Code is CRAP</title>
		<link>https://googledata.org/google-testing/this-code-is-crap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=this-code-is-crap</link>
		<comments>https://googledata.org/google-testing/this-code-is-crap/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 21:45:00 +0000</pubDate>
		<dc:creator><![CDATA[Alberto Savoia]]></dc:creator>
				<category><![CDATA[Google Testing]]></category>

		<guid isPermaLink="false">https://googledata.org/?guid=f67f4614f9b21b1a0caf27b62c5120e1</guid>
		<description><![CDATA[Note: This post is rated PG-13 for use of a mild expletive.  If you are likely to be offended by the repeated use a word commonly heard in elementary school playgrounds, please don’t read any further.CRAP is short for Change Risk Anti-Patterns – a ...]]></description>
				<content:encoded><![CDATA[<span style="font-style:italic;">Note: This post is rated PG-13 for use of a mild expletive.  If you are likely to be offended by the repeated use a word commonly heard in elementary school playgrounds, please don’t read any further.<br /></span><br />CRAP is short for Change Risk Anti-Patterns – a mildly offensive acronym to protect you from deeply offensive code.  CRAP was originally developed and launched in 2007 by yours truly (Alberto Savoia) and my colleague and partner in crime Bob Evans.<br /><br />Why call it CRAP?  When a developer or tester has to work with someone else’s (bad) code, they rarely comment on it by saying things like: “The median cyclomatic complexity is unacceptable,” or “The efferent coupling values are too high.”  Instead of citing a particular objective metric, they summarize their subjective evaluation and say things like: “This code is crap!” At least those are the words the more polite developers use; I’ve heard and read far more colorful adjectives and descriptions over the years.  So Bob and I decided to coin an acronym that, in addition to being memorable – even if it’s for the wrong reasons, is a good match with the language that its intended users use and it’s guaranteed to grab a developer’s attention: “Hey, your code is CRAP!”<br /><br />But what makes a particular piece of code CRAP? There is, of course, no fool-proof, 100% objective, and accurate way to determine CRAPpiness. However, our experience and intuition – backed by a bit of research and a lot of empirical evidence – suggested the possibility that there are detectable and measurable patterns that indicate the possible presence of CRAPpy code.  That was enough to get us going with the first anti-pattern (which I’ll describe shortly.)<br /><br />Since its inception, the original version of CRAP has gained quite a following; it has been ported to various languages and platforms (e.g. Java, .NET, Ruby, PHP, Maven, Ant) and it’s showing up both in free and commercial code analysis tools such as Hudson’s Cobertura and Atlassian’s Clover.  Do a Google search for “CRAP code metric” and you’ll see quite a bit of activity.  All of which is making Bob and I feel mighty proud, but we haven’t been resting on our laurels.  Well, actually we have done precisely that.  After our initial work (which included  the Crap4J Eclipse plug-in and the, now mostly abandoned, crap4j.org website) we both went to work for Google and got busy with other projects.  However, the success and adoption of CRAP is a good indication that we were on to something and I believe it’s time to invest a bit more in it and move it forward.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-LSZgYehukNk/TWQvsEETuRI/AAAAAAAAAxo/hHSnpUx7tAw/s1600/crap4jbanner.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 86px;" src="http://2.bp.blogspot.com/-LSZgYehukNk/TWQvsEETuRI/AAAAAAAAAxo/hHSnpUx7tAw/s320/crap4jbanner.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5576634672644077842" /></a><br /><br />Over the next few weeks I will post about the past, present and future of CRAP.  By the time I’m done, you will have the tools to:<br /><br />- Know you CRAP<br />- Cut the CRAP, and<br />- Don’t take CRAP from nobody!<br /><br />I’ll finish today’s entry with a bit of background on the original CRAP metric.<br /><br /><span style="font-weight:bold;">A Brief History of CRAP<br /></span><br />As the CRAP acronym suggests, there are several possible patterns that make a piece of code CRAPpy, but we had to start somewhere. Here is the first version of the (in)famous formula to help detect CRAPpy Java methods.  Let’s call it CRAP1, to make clear that this covers just one of the many interesting anti-patterns and that there are more to come.<br /><br />CRAP1(m) = comp(m)^2 * (1 – cov(m)/100)^3 + comp(m)<br /><br />Where CRAP1(m) is the CRAP1 score for a method m, comp(m) is the cyclomatic complexity of m, and cov(m) is the basis path code coverage from automated tests for m.<br /><br />If CRAP1(m) > 30, we consider the method to be CRAPpy.<br /><br />This CRAP1 formula did not materialize out of thin air.  We arrived at this particular function empirically; it’s the result of a best fit curve achieved through a lot of trial-and-error.  At the time we had access to the source code for a large number of open source and commercial Java projects, along with their associated JUnit tests.  This allowed us to rank code for CRAPpiness using one formula, ask our colleagues if they agreed and kept iterating until we reached diminishing returns.  This way we were able to come up with a curve that was a pretty good fit for the more subjective data we got from our colleagues.<br /><br />Here’s why we think that CRAP1 is a good anti-pattern to detect.  Writing automated tests (e.g., using JUnit) for complex and convoluted code is particularly challenging, so crappy code usually comes with few, if any, automated tests. This means that the presence of automated tests implies not only some degree of testability (which in turn seems to be associated with better, or more thoughtful, design), but it also means that the developers cared enough, knew enough and had enough time to write tests – which is another good sign for the people inheriting the code.  These sounded like reasonable assumptions at the time, and the adoption of CRAP1 – especially by the Agile community – reflects that.<br /><br />Like all software metrics, CRAP1 is neither perfect nor complete. We know very well, for example, that you can have great code coverage and lousy tests. In addition, sometimes complex code is either unavoidable or preferable; there might be instances where a single higher complexity method might be easier to understand than three simpler ones. We are also aware that the CRAP1 formula doesn’t currently take into account higher-order, more design-oriented metrics that are relevant to maintainability (such as cohesion and coupling) – but it’s a start, the plan is to add more anti-patterns.<br /><br /><span style="font-weight:bold;">Use CRAP On Your Project<br /></span><br />Even though Bob and I haven't actively developed or maintained Crap4J in the past few years (shame on us!), other brave developers have been busy porting CRAP to all sorts of languages and environments.  As a result, there are many versions of the CRAP metric in open source and commercial tools.  If you want to try CRAP on your project, the best thing to do is to run a Google search for the language and tools you are currently using.  <br /><br />For example, a search for "crap metric .net" returned several projects, including <a href="http://code.google.com/p/crap4n/">crap4n</a> and one called <a href="http://crap4net.codeplex.com/">crap4net</a>.  If you use Clover, here's how you can <a href="http://blogs.atlassian.com/devtools/2009/09/express-yourself-with-clover-el.html">use it to implement CRAP</a>.  PHP? No problem, someone implemented <a href="http://sebastian-bergmann.de/archives/877-CRAP-in-PHPUnit-3.5.html">CRAP for PHPUnit</a>.  However, apparently nobody has implemented CRAP for COBOL yet ... here's your big chance!<br /><br />Until the next blog on CRAP, you might enjoy this <a href="http://www.youtube.com/watch?v=bV6IhUh0IH4">vintage video on Crap4J.</a>  Please note, however, that the Eclipse plug-in shown in the demo does not work with versions of Eclipse newer than 3.3 - we did say it was a <span style="font-style:italic;">vintage</span> video and that Bob and I have been resting on our laurels!<br /><br /><span class="byline-author">Posted by Alberto Savoia</span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15045980-3825055849080470665?l=googletesting.blogspot.com' alt='' /></div>]]></content:encoded>
			<wfw:commentRss>https://googledata.org/google-testing/this-code-is-crap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
		<item>
		<title>Google Testing Blog 2010-09-27 11:12:00</title>
		<link>https://googledata.org/google-testing/google-testing-blog-2010-09-27-111200/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-testing-blog-2010-09-27-111200</link>
		<comments>https://googledata.org/google-testing/google-testing-blog-2010-09-27-111200/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 16:12:00 +0000</pubDate>
		<dc:creator><![CDATA[Alberto Savoia]]></dc:creator>
				<category><![CDATA[Google Testing]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Update! Speakers &#38; Talks for GTAC 2010We are thrilled to announce the speakers and talks for the 5th Google Test Automation Conference (GTAC). This year’s event will have a total of 11 talks. This includes the three keynotes that we announces ear...]]></description>
				<content:encoded><![CDATA[<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: Times; font-size: medium; "><h3 id="internal-source-marker_0.919825675431639"><span style="font-size: 14pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Update! Speakers &amp; Talks for GTAC 2010</span></h3><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">We are thrilled to announce the speakers and talks for the</span><a href="http://www.gtac.biz/"><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "><span class="Apple-style-span" > 5th Google Test Automation Conference (GTAC)</span></span></a><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">. This year’s event will have a total of 11 talks. This includes the </span><a href="http://www.gtac.biz/keynote-speakers"><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "><span class="Apple-style-span" >three keynotes</span></span></a><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "> that we announces earlier and eight other talks. These talks span the three sub-categories of Testing, Testability and Test Automation which are an integral part of this year’s theme “Test to Testability”.</span><br /><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span><br /><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">As we had shared earlier, for this year’s GTAC we used a new process of letting the selected attendees vote on the talks they wanted be a part of GTAC. The committee tallied the votes and ensures a healthy distribution between topics and participants from across the globe and relevance to our theme. We received over 80 submissions and have an acceptance rate of about 10%. Our thanks to everyone who submitted a proposal and all the attendees who voted to make this a successful process. </span><br /><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span><br /><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Here is the list of talks. More details can be found at the </span><a href="http://www.gtac.biz/selected-talks"><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "><span class="Apple-style-span" >select talks page</span></span></a><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "> on the GTAC site.</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: Times; font-size: medium; "><span class="Apple-style-span" style="font-family: Arial; font-size: 13px; font-weight: bold; white-space: pre-wrap; "><br /></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: Times; font-size: medium; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span><span class="Apple-style-span" style="font-family: Arial; font-size: 13px; font-weight: bold; white-space: pre-wrap; ">Category: Testing</span><ul><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Early Test Feedback by Test Prioritisation (Shin Yoo, University College London &amp;  Robert Nilsson, Google Inc.)</span><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span></li><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Crowd-source testing, Mozilla community style (Matt Evans, Mozilla)</span><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span></li><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Measuring and Monitoring Experience in Interactive Streaming Multimedia Web Applications (Shreeshankar Chatterjee, Adobe Systems India)</span></li></ul><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Category: Testability</span><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span><ul><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Flexible Design? Testable Design? You Don’t Have To Choose! (Russ Rufer and Tracy Bialik, Google Inc.)<span class="Apple-tab-span" style="white-space: pre; "> </span></span><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span></li><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Git Bisect and Testing (Christian Couder)</span></li><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Lessons Learned from Testability Failures (Esteban Manchado Velazquez, Opera Software ASA)<span class="Apple-tab-span" style="white-space: pre; "> </span></span></li></ul><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Category: Test Automation</span><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span><ul><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">The Future of Front-End Testing (Greg Dennis and Simon Stewart, Google Inc.)</span><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span></li><li style="list-style-type: disc; font-size: 11pt; font-family: Arial; background-color: transparent; font-weight: bold; font-style: normal; text-decoration: none; vertical-align: baseline; "><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Twist, a next generation functional testing tool for building and evolving test suites (Vivek Prahlad, ThoughtWorks)</span></li></ul><span style="font-size: 10pt; font-family: Arial; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">For further information on the conference please visit its webpage at</span><a href="http://www.gtac.biz/"><span style="font-size: 10pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "> </span><span style="font-size: 10pt; font-family: Arial; color: rgb(42, 93, 176); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; ">http://www.gtac.biz</span></a><span style="font-size: 10pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">. </span><br /><span style="font-size: 10pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "></span><br /><span style="font-size: 10pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; ">Sujay Sahni for the GTAC 2010 Committee</span></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15045980-8743801451055147728?l=googletesting.blogspot.com' alt='' /></div>]]></content:encoded>
			<wfw:commentRss>https://googledata.org/google-testing/google-testing-blog-2010-09-27-111200/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code coverage goal: 80% and no less!</title>
		<link>https://googledata.org/google-testing/code-coverage-goal-80-and-no-less/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=code-coverage-goal-80-and-no-less</link>
		<comments>https://googledata.org/google-testing/code-coverage-goal-80-and-no-less/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 16:13:00 +0000</pubDate>
		<dc:creator><![CDATA[Alberto Savoia]]></dc:creator>
				<category><![CDATA[Google Testing]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[by Alberto SavoiaI first posted this article a few years ago on the Artima Developer website; but the question of what's adequate code coverage keeps coming up, so I thought it was time for a repost of Testivus wisdom on the subject.Testivus on Test Co...]]></description>
				<content:encoded><![CDATA[<div style="text-align: center;"><br /></div><span class="Apple-style-span"   style="  color: rgb(33, 35, 36); font-family:Arial, Helvetica, sans-serif;font-size:medium;"><p>by Alberto Savoia</p><p>I first posted this article a few years ago on the <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=204677">Artima Developer </a>website; but the question of what's adequate code coverage keeps coming up, so I thought it was time for a repost of <a href="http://www.scribd.com/doc/69769/TheWayOfTestivus">Testivus wisdom</a> on the subject.</p><p><br /></p><p><span class="Apple-style-span"  style="font-size:x-large;"><b>Testivus on Test Coverage</b></span></p><p>Early one morning, a young programmer asked the great master:</p><div class="section"><blockquote style="text-align: left;"><i>“I am ready to write some unit tests. What code coverage should I aim for?”</i></blockquote><p>The great master replied:</p><blockquote><i>“Don’t worry about coverage, just write some good tests.”</i></blockquote><p>The young programmer smiled, bowed, and left.</p><p><img src="http://2.bp.blogspot.com/_O4TNu1SGWXg/TEXOkbCRk2I/AAAAAAAAAZY/UjyxzTnNnFQ/s200/TestivusYinYang.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 55px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5496026045403468642" /></p><p>Later that day, a second programmer asked the same question.</p><p>The great master pointed at a pot of boiling water and said:</p><blockquote><i>“How many grains of rice should I put in that pot?”</i></blockquote><p>The programmer, looking puzzled, replied:</p><blockquote><i>“How can I possibly tell you? It depends on how many people you need to feed, how hungry they are, what other food you are serving, how much rice you have available, and so on.”</i></blockquote><p>“<i>Exactly,”</i> said the great master.</p><p>The second programmer smiled, bowed, and left.</p><p><img src="http://4.bp.blogspot.com/_O4TNu1SGWXg/TEXO8XFfUsI/AAAAAAAAAZg/wyo5iuepIdI/s200/TestivusYinYang.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 55px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5496026456660071106" /></p><p>Toward the end of the day, a third programmer came and asked the same question about code coverage.</p><blockquote><i>“Eighty percent and no less!”</i> Replied the master in a stern voice, pounding his fist on the table.</blockquote><p>The third programmer smiled, bowed, and left.</p><p></p><p><img src="http://4.bp.blogspot.com/_O4TNu1SGWXg/TEXO8XFfUsI/AAAAAAAAAZg/wyo5iuepIdI/s200/TestivusYinYang.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5496026456660071106" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 200px; height: 55px; " /></p><p></p><p>After this last reply, a young apprentice approached the great master:</p><blockquote><i>“Great master, today I overheard you answer the same question about code coverage with three different answers. Why?”</i></blockquote><p>The great master stood up from his chair:</p><blockquote><i>“Come get some fresh tea with me and let’s talk about it.”</i></blockquote><p>After they filled their cups with smoking hot green tea, the great master began:</p><blockquote><p><i>“The first programmer is new and just getting started with testing. Right now he has a lot of code and no tests. He has a long way to go; focusing on code coverage at this time would be depressing and quite useless. He’s better off just getting used to writing and running some tests. He can worry about coverage later.</i></p><p><i>The second programmer, on the other hand, is quite experienced both at programming and testing. When I replied by asking her how many grains of rice I should put in a pot, I helped her realize that the amount of testing necessary depends on a number of factors, and she knows those factors better than I do – it’s her code after all. There is no single, simple, answer, and she’s smart enough to handle the truth and work with that.”</i></p></blockquote><p><i>“I see,”</i> said the young apprentice, <i>“but if there is no single simple answer, then why did you tell the third programmer ‘Eighty percent and no less’?”</i></p><p>The great master laughed so hard and loud that his belly, evidence that he drank more than just green tea, flopped up and down.</p><blockquote><i>“The third programmer wants only simple answers – even when there are no simple answers … and then does not follow them anyway.”</i></blockquote><p>The young apprentice and the grizzled great master finished drinking their tea in contemplative silence.</p><p></p><p><img src="http://4.bp.blogspot.com/_O4TNu1SGWXg/TEXO8XFfUsI/AAAAAAAAAZg/wyo5iuepIdI/s200/TestivusYinYang.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5496026456660071106" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 200px; height: 55px; " /></p><p></p></div></span><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15045980-4119408997316881321?l=googletesting.blogspot.com' alt='' /></div>]]></content:encoded>
			<wfw:commentRss>https://googledata.org/google-testing/code-coverage-goal-80-and-no-less/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
		<item>
		<title>Testivus, Testability and Dr. Jekyll and Mr. Hyde</title>
		<link>https://googledata.org/google-testing/testivus-testability-and-dr-jekyll-and-mr-hyde/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testivus-testability-and-dr-jekyll-and-mr-hyde</link>
		<comments>https://googledata.org/google-testing/testivus-testability-and-dr-jekyll-and-mr-hyde/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 17:45:00 +0000</pubDate>
		<dc:creator><![CDATA[Alberto Savoia]]></dc:creator>
				<category><![CDATA[Google Testing]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[by Alberto SavoiaNote: Apparently, there were lots of downloads of the Testivus booklet and I hit some kind of quota on my personal account.  If you have problems with reaching the original link below, please try this new download link or this one.A ma...]]></description>
				<content:encoded><![CDATA[<div style="text-align: left;"><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">by Alberto Savoia</span></span></div><div style="text-align: left;"><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div style="text-align: left;"><span class="Apple-style-span"  style="font-family:arial, sans-serif;"><span class="Apple-style-span" style="border-collapse: collapse; "><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span" style="border-collapse: separate; "><span class="Apple-style-span"  style="font-size:medium;"><b><i>Note:</i></b><i> Apparently, there were lots of downloads of the Testivus booklet and I hit some kind of quota on my personal account.  If you have problems with reaching the original link below, please try this </i></span><span class="Apple-style-span"  style="font-size:medium;"><a href="http://bit.ly/thewayoftestivus"><i>new download link</i></a><i> or </i><a href="http://www.scribd.com/doc/69769/TheWayOfTestivus"><i>this one</i></a><i>.</i></span></span></span></span></span></div><div style="text-align: left;"><span class="Apple-style-span"  style="font-family:arial, sans-serif;"><span class="Apple-style-span" style="border-collapse: collapse; "><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span" style="border-collapse: separate; "><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></span></span></span></div><div style="text-align: left;"><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">A major topic at this year's </span></span><a href="http://www.gtac.biz/"><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="color:#000000;"><span class="Apple-style-span"  style="font-size:medium;">GTAC</span></span></span></a><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"> conference is going to be testability: </span></span><i><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">"We also want to highlight methodologies and tools that can be used to build testability into our products."  </span></span></i><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">That's great!</span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">Testability is one of the most important, yet overlooked, attributes of code – and one that is not discussed enough.  That's unfortunate, because by the time the issue of testability comes up in a project it's usually too late.  As preparation and seeding for GTAC, I though it would be fun and useful to get some discussions on testability going.  So here we go, feel free to chime in with your thoughts.</span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><b><span class="Apple-style-span" style="font-weight: normal;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></b></span></div><div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">A few years ago, after watching one too many episodes of </span></span><i><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">Kung Fu</span></span></i><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">, I was inspired to write a pretentious and cryptic little booklet about testing called </span><i><span class="Apple-style-span"  style="font-size:medium;">"The Way of Testivus" <span class="Apple-style-span" style="font-style: normal;">(<a href="http://bit.ly/thewayoftestivus">PDF</a>)</span></span></i><span class="Apple-style-span"  style="font-size:medium;">.</span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><img src="http://4.bp.blogspot.com/_O4TNu1SGWXg/TCjmdai0rAI/AAAAAAAAAYs/Gxahj_nNs7Y/s320/Testivus_2.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 306px; height: 320px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5487889538966924290" /></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">Testivus addresses the issue of testability in a few places, but I would like to start the discussion with this </span></span><i><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">maxim</span></span></i><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">:</span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div></div><div><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "><img src="http://3.bp.blogspot.com/_O4TNu1SGWXg/TCjhiqGS7HI/AAAAAAAAAYk/ZtgjppZ9rUE/s400/Testivus_1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5487884131483446386" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 193px; " /></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">To me, "Think of code and tests as one" is the very foundation of testability.  If you don't think about testing as you design and implement your code, you are very likely to make choices that will impair testability when the time comes.  This position seemed obvious and non-controversial to me at the time I wrote it, and I still stand by it.  Most people seem to agree with it as well, and more than one person told me that it's their favorite and most applicable maxim from all of Testivus.  There are however three groups of people who found issue with it.</span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">Some of the people, mostly from the TDD camp, think that my choice of words leaves too much wiggle room: </span><i><span class="Apple-style-span"  style="font-size:medium;">"</span></i><span class="Apple-style-span"  style="font-size:medium;">Thinking</span><i><span class="Apple-style-span"  style="font-size:medium;"> about the tests is not enough, they should be </span></i><span class="Apple-style-span"  style="font-size:medium;">writing and running</span><i><span class="Apple-style-span"  style="font-size:medium;"> those tests at the same time." </span></i></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><i></i></span></span><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">Others think that code and tests should not be thought of as </span><i><span class="Apple-style-span"  style="font-size:medium;">one</span></i><span class="Apple-style-span"  style="font-size:medium;"> at all, but they should be treated independently – ideally as adversaries: </span><i><span class="Apple-style-span"  style="font-size:medium;">"I don't want code and tests to be too "friendly".  Production code should not be changed or compromised to make the testing easier, and tests should not trust the </span></i><i><span class="Apple-style-span"  style="font-size:medium;">hooks</span></i><i><span class="Apple-style-span"  style="font-size:medium;"> put in the code to make it more testable."  </span></i><span class="Apple-style-span"  style="font-size:medium;">Most of the people in this camp are not big fans of unit/developer testing in the first place, but not all.  One person, a believer in developer testing, told me that he gets the best results with a Dr. Jekyll and Mr. Hyde approach.  </span></span><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">He assumes two different roles and personalities based on whether he's coding or testing his own code. When coding, he's the constructive Dr. Jekyll who focuses on elegant and efficient design and algorithms – and does not worry about testability.  When testing, he turns into the destructive Mr. Hyde; he tries to forget that it's his code or how he implemented it, and puts all his energy and anger into trying to break it.  Sounds like it could work quite well – though I don't think I'd want this person as an office mate during the Mr. Hyde phase.</span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><i><span class="Apple-style-span"  style="font-size:medium;"><br /></span></i></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">A third group, thought that the maxim was fine for unit tests, but not applicable to other types of tests that were best served by an adversarial black-box approach.  </span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">What are your thoughts?  Is it enough to </span><i><span class="Apple-style-span"  style="font-size:medium;">think</span></i><span class="Apple-style-span"  style="font-size:medium;"> about testability when designing or writing the code, or must you actually write and run some tests in parallel with the code?  Does anyone agree with the position that code and tests should be designed and developed in isolation?  Are there other Dr. Jekylls and Mr. Hydes out there?</span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;"><br /></span></span></div><div><span class="Apple-style-span"  style="font-family:arial;"><span class="Apple-style-span"  style="font-size:medium;">Alberto</span></span></div><div><span class="Apple-style-span"  style=" ;font-family:arial;"><br /></span></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15045980-535746715762009917?l=googletesting.blogspot.com' alt='' /></div>]]></content:encoded>
			<wfw:commentRss>https://googledata.org/google-testing/testivus-testability-and-dr-jekyll-and-mr-hyde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
	</channel>
</rss>
