<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Matasano Chargen - Latest Comments in Coverage: Don&amp;#8217;t Believe The Hype</title><link>http://matasanochargen.disqus.com/</link><description></description><language>en</language><lastBuildDate>Fri, 25 Apr 2008 05:52:20 -0000</lastBuildDate><item><title>Re: Coverage: Don&amp;#8217;t Believe The Hype</title><link>http://www.matasano.com/log/1043/coverage-dont-believe-the-hype/#comment-2323885</link><description>Methods should respond to invalid input by throwing an exception.&lt;br&gt;&lt;br&gt;Example one: When testing methods that accept an integer within a specific range, submit an integer outside of that range and then verify that the application throws an ArgumentOutOfRangeException.&lt;br&gt;&lt;br&gt;Example two: When you test methods that accept input as a string of limited length, submit a string that is too long or does not meet other requirements to be valid.&lt;br&gt;&lt;br&gt;Example three: If you determine that your application should reject any input containing HTML, test the method by submitting HTML, and fail the test unless the correct exception is detected.&lt;br&gt;&lt;br&gt;Some methods sanitize input rather than reject it outright. For example, methods that accept Web input which need to encode HTML characters, and methods that submit string input to a database need to parse SQL delimiters. Methods that sanitize malicious input are much more difficult to test, because they don't simply throw an exception or otherwise return an easily testable condition. In these circumstances, generate a test that checks both the input and the output to verify that the input was successfully sanitized.&lt;br&gt;&lt;br&gt;Note that this usually works best when done with TDD by developer-testers before SQE's get their dirty hands on the code.  I suggest this to be done in a separate test environment if possible, both in-IDE as well as using a continuous integration server.  This seems like more work, but when you integrate regression testing in the same manner, and take into account refactorings (as well as other similar design patterns found in modern development shops) - then it becomes more obvious that operational excellence is the result.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andre Gironda</dc:creator><pubDate>Fri, 25 Apr 2008 05:52:20 -0000</pubDate></item><item><title>Re: Coverage: Don&amp;#8217;t Believe The Hype</title><link>http://www.matasano.com/log/1043/coverage-dont-believe-the-hype/#comment-2323884</link><description>and what did you verify them against?  :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave G.</dc:creator><pubDate>Thu, 24 Apr 2008 13:28:35 -0000</pubDate></item><item><title>Re: Coverage: Don&amp;#8217;t Believe The Hype</title><link>http://www.matasano.com/log/1043/coverage-dont-believe-the-hype/#comment-2323887</link><description>Dave G: unit tests that verify input validation on inputs?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andre Gironda</dc:creator><pubDate>Wed, 23 Apr 2008 20:16:25 -0000</pubDate></item><item><title>Re: Coverage: Don&amp;#8217;t Believe The Hype</title><link>http://www.matasano.com/log/1043/coverage-dont-believe-the-hype/#comment-2323883</link><description>@Dre&lt;br&gt;&lt;br&gt;For security testing, what good is code coverage without saying what you tested the code for?  If you can test 10% and shake out all of the bugs, then you can test 90% and shake out none of them :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave G.</dc:creator><pubDate>Wed, 23 Apr 2008 11:49:07 -0000</pubDate></item><item><title>Re: Coverage: Don&amp;#8217;t Believe The Hype</title><link>http://www.matasano.com/log/1043/coverage-dont-believe-the-hype/#comment-2323886</link><description>I don't like to mix the "code coverage" terminology with the "surface/vuln/threat coverage" terminology.&lt;br&gt;&lt;br&gt;Code coverage is a unique way of understanding the output of unit and/or functional white-box tests.  You can have 10% code coverage and find all of the bugs (Yes, that's not a typo.  10% -- not 100%).  You can have 30% or 85%.  This all depends on where the conditions and decisions in the code are (sometimes referred to as "meatballs" and "gravy").  Condition-decision coverage is usually the best one to apply to languages such as C/++, C#, and Java from a develop-tester POV.&lt;br&gt;&lt;br&gt;Often, problems with measuring code coverage with NCSS come from issues such as getters/setters, as well as not measuring "statements" correctly in the first place (e.g. measuring brackets/braces on new lines).  I'm sure there are other issues, but I figure I'd bring the more obvious ones up front and center.&lt;br&gt;&lt;br&gt;In the case of automated fuzz testing with code knowledge (either from EFS/PaiMei or by actually using the source code), line/statement coverage is often enough to go digging for untested inputs.  In other words, when you're looking to get inside the heads of the product release team.  In this case, you're not looking to "get" a certain percentage of code coverage -- you're looking "at" the code coverage statistics to find out where to start/stop testing.&lt;br&gt;&lt;br&gt;As far as "Vuln. Class Coverage" and "Threat Based Coverage" go... these don't belong in the same discussion as code coverage.  They're just totally different things.  What you refer to as Vuln/Threat coverage is a matter of risk assessment / risk management.  The answer to the question, the question that drives us - "What is risk management?" is not always answered in a simple way.  Everyone has their own perspective, as well as their own risk tolerance.  The only answer is "we don't have an answer or a clear way of measuring this universally yet".&lt;br&gt;&lt;br&gt;I could suggest a few books on the subject of measuring security and evaluation risk, although it sounds like the people that you griping about don't read the literature in the first place.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andre Gironda</dc:creator><pubDate>Wed, 23 Apr 2008 01:17:24 -0000</pubDate></item><item><title>Re: Coverage: Don&amp;#8217;t Believe The Hype</title><link>http://www.matasano.com/log/1043/coverage-dont-believe-the-hype/#comment-2323882</link><description>It takes a village of security researchers to measure a system.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">2guesswhat</dc:creator><pubDate>Tue, 22 Apr 2008 22:06:19 -0000</pubDate></item></channel></rss>