<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CUEFRn08fSp7ImA9WhBaEE4.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436</id><updated>2013-05-20T00:06:57.375-07:00</updated><category term="rugged" /><category term="project rescue" /><category term="exploratory testing" /><category term="devopsdays" /><category term="static analysis" /><category term="debugging" /><category term="XP" /><category term="books" /><category term="bugs" /><category term="risk management" /><category term="Capers Jones" /><category term="contracting" /><category term="bug tracking" /><category term="Oracle" /><category term="RSA" /><category term="pairing" /><category term="leadership" /><category term="CSDP" /><category term="code reviews" /><category term="software development" /><category term="stackoverflow" /><category term="OWASP" /><category term="DAD" /><category term="agile" /><category term="SQL Injectoin" /><category term="metrics" /><category term="planning" /><category term="SDL" /><category term="resources" /><category term="Continuous Delivery" /><category term="Kanban" /><category term="reliability" /><category term="agile development" /><category term="maintenance" /><category term="productivity" /><category term="devops" /><category term="Clean Code" /><category term="Frankensystems" /><category term="scalability" /><category term="cloud computing" /><category term="refactoring" /><category term="OpenSAMM" /><category term="security" /><category term="iterative development" /><category term="Construx" /><category term="Conway's Law" /><category term="SANS" /><category term="deployment" /><category term="appsec" /><category term="incremental development" /><category term="teams" /><category term="PMI" /><category term="Joel Test" /><category term="legacy code" /><category term="test automation" /><category term="technical debt" /><category term="code ownership" /><category term="PMI-ACP" /><category term="Scrum" /><category term="unit testing" /><category term="pen testing" /><category term="design" /><category term="quality" /><category term="attack surface" /><category term="middleware" /><category term="Spiral" /><category term="project management" /><category term="testing" /><category term="architecture" /><category term="failure" /><category term="Disciplined Agile Delivery" /><category term="management" /><category term="estimation" /><category term="Continuous Deployment" /><title>Building Real Software</title><subtitle type="html">Developing and Maintaining Secure and Reliable Software in the Real World</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://swreflections.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>158</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/BuildingRealSoftware" /><feedburner:info uri="buildingrealsoftware" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;Dk4ARXY5cCp7ImA9WhBbFk4.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-3175287914333003039</id><published>2013-05-15T09:22:00.001-07:00</published><updated>2013-05-15T09:22:24.828-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-15T09:22:24.828-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="agile" /><category scheme="http://www.blogger.com/atom/ns#" term="XP" /><category scheme="http://www.blogger.com/atom/ns#" term="Scrum" /><category scheme="http://www.blogger.com/atom/ns#" term="PMI-ACP" /><category scheme="http://www.blogger.com/atom/ns#" term="agile development" /><title>Certified Agile: The PMI-ACP Exam</title><content type="html">&lt;p&gt;I sat for the Project Management Institute’s &lt;a href="http://www.pmi.org/Certification/New-PMI-Agile-Certification.aspx"&gt;Agile Certified Practitioner (PMI-ACP)&lt;/a&gt; exam earlier this week. The PMI-ACP tests your understanding of common Agile development methods, values and practices. It focuses on basic Agile principles, and on Scrum and XP in detail, as well as fundamentals of Lean and Kanban.
&lt;/p&gt;
&lt;p&gt;
Unlike the PMP, there is no &lt;a href="http://www.pmi.org/en/PMBOK-Guide-and-Standards/Standards-Library-of-PMI-Global-Standards.aspx"&gt;Book of Knowledge&lt;/a&gt; which defines best practices and a process framework for this certification. Instead there is a &lt;a href="http://www.pmi.org/Certification/~/media/Files/PDF/Agile/PMI_Agile_Certification_Content_Outline.ashx"&gt;certification content outline&lt;/a&gt; that explains at a high level the tools, techniques, knowledge and skills that you will be expected to know and will be tested on, and a &lt;a href="http://www.pmi.org/Certification/~/media/PDF/Certifications/ACP_Reference_list_v2.ashx"&gt;reference list of books to read&lt;/a&gt; which includes some of the usual suspects. Out of this list I’d recommend reading &lt;a href="http://www.mountaingoatsoftware.com/books"&gt;Mike Cohn’s books&lt;/a&gt; on Agile Estimating and Planning and User Stories - they are useful for the exam and they're worth reading regardless. If you’re not working in an XP shop you should also read Kent Beck’s &lt;a href="http://www.amazon.com/Extreme-Programming-Explained-Embrace-Change/dp/0321278658"&gt;Extreme Programming Explained&lt;/a&gt; to make sure that you understand XP, and you must read up on the basics of Lean and Kanban. And of course you need to memorize the &lt;a href="http://agilemanifesto.org/"&gt;Agile Manifesto&lt;/a&gt;  and the &lt;a href="http://agilemanifesto.org/principles.html"&gt;Twelve Principles of Agile Software Development&lt;/a&gt; front to back.
&lt;/p&gt;


&lt;p&gt;But I know from writing the PMP several years ago that experience and general reading aren’t enough to prepare for a PMI certification exam. PMI wants everyone who holds a certification to know the same things, and to share the same values and to think and act the same way. There’s an emphasis on orthodoxy – you’re tested not on what you would do (based on your experience and common practical knowledge), but what you should do according to PMI's definition of what “the right way" is to do something. And PMI’s exams are as much a test of your ability to read and write an exam as they are of the subject matter, with trick questions and trip-up answers and questions which are purposefully hard to understand, and even some extra questions thrown in which don’t make sense at all. Writing a test like this is not fun, although the PMI-ACP exam is certainly not as hard as the PMP exam - you shouldn’t need the 3+ hours that you’re given to complete this test.&lt;/p&gt;

&lt;p&gt;So &lt;a href="http://www.linkedin.com/groups/How-I-passed-my-PMIACP-3908307.S.148217234"&gt;like others&lt;/a&gt;, I decided to use an exam prep guide to finish my studying.
&lt;/p&gt;
&lt;p&gt;
The &lt;a href="http://www.amazon.com/PMI-ACP-Exam-Pass-Your-First/dp/0982760833/ "&gt;PMI-ACP Exam: How to Pass on Your First Try&lt;/a&gt; by Andy Crowe is a quick overview of the material that you should know for the exam. Easy to read and easy to follow, it defines key terms and “doing Agile right”, roles and responsibilities and rituals and tools, and covers communication and collaboration issues, and includes some sample questions (and access to a sample online exam). This is not an especially insightful book, but I found it useful for last minute review and cramming.
&lt;/p&gt;
&lt;p&gt;
I did most of my studying with Mike Griffiths’ &lt;a href="http://www.amazon.com/PMI-ACP-Exam-Prep-Premier-Practitioner/dp/1932735585"&gt;PMI-ACP Exam Prep: A Course in a Book for Passing the PMI Agile Certified Practitioner (PMI-ACP) Exam&lt;/a&gt;, a much more complete study guide, and a good overview of Agile development that is worth keeping and reading on its own. This book builds on materials that Griffiths published earlier on &lt;a href="http://leadinganswers.typepad.com/leading_answers/"&gt;his blog&lt;/a&gt; and it is especially good on Agile reporting tools.
&lt;/p&gt;
&lt;p&gt;
Griffiths is one of the experts who created the PMI-ACP program and so he understands what you need to know in depth, and he is a good writer. However, his book is harder to study from than Crowe’s, because it contains a lot more details and because it is structured around the artificial domains that PMI uses to describe Agile development. This results in several discontinuities, where an idea or practice is introduced under “Value Driven Delivery” and then continues later under “Adaptive Planning” or “Continuous Improvement” or one of the other domains (it is not necessary by the way to learn the domains for the exam).
&lt;/p&gt;
&lt;p&gt;
If you have solid experience with Agile development (which you need to in order to meet the qualifying bar) especially Scrum and XP, you should be able to pass the exam with the help of Griffiths’ guide and some general reading to fill in gaps.
&lt;/p&gt;
&lt;p&gt;
Studying for the PMI-ACP has made me examine Agile development ideas and practices in more detail (which is why I decided to apply for the certification). But it hasn't changed how I think about Agile practices and methods or how I think you should follow them. I am just as convinced today as I was before that the key is not following some method in a pure way, but instead to &lt;a href="http://www.javaworld.com/javaworld/jw-05-2013/130513-software-development-s-new-frontiers.html"&gt;build your own toolkit&lt;/a&gt;, to borrow what works from different methods and adapt them to your specific requirements, constraints and situation. And the more that you know and understand about Agile methods and practices, the more tools you have for your toolkit.
&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/PhcPug21h0Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/3175287914333003039/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=3175287914333003039" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3175287914333003039?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3175287914333003039?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/PhcPug21h0Q/certified-agile-pmi-acp-exam.html" title="Certified Agile: The PMI-ACP Exam" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/05/certified-agile-pmi-acp-exam.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04MSXg5eyp7ImA9WhBUGUk.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-5160883726055634656</id><published>2013-05-07T11:06:00.001-07:00</published><updated>2013-05-07T11:06:28.623-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-07T11:06:28.623-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="static analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="appsec" /><title>Appsec – Can anything Stop the Bad Guys?</title><content type="html">&lt;p&gt;WhiteHat Security recently published their &lt;a href="https://www.whitehatsec.com/resource/stats.html"&gt;2012 report on website security&lt;/a&gt;. Like &lt;a href="https://info.veracode.com/state-of-software-security-report-volume5.html"&gt;Veracode&lt;/a&gt;, WhiteHat collects and analyzes data from security tests run across their customer base each year. WhiteHat's analysis focuses on data from dynamic testing of 15,000 sites at 650 organizations – all results manually reviewed and verified. From this data they are able to see trends and to build industry scorecards. The report makes for fascinating reading.
&lt;/p&gt;
&lt;p&gt;
On average, web sites are getting more secure each year: the average web site had over 1,000 vulnerabilities in 2007, and only 56 in 2012. SQL injection, the most popular and most serious attack vector, is found in only 7% of their customer’s web sites.
&lt;/p&gt;
&lt;p&gt;
This is the good news.
&lt;/p&gt;
&lt;p&gt;

What made WhiteHat’s analysis this year especially valuable is that they also surveyed customers about their secure SDLC practices and the effectiveness of their security programs. Although the survey set was small (less than 20% of customers responded), this data allowed WhiteHat to correlate vulnerability data with secure SDLC practices operational controls, as well as appsec program drivers and breach data.
&lt;/p&gt;
&lt;h2&gt;Compliance impact on Appsec&lt;/h2&gt;

&lt;p&gt;
White Hat found that the main driver for fixing security vulnerabilities is compliance – this matches up with findings from the &lt;a href="http://www.sans.org/reading_room/analysts_program/sans_survey_appsec.pdf"&gt;SANS Appsec survey&lt;/a&gt; last year.
&lt;/p&gt;
&lt;p&gt;

But they also found that compliance is the number one reason that some vulnerabilities don’t get fixed: many organizations are following the letter of the law, doing what compliance says that they have to and only what they have to, not going any further even if it would make sense to do so from a risk management perspective or to meet customer demands. 
&lt;/p&gt;
&lt;h2&gt;Best Practices and Tools – What Works?&lt;/h2&gt;

&lt;p&gt;Training developers seems to help. More than half of White Hat’s customers had done at least some security training for developers. Organizations that invested in security training for developers had 40% fewer vulnerabilities and resolved them 59% faster. 
&lt;/p&gt;
&lt;p&gt;

But other best practices and tools don’t seem to be effective.
&lt;/p&gt;
&lt;p&gt;

Just over half of customers relied on application libraries or frameworks with centralized security controls. Relying too much on these controls seems to provide a false sense of security: organizations that used security libraries or frameworks with security controls had 64% more vulnerabilities and resolved them 27% slower. 
&lt;/p&gt;
&lt;p&gt;

One factor that makes these organizations more vulnerable is that if the underlying framework is exploitable, then all of the sites that rely on it are vulnerable, like the &lt;a href="http://www.theregister.co.uk/2013/01/10/ruby_on_rails_security_vuln/"&gt;recent security problems with Rails&lt;/a&gt;. Another problem may be that developers are naïve about what a security library will do for them: &lt;a href="http://shiro.apache.org/"&gt;Apache Shiro&lt;/a&gt; or something like it for example will take care of a lot of application security problems, but it won’t protect your app from SQL injection or XSS or CSRF or other common attacks, leaving big holes for the bad guys. There’s more work that still needs to be done to make an application secure.
&lt;/p&gt;
&lt;p&gt;

Organizations that use static analysis had 15% more vulnerabilities found through WhiteHat's dynamic testing, and resolved them on average 26% slower. Maybe because running a tool doesn't do anything if you don’t fix the vulnerabilities. Or because there isn't a high overlap between the vulnerabilities that static analysis finds and what’s found through dynamic analysis.
&lt;/p&gt;

&lt;h2&gt;But Nothing Stops Breaches&lt;/h2&gt;
&lt;p&gt;
85% of WhiteHat's customers test their apps pre-production, a third of them before every change is pushed out. These organizations are trying to do the right thing.
&lt;/p&gt;
&lt;p&gt;

But almost one quarter of White Hat’s customers had experienced security breaches as a result of an application vulnerability. It doesn't seem to matter if they tested often, or if they trained their developers, or how much they trained them, or if they used use static analysis or secure libraries or a WAF or other operational security controls. These organizations were just as likely to experience a breach as organizations that didn't do as much training or as much testing or didn't use the tools.
&lt;/p&gt;
&lt;p&gt;

WhiteHat’s report raises a lot of fascinating questions. Do the breach findings mean that security testing, or developer training or using secure libraries or other tools don’t work? 
&lt;/p&gt;
&lt;p&gt;

Or is this simply evidence of the essential asymmetry of the “&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163518.aspx"&gt;Attacker’s Advantage and the Defender’s Dilemma&lt;/a&gt;”? Even though the number of serious vulnerabilities on average is declining significantly year on year, 86% of all the web sites that WhiteHat tested had at least one serious vulnerability (and keep in mind that WhiteHat - or any other vendor - can't catch every vulnerability). On average only 61% of these vulnerabilities were fixed and it took 193 days for this to get done. All it takes is one vulnerability for the bad guys to get in, and we’re still giving them too many chances and too much time to succeed.
&lt;/p&gt;
&lt;p&gt;


Or maybe we just need more time to see the results of training and testing and tools and other best practices. Time for developers to understand and fix legacy bugs and to change how they design and build software to be more safe and secure in the first place, to “&lt;a href="http://www.amazon.com/Software-Security-Building-Gary-McGraw/dp/0321356705"&gt;build security in&lt;/a&gt;”. Time for management to understand that compliance shouldn't be the main driver for building secure software. Time to raise the bar enough that the bad guys start looking for another, easier target. We’ll have to wait another year to see WhiteHat’s next report and see if some more time makes any real difference.
&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/er9Al8j_07Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/5160883726055634656/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=5160883726055634656" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/5160883726055634656?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/5160883726055634656?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/er9Al8j_07Q/appsec-can-anything-stop-bad-guys.html" title="Appsec – Can anything Stop the Bad Guys?" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/05/appsec-can-anything-stop-bad-guys.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYDRH45fip7ImA9WhBUEkg.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-561934723192758908</id><published>2013-04-29T10:39:00.000-07:00</published><updated>2013-04-29T10:39:35.026-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-29T10:39:35.026-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="XP" /><category scheme="http://www.blogger.com/atom/ns#" term="maintenance" /><category scheme="http://www.blogger.com/atom/ns#" term="refactoring" /><category scheme="http://www.blogger.com/atom/ns#" term="pairing" /><title>What does Code Ownership do to Code?</title><content type="html">&lt;p&gt;In my last post, I talked about &lt;a href="http://swreflections.blogspot.ca/2013/04/code-ownership-who-should-own-code.html"&gt;Code Ownership models&lt;/a&gt;, and why you might want to choose one code ownership model (strong, weak/custodial or collective) over another. Most of the arguments over code ownership focus on managing people, team dynamics, and the effects on delivery. But what about the longer term effects on the shape, structure and quality of code – does the ownership model make a difference? What are the long-term effects of letting everyone working on the same code, or of having 1 or 2 people working on the same pieces of code for a long time?&lt;/p&gt;

&lt;h2&gt;Collective Code Ownership and Code Quality&lt;/h2&gt;

&lt;p&gt;Over time, changes tend to concentrate in certain areas of code: in core logic and in and behind interfaces (listen to Michael Feathers’ fascinating talk &lt;a href="http://www.youtube.com/watch?v=0eAhzJ_KM-Q"&gt;Discovering Startling Things from your Version Control System&lt;/a&gt;). This means that the longer a system has been running, the more chances there are for people to touch the same code.
Some interesting research work backs up what should be obvious: that the people who understand the code the best are the people who work on it the most, and the people who know the code the best make less mistakes when changing it.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://research.microsoft.com/pubs/150498/bird2011dtm.pdf"&gt;In Don’t Touch my Code!&lt;/a&gt;, researchers at Microsoft (BTW, the lead author Christian Bird is not a relative of mine, at least not a relative who I know) found that as more people touch the same piece of code, it leads to more opportunities for misunderstandings and more mistakes. Not surprisingly, people who hadn't worked on a piece of code before made more mistakes, and as the number of developers working on the same module increased, so did the chance of introducing bugs.&lt;/p&gt;

&lt;p&gt;Another study, &lt;a href="http://www.cs.ucdavis.edu/research/tech-reports/2010/CSE-2010-4.pdf"&gt;Ownership and Experience in Fix-Inducing Code&lt;/a&gt; tries to answer which is more important in code quality: “too many cooks spoil the broth”, or “&lt;a href="http://en.wikipedia.org/wiki/Linus%27_Law"&gt;given enough eyeballs, all bugs are shallow&lt;/a&gt;”? Does more people working on the same code lead to more bugs, or does having more people working on the code mean that there are more chances to find bugs early? This research team found that a programmer’s specific experience with the code was the most important factor in determining code quality – code that is changed by the programmer who does most of the work on that code is of higher quality than code written by someone who doesn't normally work on the code, even if that someone is a senior developer who has worked on other parts of the code. And they found that the fewer the people working on a piece of code, the fewer the bugs that needed to be fixed.&lt;/p&gt;

&lt;p&gt;And a &lt;a href="http://www4.ncsu.edu/~apmeneel/ccs221-meneely.pdf"&gt;study on contributions to Linux&lt;/a&gt; reinforces that as the number of developers working on the same piece of code increase, the chance of bugs and security problems increases significantly: code touched by more than 9 developers is 16x more likely to have security vulnerabilities, and more vulnerabilities are introduced by developers who are making changes across many different pieces of code.&lt;/p&gt;

&lt;h2&gt;Long-term Effects of Ownership Approach on Code Structure&lt;/h2&gt;

&lt;p&gt;I've worked at shops where the same programmers have owned the same code for 3 or 4 or 5 or even 10 years or sometimes even longer. Over that time, that programmer’s biases, strengths, weaknesses and idiosyncrasies are all amplified, wearing deep grooves in the code. This can be a good thing, and a bad thing.&lt;/p&gt;

&lt;p&gt;The good thing is that with one person making most or all of the changes, internal consistency in any piece of code will be high – you can look at a piece of code written by that developer and once you understand their approach and way of thinking, the patterns and idioms that they prefer, everything should be familiar and easy to follow. Their style and approach might have changed over time as they learned and improved as a developer, but you can generally anticipate how the rest of the code will work, and you’ll recognize what they are good at and what their blind spots are, what kind of mistakes they are prone to: as I mentioned in the earlier post, this makes code easier to review and easier to test and so easier to find and fix bugs.&lt;/p&gt;

&lt;p&gt;If a developer tends to write good, clean, tight code, and if they are diligent about refactoring and keeping the code clean and tight, then most of the code will be good, clean, tight and easy to follow. Of course it follows that if they tend to write sloppy, hard-to-understand, poorly structured code, then most of it will be sloppy, hard-to-understand and poorly-structured. Then again, even this can be a good thing – at least bad code is isolated, and you know what you have to rewrite, instead of someone spreading a little bid of badness everywhere.&lt;/p&gt;

&lt;p&gt;When ownership changes – when the primary contributor leaves, and a new owner takes over, the structure and style of the code will change as well. Maybe not right away, because a new owner usually takes some time to get used to the code before they put their stamp on it, but at some point they’ll start adapting it – even unconsciously – to their own preferences and biases and ways of thinking, refactoring or rewriting it to suit them.&lt;/p&gt;

&lt;p&gt;If a lot of developers have worked on the same piece of code, they will introduce different ideas, techniques and approaches over time as they each do their part, as they refactor and rewrite things according to their own ideas of what is easy to understand and what isn't, what’s right and wrong. They will each make different kinds of mistakes. Even with clear and consistent shared team conventions and standards, differences and inconsistencies can build up over time, as people leave and new people join the team, creating dissonance and making it harder to follow a thought through the code, harder to test and review, and harder to hold on to the design.&lt;/p&gt;

&lt;h2&gt;Ownership Models and Refactoring&lt;/h2&gt;

&lt;p&gt;But as Michael Feathers has found through mining version control history, there is also a positive Ownership Effect on code as more people work on the same code. &lt;/p&gt;

&lt;p&gt;Over time, methods and classes tend to get bigger because it’s easier to add code to an existing method than to write a new method, and easier to add another method to an existing class than create a new class. By correlating the number of developers who have touched a piece of code with method size, Feathers research shows that as the number of developers working on a piece of code increases, the average method size tends to get smaller. In other words, having multiple people working on a code base encourages refactoring and simpler code, because people who aren't familiar with the code have to simplify it first in order to understand it.&lt;/p&gt;

&lt;p&gt;Feathers has also found that code behind APIs tends to be especially messy – because some interfaces are too hard to change, programmers are forced to come up with their own workarounds behind the scenes. Martin Fowler explains how this problem is made worse by strong code ownership, which inhibits refactoring and makes the code more internally rigid:
&lt;blockquote&gt;
In strong code ownership, there's my code and your code. I can't change your code. If I want to change the name of one of my methods, and it's called by your code, I've got to get you to change the call into me before I can change my name. Or I've got to go through the whole deprecation business. Essentially any of my interfaces that you use become published in that situation, because I can't touch your code for any reason at all.
&lt;br&gt;&lt;br&gt;
There's an intermediate ground that I call weak code ownership. With weak code ownership, there's my code and your code, but it is accepted that I could go in and change your code. There's a sense that you're still responsible for the overall quality of your code. If I were just going to change a method name in my code, I'd just do it. But on the other hand, if I were going to move some responsibilities between classes, I should at least let you know what I'm going to do before I do it, because it's your code. That's different than the collective code ownership model.
&lt;br&gt;&lt;br&gt;
Weak code ownership and refactoring are OK. Collective code ownership and refactoring are OK. But strong code ownership and refactoring are a right pain in the butt, because a lot of the refactorings you want to make you can't make. You can't make the refactorings, because you can't go into the calling code and make the necessary updates there. That's why strong code ownership doesn't go well with refactoring, but weak code ownership works fine with refactoring.
&lt;br&gt;
(&lt;a href="http://www.artima.com/intv/principles4.html"&gt;Design Principles and Code Ownership&lt;/a&gt;)
&lt;/blockquote&gt;&lt;/p&gt;

&lt;h2&gt;Ownership, Technical Debt or Deepening Insight&lt;/h2&gt;

&lt;p&gt;An individual owner has a higher tolerance for complexity, because after all it’s their code and they know how it works and it’s not really that hard to understand (not for them at least) so they don’t need to constantly simplify it just to make a change or fix something. It's also easy for them to take short cuts, and even short cuts on short cuts. This can build up over time until you end up with a serious  &lt;a href="http://programmers.stackexchange.com/questions/85235/is-code-ownership-a-code-smell"&gt;technical debt problem&lt;/a&gt; – one person is always working on that code, not because the problem is highly specialized, but because the code has reached a point where nobody else but Scotty can understand it and make it work.&lt;/p&gt;


&lt;p&gt;There’s a flip side to spending more time on code too. The more time that you spend on the same problem, the deeper you can see into it. As you return to the same code again and again you can recognize patterns, and areas that you can improve, and compromises that you aren't willing to accept any more. As you learn more about the language and the frameworks, you can go back and put in simpler and safer ways of doing things. You can see what the design really should be, where the code needs to go, and take it there.  
&lt;blockquote&gt;There's also opportunity cost of not sticking to certain areas. Focusing on a problem allows you to create better solutions. Specifically, it allows you to create a vision of what needs to be done, work towards that vision and constantly revise where necessary...  If you're jumping from problem to problem, you're more likely to create an inferior solution. You'll solve problems, but you'll be creating higher maintenance costs for the project in the long term.
&lt;br&gt;Jay Fields  &lt;a href="http://java.dzone.com/articles/taking-second-look-collective"&gt;Taking a Second Look at Collective Code Ownership&lt;/a&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;So far I've found that the only way for a team to take on really big problems is by breaking the problems up and letting different people own different parts of the solution. This means taking on problems and costs in the short term and the long term, trading off quality and productivity against flexibility and consistency – not only flexibility and consistency in how the team works, but in the code itself.&lt;/p&gt;
&lt;p&gt;What I've also learned is that whether you have a team of people who each own a piece of the system, or a more open custodian environment, or even if everyone is working everywhere all of the time, you can’t let people do this work completely on their own.  It’s critical to have people working together, whether you are pairing in XP or doing regular egoless code reviews. To help people work on code that they’ve never seen before – or to help long-time owners recognize their blind spots. To mentor and to share new ideas and techniques. To keep people from falling into bad habits. To keep control over complexity. To reinforce consistency – across the code base or inside a piece of code.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/SWJlbZ47A7E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/561934723192758908/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=561934723192758908" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/561934723192758908?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/561934723192758908?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/SWJlbZ47A7E/what-does-code-ownership-do-to-code.html" title="What does Code Ownership do to Code?" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/04/what-does-code-ownership-do-to-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MGQXo-eSp7ImA9WhBVGU0.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-8153964096216488097</id><published>2013-04-25T10:03:00.002-07:00</published><updated>2013-04-25T10:03:40.451-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-25T10:03:40.451-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="agile" /><category scheme="http://www.blogger.com/atom/ns#" term="code ownership" /><category scheme="http://www.blogger.com/atom/ns#" term="refactoring" /><category scheme="http://www.blogger.com/atom/ns#" term="agile development" /><title>Code Ownership – Who Should Own the Code? </title><content type="html">&lt;p&gt;A key decision in building and managing any development team is agreeing on how ownership of the code will be divided up: who is going to work on what code; how much work can be, and should be, shared across the team; and who will be responsible for code quality. The approach that you take has immediate impact on the team’s performance and success, and a long-term impact on the shape and quality of the code.&lt;/p&gt;
&lt;p&gt;Martin Fowler describes &lt;a href="http://martinfowler.com/bliki/CodeOwnership.html"&gt;three different models for code ownership&lt;/a&gt; on a team:
&lt;ol&gt;
&lt;li&gt; &lt;a href="http://c2.com/cgi/wiki?CodeOwnership"&gt;Strong code ownership&lt;/a&gt; – every module is owned exclusively by someone, developers can only change the code that they own, and if they need to change somebody else’s code, they need to talk to that owner and get the owner’s agreement first – except maybe in emergencies.
&lt;br&gt;
&lt;br&gt;
&lt;li&gt;Weak code ownership – where modules are still assigned to owners, but developers are allowed to change code owned by other people. Owners are expected to keep an eye on any changes that other people make, and developers are expected to ask for permission first before making changes to somebody else’s code. 

&lt;br&gt;
&lt;br&gt;
This can be thought of as a shared custody model, where an individual is forced to share ownership of their code with others; or &lt;a href="http://c2.com/cgi/wiki?CodeStewardship"&gt;Code Stewardship&lt;/a&gt;, where the team owns all of the code, but one person is held responsible for the quality of specific code, and for helping other people make changes to it, reviewing and approving all major changes, or pairing up with other developers as necessary. &lt;a href="http://bradapp.blogspot.ca/2005/03/individual-vs-collective-code.html"&gt;Brad Appleton&lt;/a&gt; says the job of a code steward is not to make all of the changes to a piece of code, but to
“safeguard the integrity + consistency of that code (both conceptually and structurally) and to widely disseminate knowledge and expertise about it to others”.
&lt;br&gt;
&lt;br&gt;
&lt;li&gt;&lt;a href="http://www.extremeprogramming.org/rules/collective.html"&gt;Collective Code Ownership&lt;/a&gt; – the code base is owned or shared by the entire team, and everyone is free to make whatever changes they need – or want – to make, including refactoring or rewriting code that somebody else originally wrote. This is a model that came out of Extreme Programming, where the Whole Team is responsible together for the quality and integrity of the code and for understanding and keeping the design.
&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;

&lt;h2&gt;Arguments against Strong/Individual Code Ownership&lt;/h2&gt;

&lt;p&gt;Fowler and other XP advocates such as Kent Beck don’t like strong individual code ownership, because it creates artificial barriers and dependencies inside the team. Work will stall and pause if you need to wait for somebody to make or even approve a change, and one owner can often become the critical path for the entire team. This could encourage developers to come up with their own workarounds and compromises. For example, instead of changing an API properly (which would involve a change to somebody else’s code), they might shoe horn in a change, like stuffing something into an existing field. Or they might take a copy of somebody’s code and add whatever they need to it, making maintenance harder in the future.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.cmcrossroads.com/article/balancing-individual-versus-collective-code-ownership"&gt;Other arguments against strong ownership&lt;/a&gt; are that it can lead to defensiveness and protectionism on the part of some developers (“hey, don’t touch my code!”), where they take any criticism of the code as a personal attack, creating tension on the team and discouraging reviewers from offering feedback and discouraging refactoring efforts; and local over-optimization, if developers are given too much time to spend to polish and perfect their precious code without thinking of the bigger picture. &lt;p&gt;
&lt;p&gt;And of course there is the “&lt;a href="http://c2.com/cgi/wiki?TruckNumber"&gt;hit by a truck factor&lt;/a&gt;” to consider – the impact that a person leaving the team will have on productivity if they’re the only one who works on a piece of code.&lt;/p&gt;

&lt;p&gt;Ward Cunningham. one of the original XPers, also believes that &lt;a href="http://www.artima.com/intv/ownership2.html"&gt;there is more pride of ownership when code is shared&lt;/a&gt;, because everyone’s work is always on display to everyone else on the team.&lt;/p&gt;

&lt;h2&gt;Arguments against Collective Code Ownership&lt;/h2&gt;
&lt;p&gt;But there are also arguments against Collective Code Ownership. &lt;a href="http://www.jroller.com/pyrasun/entry/artima_article_on_collective_code"&gt;A post by Mike Spille&lt;/a&gt; lists some problems that he has seen when teams try to “over-share” code:
&lt;ul&gt;
&lt;li&gt;
Inconsistency. No overriding architecture is discernible, just individual solutions to individual problems. Lots of duplication of effort results, often leading to inconsistent behavior
&lt;li&gt;
Bugs. People "refactoring" code they don't really understand break something subtle in the original code.
&lt;li&gt;
Constant rounds of "The Blame Game". People have a knee jerk reaction to bugs, saying "It worked when I wrote it, but since Joe refactored it....well, that's his problem now.".
&lt;li&gt;
Slow delivery. Nobody has any expertise in any given domain, so people are spending more time trying to understand other people's code, less time writing new code.
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;Matthias Friedrich, in &lt;a href="http://blog.mafr.de/2008/05/15/collective-code-ownership/"&gt;Thoughts on Collective Code Ownership&lt;/a&gt; believes that Collective Code Ownership can only work if you have the right conditions in place:
&lt;ul&gt;
&lt;li&gt;
Team members are all on a similar skill level
&lt;li&gt;
Programmers work carefully and trust each other
&lt;li&gt;
The code base is in a good state
&lt;li&gt;
Unit tests are in place to detect problematic changes (although unit tests only go so far)
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;Remember that Collective Code Ownership came out of Extreme Programming. Successful team ownership depends on everyone sharing an understanding of the domain and the design, and maintaining a high-level of technical discipline: not only writing really good automated tests as a safety net, but everyone following consistent code conventions and standards across the code base, and working in pairs because hopefully one of you knows the code, or at least with two heads you can try to help each other understand it and make fewer mistakes.&lt;/p&gt;
&lt;p&gt;Another problem with Collective Code Ownership is that ownership is spread so thin. Justin Hewlett talks about the &lt;a href="http://bit-builder.blogspot.ca/2012/12/code-ownership.html"&gt;Tragedy of the Commons&lt;/a&gt; problem: people will take care of their own yard, but how many people will pick up somebody else’s litter in the park, or on a street - even if they walk in that park or down that street everyday? If the code belongs to everyone, then there is always “someone else” who can take care of it – whoever that “someone else” may be. As a developer, you’re under pressure, and you may never touch this piece of code again, so why not get whatever you need to do as quickly as possible and get on to the next thing on your list, and let "somebody else" worry about refactoring or writing that extra unit test or...?&lt;/p&gt;

&lt;h2&gt;Code Ownership in the Real World&lt;/h2&gt;

&lt;p&gt;I've always worked on or with teams that follow individual (strong or weak) code ownership, except for an experiment in pure XP and Collective Code Ownership on one team over 10 years ago. One (or maybe two) people own different pieces of the code and do all or most of the heavy lifting work on that code. Because it only makes sense to have the people who understand the code best do most of the work, or the most important work. It’s not just because you want the work “done right” – sometimes you don’t really have a choice over who is going to do the work.&lt;/p&gt;

&lt;p&gt;As &lt;a href="http://weblogs.asp.net/ralfw/archive/2006/04/01/441639.aspx"&gt;Ralf Sudelbucher points out&lt;/a&gt;, Collective Code ownership assumes that all coding work is interchangeable within a team, which is not always true. &lt;/p&gt;
&lt;p&gt;Some work isn't interchangeable because of technology: different parts of a system can be written in different languages, with different architectures. You have to learn the language and the framework before you can start to understand the other problems that need to be solved.&lt;/p&gt;
&lt;p&gt;Or it might be because of the problem space. Sure, there is always coding on any project that is “&lt;a href="http://www.codinghorror.com/blog/2008/11/we-are-typists-first-programmers-second.html"&gt;just typing&lt;/a&gt;”: journeyman work that is well understood, like scaffolding work or writing another web form or another CRUD screen or fixing up a report or converting a file format, work that has to be done and can be taken on by anyone who has been on the team for a while and who understands where to find stuff and how things are done – or who pairs up with somebody who knows this.&lt;/p&gt;
&lt;p&gt;But other software development involves solving hard domain problems and technical problems that require a lot of time to understand properly – where it can take days, weeks, months or sometimes even years to immerse yourself in the problem space well enough to know what to do, where anyone can’t just jump in and start coding, or even be of much help in a pair programming situation.&lt;/p&gt;

&lt;blockquote&gt;The worst disasters occur when you turn loose sorcerers' apprentices on code they don't understand. In a typical project, not everyone can know everything - except in some mature domains where there have been few business paradigm shifts in the past decade or two.
&lt;br&gt;
Jim Coplien, &lt;a href="http://c2.com/cgi/wiki?CodeOwnership"&gt;Code Ownership&lt;/a&gt;
&lt;/blockquote&gt;

&lt;p&gt;I met someone who manages software development for a major computer animation studio. His team has a couple of expert developers who did their PHDs and post grad work in animating hair – that’s all that they do, and even if you are really smart you’ll need years of study and experience just to understand how they do what they do. &lt;/p&gt;

&lt;p&gt;Lots of scientific and technical engineering domains are also like this – maybe not so deeply specialized, but they involve non-trivial work that can’t be easily or competently done by generalists, even competent generalists. Programming medical devices or avionics or robotics or weapons control; or any business domain where you are working at the leading edge of problem solving, applying advanced statistical models to big data analysis or financial trading algorithms or risk-management models; or supercomputing and high-scale computing and &lt;a href="http://developers.slashdot.org/story/11/05/27/1831251/what-makes-parallel-programming-difficult"&gt;parallel programming&lt;/a&gt;,
or writing an operating system kernel or solving cryptography problems or doing a really good job of User Experience (UX) design. Not everyone understands the problems that need to be solved, not everyone cares about the problems and not everyone can do a good job of solving them.&lt;/p&gt;

&lt;h2&gt;Ownership and Doing it Right&lt;/h2&gt;

&lt;p&gt;If you want the work done right, or need it to be done right the first time, it should be done by someone who has worked on the code before, who knows it and who has proven that they can get the job done. Not somebody who has only a superficial familiarity with the code. &lt;a href="http://research.microsoft.com/pubs/150498/bird2011dtm.pdf"&gt;Research work by Microsoft&lt;/a&gt; and others have shown that as more people touch the same piece of code, there is more chance of misunderstandings and mistakes – and that the people who have done the most work on a piece of code are the ones who make the fewest mistakes.&lt;/p&gt;

&lt;p&gt;Fowler comes back to this in a later post about “&lt;a href="http://martinfowler.com/bliki/ShiftingToCodeOwnership.html"&gt;Shifting to Code Ownership&lt;/a&gt;” where he shares a story from a colleague who shifted a team from collective code ownership to weak individual code ownership because weaker or less experienced programmers were making mistakes in core parts of the code and impacting quality, velocity and the team’s morale. They changed their ownership model so anyone could work around the code base, but if they needed to change core code, they had to do this with the help of someone who knew that part of the code well.&lt;/p&gt;


&lt;p&gt;In deciding on an an ownership approach, you have to make a trade-off between flexibility and quality, team ownership and individual ownership. With individual ownership you can have siloing problems and dependencies on critical people, and you’ll have to watch out for trucks. But you can get more done, faster, better and by fewer people.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/aIwWRF5agu0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/8153964096216488097/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=8153964096216488097" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/8153964096216488097?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/8153964096216488097?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/aIwWRF5agu0/code-ownership-who-should-own-code.html" title="Code Ownership – Who Should Own the Code? " /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>7</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/04/code-ownership-who-should-own-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUARnoyfip7ImA9WhBVE00.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-1172818217778807958</id><published>2013-04-18T08:50:00.002-07:00</published><updated>2013-04-18T08:50:47.496-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-18T08:50:47.496-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="bugs" /><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><category scheme="http://www.blogger.com/atom/ns#" term="Disciplined Agile Delivery" /><category scheme="http://www.blogger.com/atom/ns#" term="architecture" /><category scheme="http://www.blogger.com/atom/ns#" term="Spiral" /><category scheme="http://www.blogger.com/atom/ns#" term="failure" /><title>Architecture-Breaking Bugs – when a Dreamliner becomes a Nightmare</title><content type="html">&lt;p&gt;The history of computer systems is also the history of bugs, including &lt;a href="http://www.computerworld.com/s/article/9183580/Epic_failures_11_infamous_software_bugs"&gt;epic, disastrous bugs&lt;/a&gt; that have caused millions of $ in damage and &lt;a href="http://www.wired.com/software/coolapps/news/2005/11/69355?currentPage=all"&gt;destruction and even death&lt;/a&gt;, as well as many other less spectacular but expensive system and project failures. Some of these appear to be small and stupid mistakes, like the infamous &lt;a href="http://www.around.com/ariane.html"&gt;Ariane 5 rocket crash&lt;/a&gt;, caused by a one-line programming error. But a one-line programming error, or any other isolated mistake or failure, cannot cause serious damage to a large system, without fundamental failures in architecture and design, and failures in management.&lt;/p&gt;

&lt;blockquote&gt;&lt;a href="http://www.economist.com/blogs/gulliver/2013/02/boeings-787-dreamliner"&gt;Boeing's 787 Dreamliner Going Nowhere&lt;/a&gt;
&lt;br&gt;
The Economist, Feb 26 2013&lt;/blockquote&gt;


&lt;p&gt;These kinds of problems are what Barry Boehm calls “&lt;a href="http://books.google.com/books?id=C6DDzaAuI48C&amp;pg=PA86&amp;lpg=PA86&amp;dq=architecture-breakers&amp;source=bl&amp;ots=3V1YlIdHc_&amp;sig=sbhj8mmDylJ2z3VEfIaDhFLnJzw&amp;hl=en&amp;sa=X&amp;ei=c1syUMfsB6-26QGEuYGQBw&amp;ved=0CDQQ6AEwAA#v=onepage&amp;q=architecture-breakers&amp;f=false"&gt;Architecture Breakers&lt;/a&gt;”: where a system’s design doesn't hold up in the real world, when you run face-first into a fundamental weakness or a hard limit on what is possible with the approach that you took or the technology platform that you selected. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.umd.edu/~mvz/pub/eworkshop02.pdf"&gt;Architecture Breakers&lt;/a&gt; happen at the edges – or beyond the edges – of the design, off of the normal, nominal, &lt;a href="http://en.wikipedia.org/wiki/Happy_path"&gt;happy paths&lt;/a&gt;. The system works, except for a “one in a million” exceptional error, which nobody takes seriously until a “once in a million” problem starts happening every few days. Or the system crumples under an unexpected surge in demand, demand that isn't going to go away unless you can’t find a way to quickly scale the system to keep up – and if you can’t, you won’t have a demand problem any more because those customers won’t be coming back. Or what looks like a minor operational problem turns out to be the first sign of a fundamental reliability or safety problem in the system.&lt;/p&gt;

&lt;blockquote&gt;&lt;a href="http://www.nytimes.com/2013/01/10/business/global/safety-of-boeing-787-dreamliner-called-into-question.html"&gt;Dreamliner is Troubled by Questions about Safety&lt;/a&gt;
&lt;br&gt;
NY Times, Jan 10, 2013&lt;/blockquote&gt;

&lt;h2&gt;Finding Architecture Breakers&lt;/h2&gt;

&lt;p&gt;It starts off with a nasty bug or an isolated operational issue or a security incident. As you investigate and start to look deeper you find more cases, gaping holes in the design, hard limits to what the system can do, or failures that can’t be explained and can’t be stopped. The design starts to unravel as each problem opens up to another problem. Fixing it right is going to take time and money, maybe even going back to the drawing board and revisiting foundational architectural decisions and technology choices. What looked like a random failure or an ugly bug just turned into something much uglier, and much much more expensive.&lt;/p&gt;

&lt;blockquote&gt;&lt;a href="http://www.nytimes.com/2013/01/17/business/global/deepening-crisis-for-the-dreamliner.html"&gt;Deepening Crisis for the Boeing 787&lt;/a&gt;
&lt;br&gt;
NY Times, Jan 17 2013&lt;/blockquote&gt;


&lt;p&gt;What makes these problems especially bad is that they are found late, way past design and even past acceptance testing, usually when the system is already in production and you have a lot of real customers using it to get real work done. This is when you can least afford to encounter a serious problem. When something does go wrong, it can be difficult to recognize how serious it is right away. It can take two or three or more failures before you realize – and accept – how bad things really are and before you see enough of a pattern to understand where the problem might be. &lt;/p&gt;

&lt;blockquote&gt;&lt;a href="http://www.bloomberg.com/news/2013-01-29/ntsb-testing-787-battery-particles-for-clues-in-japan-air-fire.html"&gt;Boeing Batteries Said to Fail 10 Times Before Incident&lt;/a&gt;
&lt;br&gt;
Bloomberg, Jan 30 2013&lt;/blockquote&gt;


&lt;p&gt;By then you may be losing customers and losing money and you’re under extreme pressure to come up with a fix, and nobody wants to hear that you have to stop and go back and rewrite a piece of the system, or re-architect it and start again – or that you need more time to think and test and understand what’s wrong and what your options are before you can even tell them how long it might take and how much it could cost to fix things.&lt;/p&gt;

&lt;blockquote&gt;&lt;a href="http://www.nytimes.com/2013/01/18/business/regulators-around-the-globe-ground-boeing-787s.html"&gt;Regulators Around the Globe Ground Boeing 787s&lt;/a&gt;
&lt;br&gt;
NY Times, Jan 18 2013&lt;/blockquote&gt;



&lt;h2&gt;What can Break your Architecture?&lt;/h2&gt;

&lt;p&gt;Most Architecture Breakers are fundamental problems in important non-functional aspects of a system: 
&lt;ul&gt;
&lt;li&gt;
Stability and data integrity: some piece of the system won’t stay up under load or fails intermittently after the system has been running for hours or days or weeks, or you lost critical customer data or you can’t recover and restore service fast enough after an operational failure.
&lt;li&gt;
Scalability and throughput: the platform (language or container or communications fabric or database – or all of them) are beautiful to work with, but can’t keep up as more customers come in, even if you throw more hardware at it. Ask &lt;a href="http://readwrite.com/2011/04/11/twitter-drops-ruby-for-java"&gt;Twitter about trying to scale-out Ruby&lt;/a&gt; or &lt;a href="http://www.computerworld.com/s/article/9222557/Facebook_releases_a_PHP_just_in_time_compiler"&gt;Facebook about scaling PHP&lt;/a&gt; or anyone who has ever tried to scale-out Oracle RAC.
&lt;li&gt;
Latency – requirements for real-time response-time/deadline satisfaction escalate, or you run into unacceptable jitter and variability (you chose Java as your run-time platform, what happens when GC kicks in?).
&lt;li&gt;
Security: you just got hacked and you find out that the one bug that an attacker exploited is only the first of hundreds or thousands of bugs that will need to be found and fixed, because your design or the language and the framework that you picked (or the way that you used it) is as full of security holes as Swiss cheese.
&lt;/ul&gt;

These problems can come from misunderstanding what an underlying platform technology or framework can actually do – what the design tolerances for that architecture or technology are. Or from completely missing, overlooking, ignoring or misunderstanding an important aspect of the design.&lt;/p&gt;

&lt;p&gt;These aren’t problems that you can code your way out of, at least not easily. Sometimes the problem isn't in your code any ways: it’s in a third party platform technology that can’t keep up or won’t stay up. The language itself, or an important part of the stack like the container, database, or communications fabric, or whatever you are depending on for clustering and failover or to do some other magic. At high scale in the real world, almost any piece of software that somebody else wrote can and will fall short of what you really need, or what the vendor promised. &lt;/p&gt;

&lt;blockquote&gt;&lt;a href="http://online.wsj.com/article/SB10001424127887323293704578330480004073900.html"&gt;Boeing, 787 Battery Supplier at Odds over Fixes&lt;/a&gt;
&lt;br&gt;
Wall Street Journal, Feb 27 2013&lt;/blockquote&gt;

&lt;p&gt;You’ll have to spend time working with a vendor (or sometimes with more than one vendor) and help them understand your problem, and get them to agree that it’s really their problem, and that they have to fix it, and if they can’t fix it, or can’t fix it quickly enough, you’ll need to come up with a Plan B quickly, and hope that your new choice won’t run into other problems that may be just as bad or even worse.&lt;/p&gt;


&lt;h2&gt;How to Avoid Architecture Breakers&lt;/h2&gt;

&lt;p&gt;Architecture Breakers are caused by decisions that you made early and got wrong – or that you didn't make early enough, or didn't make at all. Boehm &lt;a href="http://www.amazon.com/Balancing-Agility-Discipline-Guide-Perplexed/dp/0321186125"&gt;talks about Architecture Breakers&lt;/a&gt; as part of an argument against &lt;a href="http://martinfowler.com/articles/designDead.html"&gt;Simple Design&lt;/a&gt; – that many teams, &lt;a href="http://guide.agilealliance.org/guide/yagni.html"&gt;especially Agile teams&lt;/a&gt;, spend too much time &lt;a href="http://effectivecio.com/2009/11/02/the-happy-path/"&gt;focused on the happy path&lt;/a&gt;, building new features to make the customer happy, and not enough time on upfront architecture and thinking about what could go wrong. But Architecture Breakers have been around a lot longer than Agile and simple design: in &lt;a href="http://shop.oreilly.com/product/9780596808303.do"&gt;Making Software&lt;/a&gt; (Chapter 10 Architecting: How Much and When), Boehm goes back to the 1980s when he first recognized these kinds of problems, when Structured Programming and later Waterfall were the “right way” to do things.&lt;/p&gt;

&lt;p&gt;Boehm’s solution is more and better architecture definition and technical risk management through &lt;a href="http://en.wikipedia.org/wiki/Spiral_model"&gt;Spiral software development&lt;/a&gt;: a lifecycle with architecture upfront to identify risk areas, which are then explored through iterative, risk-driven design, prototyping and development in multiple stages. Spiral development is &lt;a href="http://stackoverflow.com/questions/253789/agile-vs-spiral-model-for-sdlc"&gt;like today’s iterative, incremental development methods&lt;/a&gt; on steroids, using &lt;a href="http://www.agile-architecting.com/Articles/Architecture%20Spikes.pdf"&gt;risk-based architectural spikes&lt;/a&gt;, but with much longer iterative development and technical prototyping cycles, more formal risk management, more planning, more paperwork, and much higher costs. &lt;/p&gt;

&lt;p&gt;Bugs like these can’t all be solved by spending more time on architecture and technical risk management upfront – whether through Spiral development or a beefed up, &lt;a href="http://disciplinedagiledelivery.com/"&gt;disciplined Agile development&lt;/a&gt;
approach. More time spent upfront won`t help if you make naïve assumptions about scalability, responsiveness or reliability or security; or if you don’t understand these problems well enough to identify the risks. Architecture Breakers won’t be found in design reviews – because you won’t be looking for something that you don’t know could a problem – unless maybe you are running through structured failure modelling exercises like &lt;a href="http://en.wikipedia.org/wiki/Failure_mode_and_effects_analysis"&gt;FMEA (Failure mode and effect analysis)&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Failure_mode,_effects,_and_criticality_analysis"&gt;FMECA (Failure mode, effects and criticality analysis)&lt;/a&gt;, which force you to ask hard questions, but which few people outside of regulated industries have even heard about.&lt;/p&gt;

&lt;p&gt;And Architecture Breakers &lt;a href="http://www.faa.gov/news/press_releases/news_story.cfm?newsId=13064"&gt;can't all be caught in testing&lt;/a&gt;, even extended &lt;a href="http://www.stickyminds.com/BetterSoftware/magazine.asp?fn=cifea&amp;id=121"&gt;longevity/soak testing&lt;/a&gt; and extensive &lt;a href="http://www.ibm.com/developerworks/java/library/j-fuzztest/index.html"&gt;fuzzing&lt;/a&gt; and simulated failures and fault injection and destructive testing and stress testing – even if all the bugs that are found this way are taken seriously (because these kinds of extreme tests are often considered unrealistic).&lt;/p&gt;

&lt;p&gt;You have to be prepared to deal with Architecture Breakers. Anticipating problems and partitioning your architecture using something like the &lt;a href="http://www.infoq.com/interviews/Building-Resilient-Systems-Michael-Nygard"&gt;Stability Patterns&lt;/a&gt; in Michael Nygard’s excellent book &lt;a href="http://pragprog.com/book/mnee/release-it"&gt;Release It!&lt;/a&gt; will at least keep serious run-time errors from spreading and taking an entire system out (these strategies will also help with scaling and with containing security attacks). And if and when you do see a “once in a million” error in reviews or testing or production, understand how serious it can be, and act right away – before a Dreamliner turns into a nightmare.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/Ggn730MCWKQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/1172818217778807958/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=1172818217778807958" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1172818217778807958?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1172818217778807958?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/Ggn730MCWKQ/architecture-breaking-bugs-when.html" title="Architecture-Breaking Bugs – when a Dreamliner becomes a Nightmare" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/04/architecture-breaking-bugs-when.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIHQn89fip7ImA9WhBWF0w.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-7485939323597303206</id><published>2013-04-11T13:52:00.000-07:00</published><updated>2013-04-11T13:52:13.166-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-11T13:52:13.166-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Injectoin" /><category scheme="http://www.blogger.com/atom/ns#" term="appsec" /><title>Software Security Status Quo?</title><content type="html">&lt;p&gt;&lt;a href="http://www.veracode.com/"&gt;Veracode&lt;/a&gt; has released the company’s &lt;a href="http://info.veracode.com/state-of-software-security-report-volume5.html"&gt;State of Software Security Report for 2012&lt;/a&gt;, the 5th in a series of annual reports that analyzes data collected from customers using Veracode’s cloud-based application security scanning services.&lt;/p&gt;

&lt;h2&gt;The Important Numbers&lt;/h2&gt;

&lt;p&gt;As Veracode’s data set continues to get bigger, with more customers and more apps getting scanned, the results get more interesting.&lt;/p&gt;
&lt;p&gt;For Web apps, the state of vulnerabilities remains unchanged over the past 18 months: 
&lt;ul&gt;
&lt;li&gt;
1/3 of apps remain vulnerable to SQL Injection
&lt;/li&gt;
&lt;li&gt;
2/3 of apps remain vulnerable to XSS, and at least half of all vulnerabilities found in scanning are XSS vulnerabilities
&lt;/li&gt;
&lt;/ul&gt;
Over the last 3 years, there are no significant changes in the occurrence of different vulnerabilities that cannot be accounted for by changes and improvements in Veracode's technology or testing methods.&lt;/p&gt;

&lt;p&gt;For mobile platforms (Android, iOS and Java ME), the most common vulnerabilities found are related to crypto: 64% of Android apps, 58% of iOS apps, and 47% of Java ME apps have crypto vulnerabilities. Outside of crypto, the vulnerability distributions for the different mobile platforms are quite different. It’s possible that these differences are due to fundamental strengths and weaknesses of each platform (different architectures, different APIs and default capabilities provided), but I think that it is still too early to draw meaningful conclusions from this data, as the size of the data set is still very small (although it continues to increase in size, from 1% of the total sample to 3% over the last 18 months).&lt;/p&gt;

&lt;h2&gt;But Security Vulnerabilities are Getting Fixed, Right?&lt;/h2&gt;
&lt;p&gt;Some interesting data on remediation, based on Veracode customers resubmitting the same code base for subsequent scans. Almost half of their customers resubmit all or almost all of their apps for re-scanning, regardless of how critical the app is considered to the customer’s business. What’s interesting is which vulnerabilities people chose to fix - bugs that are found in the first scan, but don’t show up later. &lt;/p&gt;
&lt;p&gt;For Java, the bugs that are most often fixed are: 
&lt;ol&gt;
&lt;li&gt;
Untrusted search path
&lt;/li&gt;
&lt;li&gt;
CRLF injection
&lt;/li&gt;
&lt;li&gt;
Untrusted initialization
&lt;/li&gt;
&lt;li&gt;
Session fixation
&lt;/li&gt;
&lt;li&gt;
Dangerous function
&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;So the first bugs to be fixed seem to be the easiest ones for developers to understand and take care of – low hanging fruit. Remediation decisions don’t seem to be based on risk, but on “let’s see what we can fix now and get the security guys off of our backs”. Security bugs are getting fixed, but it’s clear that SQL Injection and XSS bugs aren’t getting fixed fast enough, because there too many of these vulnerabilities to fix, and because many developers still don’t understand these problems well enough to fix them or prevent them in the first place. PHP developers are much more likely to remediate SQL injection vulnerabilities than Java or .NET developers, but it’s not clear why.&lt;/p&gt;

&lt;h2&gt;The Art and Science of Predictions&lt;/h2&gt;
&lt;p&gt;The report results were presented today in a webinar titled “We See the Future … and it’s Not Pretty”, which walked through the data and the predictions that Veracode drew from the data. While the findings seem sound, the predictions are less so: for example, that there will be higher turnover in security jobs (including CISO positions) because appsec programs are not proving effective, and security staff will give up – or get fired – as a result. I can’t see the thread that leads from the data to these conclusions. The authors should read (or re-read) &lt;a href="http://www.amazon.com/dp/159420411X"&gt;The Signal and the Noise&lt;/a&gt; to understand what should go into a high-quality prediction, and what people should try to predict and what they shouldn't.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/phhG9n7M8Wg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/7485939323597303206/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=7485939323597303206" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7485939323597303206?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7485939323597303206?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/phhG9n7M8Wg/software-security-status-quo.html" title="Software Security Status Quo?" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/04/software-security-status-quo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMCR3k5eCp7ImA9WhBWFU8.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-1769993494380851790</id><published>2013-04-09T10:11:00.002-07:00</published><updated>2013-04-09T10:11:06.720-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-09T10:11:06.720-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pen testing" /><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="appsec" /><title>Penetration Testing Shouldn't be a Waste of Time</title><content type="html">&lt;p&gt;In a recent post on “&lt;a href="http://blog.sdelements.com/is-penetration-testing-a-waste-of-time/"&gt;Debunking Myths: Penetration Testing is a Waste of Time&lt;/a&gt;”, Rohit Sethi looks at some of the disadvantages of the passive and irresponsible way that application pen testing is generally done today: wait until the system is ready to go live, hire an outside firm or consultant, give them a short time to try to hack in, fix anything important that they find, maybe retest to get a passing grade, and now your system is 'certified secure'. &lt;/p&gt;
&lt;p&gt;A test like this “doesn't tell you:
&lt;ul&gt;&lt;li&gt;What are the potential threats to your application?&lt;/li&gt;
&lt;li&gt;Which threats is your application “not vulnerable” to?&lt;/li&gt;
&lt;li&gt;Which threats did the testers not assess your application for? Which threats were not possible to test from a runtime perspective?&lt;/li&gt;
&lt;li&gt;How did time and other constraints on the test affect the reliability of results? For example, if the testers had 5 more days, what other security tests would they have executed?&lt;/li&gt;
&lt;li&gt;What was the skill level of the testers and would you get the same set of results from a different tester or another consultancy?”&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;Sethi stresses the importance of setting expectations and defining requirements for pen testing. An outside pen tester will not be able to understand your business requirements or the internals of the system well enough to do a comprehensive job – unless maybe if your app is yet another straightforward online portal or web store written in PHP or Ruby on Rails, something that they have seen many times before. &lt;/p&gt;

&lt;p&gt;You should assume that pen testers will miss something, possibly a lot, and there’s no way of knowing what they didn't test or how good a job they actually did on what they did test. You could try &lt;a href="http://c2.com/cgi/wiki?DefectSeeding"&gt;defect seeding&lt;/a&gt; to get some idea of how careful and smart they were (and how many bugs they didn’t find), but this assumes that you know an awful lot about your system and about security and security testing (and if you’re this good, you probably don’t need their help). Turning on &lt;a href="http://swreflections.blogspot.com/2012/05/pursuit-of-protection-how-much-testing.html"&gt;code coverage analysis&lt;/a&gt; during the test will tell you what parts of the code didn't get touched – but it won’t help you identify the code that you didn't write but should have, which is often a bigger problem when it comes to security.&lt;/p&gt;

&lt;p&gt;You can’t expect a pen tester to find all of the security vulnerabilities in your system – even if you are willing to spend a lot of time and money on it. But pen tests are important because this is a way to find things that are hard for you to find on your own:&lt;ol&gt;
&lt;li&gt;
Technology-specific and platform-specific vulnerabilities 
&lt;/li&gt;
&lt;li&gt;
Configuration and deployment mistakes in the run-time environment
&lt;/li&gt;
&lt;li&gt;
Pointy-Hat problems in areas like authentication and session management that should have been taken care of by the framework that you are using, if it works and if you are using it properly
&lt;/li&gt;
&lt;li&gt;
Fussy problems in information leakage, object enumeration and error handling – problems that look small to you but can be exploited by an intelligent and motivated attacker with time on their side
&lt;/li&gt;
&lt;li&gt;
Mistakes in data validation or output encoding and filtering, that look small to you but…
&lt;/li&gt;
&lt;/ol&gt;
And if you’re lucky, some other problems that you should have caught on your own but didn’t, like weaknesses in workflow or access control or password management or a race condition.&lt;/p&gt;


&lt;h2&gt;Pen testing is about information, not about vulnerabilities&lt;/h2&gt;

The &lt;a href="http://software-security.sans.org/blog/2012/03/28/whats-the-point-of-application-pen-testing/"&gt;real point of pen testing&lt;/a&gt;, or any other kind of testing, is not to find all of the bugs in a system. It is &lt;a href="http://swreflections.blogspot.ca/2012/04/you-dont-need-testers-or-do-you.html"&gt;to get information&lt;/a&gt;.
&lt;ol&gt;&lt;li&gt;
Information on &lt;b&gt;examples&lt;/b&gt; of bugs in the application that need to be reviewed and fixed, how they were found, and how serious they are.
&lt;/li&gt;
&lt;li&gt;
Information that you can use to calibrate your development practices and controls, to understand just how good (or not good) you are at building software. 
&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;

&lt;blockquote&gt;Testing doesn't provide all possible information, but it provides some. Good testing will provide lots of useful information.
&lt;a href="http://www.satisfice.com/blog/archives/236"&gt;James Bach (Satisfice)&lt;/a&gt;&lt;/blockquote&gt;

&lt;p&gt;This information leads to questions: How many other bugs like this could there be in the code? Where else should we look for bugs, and what other kinds of bugs or weaknesses could there be in the code or the design? Where did these bugs come from in the first place? Why did we make that mistake? What didn't we know or what didn't we understand? Why didn't we catch the problems earlier? What do we need to do to prevent them or to catch them in the future? If the bugs are serious enough, or there are enough of them, this means going all the way &lt;a href="http://swreflections.blogspot.com/2011/06/moving-forward-from-failure.html"&gt;through RCA&lt;/a&gt; and exercises like &lt;a href="http://www.isixsigma.com/tools-templates/cause-effect/determine-root-cause-5-whys/"&gt;5 Whys&lt;/a&gt; to understand and address Root Cause.&lt;/p&gt;

&lt;p&gt;To get high-quality information, you need to share information with pen testers. Give the pen tester as much information as possible
&lt;ul&gt;
&lt;li&gt;Walk through the app with pen testers, hilight the important functions, and provide documentation&lt;/li&gt;
&lt;li&gt;Take time to explain the architecture and platform&lt;/li&gt;
&lt;li&gt;Share results of previous pen tests&lt;/li&gt;
&lt;li&gt;Provide access behind proxies etc&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;Ask them for information in return: ask them to explain their findings as well as their approach, what they tried and what they covered in their tests and what they didn't, where they spent most of their time, what problems they ran into and where they wasted time, what confused them and what surprised them. Information that you can use to improve your own testing, and to make pen testing more efficient and more effective in the future.&lt;/p&gt;

&lt;p&gt;When you’re hiring a pen tester, you’re paying for information. But it’s your responsibility to get as much good information as possible, to understand it and to use it properly.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/AZtlev272eA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/1769993494380851790/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=1769993494380851790" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1769993494380851790?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1769993494380851790?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/AZtlev272eA/penetration-testing-shouldnt-be-waste.html" title="Penetration Testing Shouldn't be a Waste of Time" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/04/penetration-testing-shouldnt-be-waste.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYNRHo9cCp7ImA9WhBWEEQ.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-489015444071091617</id><published>2013-04-04T08:43:00.001-07:00</published><updated>2013-04-04T08:43:15.468-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-04T08:43:15.468-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="devops" /><category scheme="http://www.blogger.com/atom/ns#" term="metrics" /><title>How do you measure Devops?</title><content type="html">&lt;p&gt;If you’re trying to convince yourself (or the team or management) that your operations program needs to be changed for the better, and that trying a Devops approach makes sense – or that your operations organization is improving, and that whatever changes you have made actually make a difference – you have to measure something(s). But what?&lt;/p&gt;

&lt;h2&gt;Measuring Culture&lt;/h2&gt;


&lt;p&gt;John Clapham at Nokia suggests that you should try to measure &lt;a href="http://vimeo.com/album/2312414/video/62680746"&gt;how healthy your operations culture&lt;/a&gt; is. At the &lt;a href="http://devopsdays.org/"&gt;Devops Days conference this year in London&lt;/a&gt; he talked about ways to measure and monitor culture – behaviour, attitudes and values –  to determine whether people were focused on the “right things”, and to assess the team’s motivation and satisfaction. Nokia had already started a Devops program, and wanted to see whether the momentum for change and improvement was still there after the initial push and evangelism had worn off. So they came up with a set of vital signs that they felt would capture the important behaviours and attitudes:
&lt;ol&gt;&lt;li&gt;Cycle time – time from development to deployment in production. Are we moving faster, or fast enough?&lt;/li&gt;
&lt;li&gt;Shared purpose – do people all share/believe in the same goals, believe in improving how development and ops work together?&lt;/li&gt;
&lt;li&gt;Motivation – does everyone care about what they are doing?&lt;/li&gt;
&lt;li&gt;Collaboration – are people working together willingly?&lt;/li&gt;
&lt;li&gt;Effectiveness – is everyone’s time being spent in a useful way? How much time is being wasted?&lt;/li&gt;&lt;/ol&gt;
Cycle time is the only measure that is relatively easy to measure and report. The rest are highly subjective and fuzzy. Nokia tried to collect this information through a questionnaire that asked questions like: Do you believe there are opportunities to improve ways of working? How much time do you spend on stability, overhead, improvements, innovation? What’s in your way: lack of time, pressure to focus on features, poor tools, lack of management support, nothing…?&lt;/p&gt;

&lt;h2&gt;Operations Vital Signs that you Can and Should Measure&lt;/h2&gt;

&lt;p&gt;Clapham’s closing question was: “What vital signs would you look for?”&lt;/p&gt;
&lt;p&gt;I'm not convinced that you can measure an &lt;a href="https://solutions.mckinsey.com/catalog/ohi.html"&gt;organization’s cultural effectiveness&lt;/a&gt;, or that it would be really useful if you could. You can’t tell from a wishy-washy questionnaire whether change is making a real difference to the organization’s effectiveness and you are on the right track; or help you understand what you need to change and what the impact of change would be on the bottom line (or the top line). To do this you need concrete and results-based measurements which point out strong points and weaknesses, and that you can use to make a case for change, or justify your decisions. &lt;/p&gt;

&lt;p&gt;Puppet Labs and IT Revolution Press have recently published a “&lt;a href="http://info.puppetlabs.com/2013-state-of-devops-report.html"&gt;State of Devops Report&lt;/a&gt;”, which is full of interesting data. The report stresses the importance of metrics in understanding how your organization is performing and why a Devops program is, or would be, worthwhile. They provide a list of objective measures, broken down into two major types.&lt;/p&gt;
&lt;p&gt;Agility and reliability metrics:
&lt;ol&gt;&lt;li&gt;Deployment rate/frequency&lt;/li&gt;
&lt;li&gt;Change lead time – how long it takes to get a change approved and into production&lt;/li&gt;
&lt;li&gt;Change failure rate (John Allspaw's brilliant presentation “&lt;a href="http://www.kitchensoap.com/2010/06/24/ops-meta-metrics-velocity-2010-slides/"&gt;Ops Meta-Metrics&lt;/a&gt;” explains the importance of correlating deployment frequency/size/type and failures – type and severity – in production)
&lt;/li&gt;
&lt;li&gt;Mean time to recover (and mean time to detect)&lt;/li&gt;&lt;/ol&gt;
Functional metrics:
&lt;ol&gt;&lt;li&gt;Test cycle time – how long does it take to test a change?&lt;/li&gt;
&lt;li&gt;Deployment time – how long does it take to roll out a new change once tested and approved?&lt;/li&gt;
&lt;li&gt;Defect rate in production (defect escape rate)&lt;/li&gt;
&lt;li&gt;Helpdesk ticket counts – how much time is spent firefighting?&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;There are two other important measures that are missing from this list:
&lt;ol&gt;&lt;li&gt;Operations costs&lt;/li&gt;
&lt;li&gt;Employee retention – a key measure of whether people are happy&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;
&lt;p&gt;Measuring the success of a DevOps program is simple:
&lt;br&gt;
If you aren't saving money
&lt;br&gt;
If you can’t make change easier and faster
&lt;br&gt;
If you don’t improve quality and reliability and your organization’s ability to respond to problems
&lt;br&gt;
If you can’t keep good people
&lt;br&gt;
... then whatever you’re doing is not working or you’re not doing it right. It doesn't matter if you are “doing DevOps” or using certain tools or if people seem to be more collaborative or believe that they have a greater sense of shared purpose. What matters is the outcome. Make sure that you’re measuring the right things – so that you know that you are doing the right things. &lt;/p&gt;




&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/0FuXNG_2Kw8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/489015444071091617/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=489015444071091617" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/489015444071091617?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/489015444071091617?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/0FuXNG_2Kw8/how-do-you-measure-devops.html" title="How do you measure Devops?" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/04/how-do-you-measure-devops.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMCRXs8eCp7ImA9WhBXGU8.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-8982565712843480052</id><published>2013-04-02T10:07:00.000-07:00</published><updated>2013-04-02T10:07:44.570-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-02T10:07:44.570-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="exploratory testing" /><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><category scheme="http://www.blogger.com/atom/ns#" term="agile development" /><title>War Games, Pair Testing and Other Fun Ways to Find Bugs</title><content type="html">&lt;p&gt;I've already examined &lt;a href="http://swreflections.blogspot.com/2012/04/you-dont-need-testers-or-do-you.html"&gt;how important good testing is&lt;/a&gt; to the health of a project, a product and an organization. There’s a lot more to good testing than running an automated test suite in Continuous Integration and forcing someone to walk through functional test scripts and check lists. A good tester will spend time &lt;a href="http://www.stickyminds.com/BetterSoftware/magazine.asp?fn=cifea&amp;ac=439"&gt;exploring the app&lt;/a&gt;, making sure that they really understand it and that the app actually makes sense, finding soft spots and poking them to uncover problems that nobody expects, providing valuable information and feedback to the team.&lt;/p&gt;

&lt;p&gt;What’s better than a good tester? Two good testers working together…&lt;/p&gt;

&lt;h2&gt;Pair Testing – Two Heads are Better than One&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://www.kohl.ca/articles/pairtesting.pdf"&gt;Pair Testing&lt;/a&gt; is an &lt;a href="http://www.satisfice.com/articles/what_is_et.shtml"&gt;exploratory testing&lt;/a&gt; approach where two testers work through scenarios together, combining their knowledge of the app and their unique skills and experience to duplicate hard-to-find bugs or to do especially deep testing of some part of a system. Like in &lt;a href="http://techcrunch.com/2012/03/03/pair-programming-considered-harmful/"&gt;pair programming&lt;/a&gt;, one person drives, defining the goals of the testing session, the time limit and the starting scenarios and providing the hands at the keyboard; and the other person navigates, observes, takes notes, advises, asks questions, double checks, challenges and causes trouble. As a pair they can help each other through misunderstandings and blocks, build on each other’s ideas to come up with new variations and more ways to attack the app, push each other to find more problems, and together they have a better chance of noticing small inconsistencies and errors that the other person might not consider important.&lt;/p&gt;

&lt;p&gt;Pair testing can be especially effective if you &lt;a href="http://www.kohl.ca/pair-testing-how-i-brought-developers-into-the-test-lab/"&gt;pair developers and testers together&lt;/a&gt; – a good tester knows where to look for problems and &lt;a href="http://www.amazon.com/How-Break-Software-Practical-Testing/dp/0201796198"&gt;how to break software&lt;/a&gt;; a good developer can use their understanding of the code and design to suggest alternative scenarios and variations, and together they can help each other recognize inconsistencies and identify unexpected behaviour. This is not just a good way to track down bugs – it’s also a good way for people to learn from each other about the app and about testing in general. In our team, developers and testers regularly pair up to review and test hard problems together, like validating changes to complex business rules or operational testing of distributed failover and recovery scenarios.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.kohl.ca/2004/pair-testing-resources/"&gt;Pair testing&lt;/a&gt;, especially pairing developers and testers together, is a mature team practice. You need testers and developers who are confident and comfortable working together, who trust and respect each other, who understand the value and purpose of exploratory testing, and who are all willing to put the time in to do a good job.&lt;/p&gt;

&lt;h2&gt;War Games and Team Testing&lt;/h2&gt;

&lt;p&gt;If two heads are better than one, then what about four heads, or eight, or ten or …? &lt;/p&gt;

&lt;p&gt;You can get more perspectives and create more chances to learn by running &lt;a href="http://www.testnewsonline.com/2011/11/28/making-a-war-game-of-software-testing/"&gt;War Games&lt;/a&gt;: team testing sessions which put a bunch of people together and try to get as close as possible to recreating real-life conditions. In team testing, one person defines the goals, roles, time limit and main scenarios. Multiple people end up driving, each playing different roles or assuming different &lt;a href="http://www.agilemodeling.com/artifacts/personas.htm"&gt;personas&lt;/a&gt;, some people trying crazy shit to see what happens, others being more disciplined, while somebody else shoulder surfs or looks through logs and code as people find problems. More people means more variations and more chances to create unexpected situations, more eyes to look out for inconsistencies and finishing details (“is the system supposed to do this when I do that?”), and more hands to try the same steps at the same time to test for concurrency problems. At worst, you’ll have a &lt;a href="http://www.sqaforums.com/showflat.php?Cat=0&amp;Number=178150&amp;page=0&amp;fpart=all&amp;vc=1"&gt;bunch of monkeys bashing at keyboards&lt;/a&gt; and maybe finding some bugs. But a well-run team test session is a beautiful thing, where people feed on each other’s findings and ideas and improvise in a loosely structured way, &lt;a href="http://www.developsense.com/presentations/2008-06-TestingAndMusic.pdf"&gt;like a jazz ensemble&lt;/a&gt;. 
&lt;/p&gt;

&lt;p&gt;Testing this way makes a lot of sense for interactive systems like online games, social networks, online stores or online trading: apps that support different kinds of users playing different roles with different configurations and different navigation options that can lead to many different paths through the app and many different experiences. &lt;/p&gt;

&lt;p&gt;With so many people doing so many things, it’s important that everyone (or at least someone) has the discipline to keep track of what they are doing, and make notes as they find problems. But even if people are keeping decent notes, sometimes all that you really know is that somebody found a problem, but nobody is sure what exactly they were doing at the time or what the steps are to reproduce the problem. It can be like finding a problem in production, so you need to use similar troubleshooting techniques, rely more on logs and error files to help retrace steps.&lt;p&gt;
&lt;p&gt;Team testing can be done in large groups, sometimes even as part of acceptance testing or field testing with customers. But there are diminishing returns: as more people get involved, it’s harder to keep everyone motivated and focused, and harder to understand and deal with the results. We used to invite the entire team into team testing sessions, to get as many eyes as possible on problems, and to give everyone an opportunity to see the system working as a whole (which is important when you are still building it, and everyone has been focused on their pieces). &lt;/p&gt;
&lt;p&gt;But now we've found that a team as small as four to six people who really understand the system is usually enough, better than two people, and much more efficient than ten, or a hundred. You need enough people to create and explore enough options, but a small enough group that everyone can still work closely together and stay engaged.&lt;/p&gt;

&lt;p&gt;Team testing is another mature team practice: you need people who trust each other and are comfortable working together, who are reasonably disciplined, who understand exploratory testing and who like finding bugs.&lt;/p&gt;

&lt;h2&gt;Let's Play a Game&lt;/h2&gt;

&lt;p&gt;We relied on War Games a lot when we were first building the system, before we had good automated testing coverage in place. It was an inefficient, but effective way to increase code coverage and find good bugs before our customers did.&lt;/p&gt;

&lt;p&gt;We still rely on War Games today, but now it’s about looking for real-life bugs: testing at the edges, testing weird combinations and workflow chaining problems, looking closely for usability and finishing issues, forcing errors, finding setup and configuration mistakes, and hunting down timing errors and races and locking problems. &lt;/p&gt;
&lt;p&gt;Team testing is one of the most useful ways to find subtle (and not so subtle) bugs and to build confidence in our software development and testing practices. Everyone is surprised, and sometimes disappointed, by the kinds of problems that can be found this way, even after our other testing and reviews have been done. This kind of testing is not just about finding bugs that need to be fixed: it points out areas where we need to improve, and raises alarms if too many – or any scary – problems are found.&lt;/p&gt;

&lt;p&gt;This is because War Games only make sense in later stages of development, once you have enough of a working system together to do real system testing, and after you have already done your basic functional testing and regression. It’s expensive to get multiple people together, to set up the system for a group of people to test, to define the roles and scenarios, and then to run the test sessions and review the results – you don’t want to waste everyone’s time finding basic functional bugs or regressions that should have and could have been picked up earlier. So whatever you do find should be a (not-so-nice) surprise.&lt;/p&gt;

&lt;p&gt;War Games can also be exhausting – good exploratory testing like this is only effective if everyone is intensely involved, it takes energy and commitment. This isn’t something that we do every week or even every iteration. We do it when somebody (a developer or a tester or a manager) recognizes that we’ve changed something important in workflow or the architecture or business rules; or decides that it’s time, because we’ve made enough small changes and fixes over enough iterations or because we’ve seen some funny bugs in production recently, time to run through key scenarios together as a group and see what we can find.&lt;/p&gt;

&lt;p&gt;What makes War Games work is that &lt;a href="http://www.stickyminds.com/sitewide.asp?Function=edetail&amp;ObjectType=COL&amp;ObjectId=17918"&gt;they are games&lt;/a&gt;: an intensity and competition builds naturally when you get smart people working together on a problem, and a sense of play. 

&lt;blockquote&gt;“Framing something like software testing in terms of gaming, and borrowing some of their ideas and mechanics, applying them and experimenting can be incredibly worthwhile.” 
&lt;br&gt;
Jonathan Kohl, &lt;a href="http://www.kohl.ca/2013/applying-gamification-in-software-testing/"&gt;Applying Gamification to Software Testing&lt;/a&gt;&lt;/blockquote&gt;&lt;/p&gt;

When people realize that it’s fun to find more bugs and better bugs than the other people on the team, they push each other to try harder, which leads to smarter and better testing, and to everyone learning more about the system. It’s a game, and it can be fun – but it’s serious business too.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/vwTjvPez8pA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/8982565712843480052/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=8982565712843480052" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/8982565712843480052?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/8982565712843480052?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/vwTjvPez8pA/war-games-pair-testing-and-other-fun.html" title="War Games, Pair Testing and Other Fun Ways to Find Bugs" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/04/war-games-pair-testing-and-other-fun.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4GSHs9eSp7ImA9WhBQE0s.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-8903616342727480122</id><published>2013-03-15T09:20:00.000-07:00</published><updated>2013-03-15T09:28:49.561-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-15T09:28:49.561-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="management" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="agile development" /><title>Yes Small Companies Can – and Should – Build Secure Software</title><content type="html">&lt;p&gt;&lt;blockquote&gt;"For large software companies or major corporations such as banks or health care firms with large custom software bases, investing in software security can prove to be valuable and provide a measurable return on investment, but that's probably not the case for smaller enterprises, said John Viega, executive vice president of products, strategy and services at SilverSky and an authority on software security." 
&lt;br&gt;
&lt;a href="http://www.schneier.com/blog/archives/2013/03/is_software_sec.html"&gt;Schneier on Security: Is Software Security a Waste of Time?
&lt;/a&gt;&lt;/blockquote&gt;
&lt;p&gt;

&lt;p&gt;Bullshit.&lt;/p&gt;

&lt;p&gt;It’s foolish and short sighted to pretend that software security is only a problem for enterprises or enterprise software vendors. Small companies write software that big companies use, which means that these big companies are putting their customers at risk. This is happening all of the time.&lt;/p&gt;

&lt;p&gt;And it’s wrong to believe that small shops can’t do anything practical about building secure software. I'm not talking about swallowing something like &lt;a href="http://www.microsoft.com/security/sdl/default.aspx"&gt;Microsoft’s SDL whole&lt;/a&gt; – for some people, the argument seems to be that &lt;blockquote&gt;
“If you aren't following Microsoft’s SDL then you can’t build secure software, and &lt;a href="http://blogs.msdn.com/b/sdl/archive/2010/05/11/do-what-microsoft-did-not-what-they-do.aspx"&gt;nobody except Microsoft can follow the SDL&lt;/a&gt;, so you might as well give up.”&lt;/blockquote&gt;&lt;/p&gt;


&lt;p&gt;But you don't need to adopt the SDL, or any other large-scale, expensive, enterprise-quality software security program. Any small shop can take some reasonable steps that will go a long way to building secure software:
&lt;ol&gt;
&lt;li&gt;First, take some time upfront to understand the business requirements for security and compliance and for handling confidential and private data – what information do you need to protect, who can see and change what data, what data do you have to encrypt, what data should you not store at all, what do you need to log? All of this is just part of understanding what kind of system you need to build.
&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;Think about your &lt;a href="http://www.mrc-productivity.com/blog/2013/03/application-architecture-ignore-at-your-own-risk/"&gt;application architecture&lt;/a&gt;, and choose a good application framework. For all the noise about &lt;a href="http://swreflections.blogspot.com/2013/01/design-doesnt-emerge-from-code.html"&gt;“emergent design”&lt;/a&gt;, almost everybody who builds business apps – even small teams following Agile/Lean methods – use some kind of framework. It’s stupid not to. A good framework takes care of all kinds of problems for you – including security problems – which means that you can get down to delivery features faster, which is after all the point. 
&lt;br&gt;
&lt;br&gt;
If you’re a Ruby developer, Rails will take care of a lot of security problems for you – as long as you &lt;a href="http://guides.rubyonrails.org/security.html"&gt;make sure to use Rails properly&lt;/a&gt; and you &lt;a href="http://www.kalzumeus.com/2013/01/31/what-the-rails-security-issue-means-for-your-startup/"&gt;make sure to keep Rails up to date&lt;/a&gt; (the Rails community has made some mistakes when it comes to security, but they &lt;a href="http://rubyonrails.org/security"&gt;seem committed to fixing their mistakes&lt;/a&gt;).
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.playframework.com/"&gt;Play&lt;/a&gt;, a popular application framework for Java and Scala, includes built-in &lt;a href="http://www.playframework.com/documentation/1.2.3/security"&gt;security features and controls&lt;/a&gt;, as do many other frameworks for Java, and &lt;a href="http://stackoverflow.com/questions/13073970/good-php-framework-for-strong-security"&gt;frameworks for PHP&lt;/a&gt; and other languages, and of course there’s &lt;a href="http://msdn.microsoft.com/en-us/library/fkytk30f%28v=vs.80%29.aspx"&gt;.NET for Microsoft&lt;/a&gt; platforms, which is loaded with security capabilities. 
&lt;br&gt;
&lt;br&gt;
None of these frameworks will take care of every security problem for you – even if you use them properly and make sure to keep them patched as security vulnerabilities are found. But using a good framework will reduce risk significantly without adding real costs or time to development. And when you do need to do something about security that may not be included in the framework (like properly handling encryption), there are good security libraries available like &lt;a href="http://shiro.apache.org/"&gt;Apache Shiro&lt;/a&gt; that will make sure that you do things right while still saving time and costs.
&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;Write solid, &lt;a href="http://swreflections.blogspot.com/2012/03/defensive-programming-being-just-enough.html"&gt;defensive code&lt;/a&gt;: code that works and &lt;a href="http://www.michaelnygard.com/blog/2003/04/dont_build_systems_that_boink.html"&gt;won’t boink&lt;/a&gt; when it is used in the real world. Check input parameters and API return values, do a good job of error handling, use safe libraries. Program responsibly.
&lt;br&gt;
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
Take advantage of static analysis tools to catch bugs, including security bugs. At least understand and use any static &lt;a href="http://www.jetbrains.com/idea/documentation/static_code_analysis.html"&gt;analysis checkers that are in your IDE&lt;/a&gt; and free, easy to use tools like &lt;a href="http://findbugs.sourceforge.net/"&gt;Findbugs&lt;/a&gt; and &lt;a href="http://pmd.sourceforge.net/"&gt;PMD&lt;/a&gt; for Java, or Microsoft’s tools for .NET. They're free, they find bugs so you don't have to - why wouldn't you use them?
&lt;br&gt;
&lt;br&gt;
Most commercial tools are too expensive for small teams, although if Cigital comes through with small-bundle pricing for &lt;a href="http://www.cigital.com/products/secureassist/"&gt;Secure Assist&lt;/a&gt; this would finally provide small development teams high-quality feedback on security bugs.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sure there is a lot more that you could do or should do if you need to. But even modest and reasonable steps will go a long way to making software safer for customers. And there’s no reasons that small teams can’t – or shouldn't – do this.&lt;p&gt;&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/f-S7Tz9itMI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/8903616342727480122/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=8903616342727480122" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/8903616342727480122?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/8903616342727480122?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/f-S7Tz9itMI/yes-small-companies-can-and-should.html" title="Yes Small Companies Can – and Should – Build Secure Software" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/03/yes-small-companies-can-and-should.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUBRHs4eyp7ImA9WhBRF0s.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-7274957351381892682</id><published>2013-03-08T10:27:00.001-08:00</published><updated>2013-03-08T10:27:35.533-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-08T10:27:35.533-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="devops" /><category scheme="http://www.blogger.com/atom/ns#" term="Continuous Delivery" /><category scheme="http://www.blogger.com/atom/ns#" term="Kanban" /><category scheme="http://www.blogger.com/atom/ns#" term="Continuous Deployment" /><title>Book Review: The Phoenix Project</title><content type="html">&lt;p&gt;Everyone who attended the “Rugged Devops” panel at &lt;a href="http://swreflections.blogspot.ca/2013/03/appsec-at-rsa-2013.html"&gt;RSA this year&lt;/a&gt; received a free copy of &lt;a href="http://itrevolution.com/books/phoenix-project-devops-book/"&gt;The Phoenix Project&lt;/a&gt; (by Gene Kim, Kevin Behr and George Spafford – the authors of &lt;a href="http://www.amazon.com/Visible-Ops-Handbook-Implementing-Practical/dp/0975568612"&gt;Visible Ops&lt;/a&gt;), the fictional story of the education and transformation of an IT manager, an IT organization, and eventually of an entire company.&lt;/p&gt;

&lt;p&gt;I'm not sure why they wrote the Phoenix Project as a novel. But they did. So I’ll review it first as a piece of story telling, and then look at the messaging inside.&lt;/p&gt;

&lt;p&gt;The reason that I don’t like didactic fiction is that so much of it is so poorly written – generally forced and artificial. I was pleasantly surprised by the Phoenix Project. The first half of the novel tells a story about an IT manager forced into taking on responsibility for saving his company. Our well-meaning hero, an ex-marine sergeant (for some reason unclear to me, the hero, the CEO, and even the mysterious guru all have a military background) with an MBA but without any ambition except to quietly provide for his family. He has been successfully running his own little part of the IT group, so successfully that he is dramatically promoted to take over all of IT operations (and so successfully that his own group is never mentioned again in the story – it seems to run on auto-pilot without him). For a successful manager, our hero knows alarmingly little about how the rest of the IT organization works, or about the business, and so is unprepared for his new responsibility. He reluctantly accepts the big job, and then regrets it immediately as he realizes what a shit storm he has walked into.&lt;/p&gt;

&lt;p&gt;It’s a compelling narrative that draws you in and is seems realistic even with the stock characters:  the sociopathic SOB CEO, the unpopular everything-by-the-book CISO, the Software Development Manager who only cares about hitting deadlines (but not about delivering software that works), the Machiavellian Marketing executive, and the autistic genius that the entire IT organization of several hundred people all depend on to get all the important stuff done or fixed. &lt;/p&gt;

&lt;p&gt;As a pure piece of story telling, things start to unravel in the second half with the emergence of the IT / Lean Manufacturing guru – when the story ends and the devops fable begins. From this point on, the plot depends on several miraculous conversions: everyone except the marketing exec sees the light and literally transform overnight. They even start to groom themselves nicely and dress better. Lifetime friendships are made over a few drinks, and everyone learns to trust and share: there’s a particularly cringe-inducing management meeting in which people bare their souls and weep. Conflicts and problems disappear magically usually because of the guru’s intervention – including an unnecessary scene where the guru shows up at a crucial audit meeting and helps convince the partner of the audit firm (an old buddy of his) that there aren't any real problems with the company’s messed up IT controls (“these aren't the droids you’re looking for”). &lt;/p&gt;
&lt;p&gt;But the real heroes are the people running the manufacturing group: the one part of this spectacularly mismanaged company that somehow functions perfectly is a manufacturing plant where everyone can all go to learn about Kanban and Lean process management and so on. Without the help of the smug and smart-alecky guru - who apparently helped create this manufacturing success - and his tiresome Zen master teaching approach (and sometimes even with his help), our hero is unable to understand what’s wrong or what to do about it. He doesn't understand anything about demand management, how to schedule and prioritize project work, that firefighting is actual work, how to get out of firefighting mode, how to recognize and manage bottlenecks in workflow, or even how important it is to align IT with business priorities (where did he get that MBA any ways?). Luckily, the factory is right there for him learn from, if he only opens his eyes and mind. &lt;/p&gt;

&lt;h2&gt;What will you learn from The Phoenix Project?&lt;/h2&gt;

&lt;p&gt;The other problem with this story telling approach is that it takes so damn long to get to the point – it’s a 338 page book with about 50 pages of meat. Like Goldratt's &lt;a href="http://en.wikipedia.org/wiki/The_Goal_%28novel%29"&gt;The Goal&lt;/a&gt; (which is referenced a couple of times in this book), The Phoenix Project leads the reader to understanding through a kind of detective story. You have to be patient and watch as the hero stumbles and goes down blind alleys and ignores obvious clues and only with help eventually figures out the answers. Unfortunately, I'm not a patient reader.&lt;/p&gt;

&lt;p&gt;This is a gentle introduction to Lean IT and devops. If you've read anything on Kanban and devops you won’t find anything surprising, although the authors do a good job of explaining how Lean manufacturing concepts can be applied to managing IT work. The ideas covered in the book are standard Lean and &lt;a href="http://en.wikipedia.org/wiki/Theory_of_constraints"&gt;Theory of Constraints&lt;/a&gt; stuff, with a little of &lt;a href="http://www.amazon.com/Kanban-Successful-Evolutionary-Technology-Business/dp/0984521402"&gt;David Anderson’s Kanban&lt;/a&gt; and some devops – especially Continuous Deployment as originally described by &lt;a href="http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr"&gt;John Allspaw&lt;/a&gt; and &lt;a href="http://continuousdelivery.com/"&gt;Continuous Delivery&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The guru’s lessons are mostly about visualizing and understanding and limiting demand – that you should stop taking on more work until you can get things actually working so that you’re not spending all of your time task-switching and firefighting; identifying workflow bottlenecks and protecting or optimizing around them; how reducing batch size in development will improve control and to get faster feedback; that in order to do this you have to work on simplifying and standardizing deployment; and how valuable it is to get developers and operations to work together. &lt;/p&gt;

&lt;p&gt;My complaints aren't with the ideas – I buy into a lot of Devops and agree that Kanban and Lean have a lot to offer to IT ops and support teams (although I'm not sold on Kanban by itself for development, certainly not at scale). But I was disappointed with the unrealistic turnaround in the second half of the book. It’s all rainbows and unicorns at the end. IT, the business, development and security all start working together seamlessly. Management is completely aligned. Performance problems? No problem – just go the Cloud. And they even bring in the famous Chaos Monkey in the last couple of pages just because. &lt;/p&gt;

&lt;p&gt;Spoiler Art: Everything goes so well in a few months that the company is back on track, plans to outsource IT and to break up the company are cancelled, the selfish head of marketing is canned, and our hero is promoted to CIO and put on the fast track to corporate second in command. Sorry: nothing this bad gets that good that easily. It is a fable after all, and too hard to swallow.&lt;/p&gt;

&lt;p&gt;The Phoenix Project is a unique book – when was the last time that you read an actual novel about IT management?! It was worth reading, and if it introduces devops and Lean ideas to more people in IT, The Phoenix Project will have accomplished something useful. But it’s not a book that you can use to get things done. There are lessons and recipes and patterns but they take work to pull out of the story. There’s no index, no good way to go back to find things that you thought were useful or interesting. So I am looking forward to the &lt;a href="http://www.realgenekim.me/devops-cookbook/"&gt;Devops Cookbook&lt;/a&gt;: something practical that hopefully explains how these ideas can work in businesses that don’t look all like Facebook and Twitter.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/v6au6dNKhUs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/7274957351381892682/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=7274957351381892682" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7274957351381892682?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7274957351381892682?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/v6au6dNKhUs/book-review-phoenix-project.html" title="Book Review: The Phoenix Project" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/03/book-review-phoenix-project.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4MQXgzeip7ImA9WhBRFkQ.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-6908400110296020707</id><published>2013-03-07T13:49:00.001-08:00</published><updated>2013-03-07T13:49:40.682-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-07T13:49:40.682-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="RSA" /><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="bugs" /><category scheme="http://www.blogger.com/atom/ns#" term="code reviews" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><title>Peer reviews for security are a waste of time?</title><content type="html">&lt;p&gt;At &lt;a href="http://swreflections.blogspot.ca/2013/03/appsec-at-rsa-2013.html"&gt;this year’s RSA conference&lt;/a&gt;, one of the panel’s questioned whether &lt;a href="http://securitywatch.pcmag.com/none/308760-rsa-is-software-security-a-waste-of-time"&gt;software security is a waste of time&lt;/a&gt;. A panellist, John Viega, said a few things that I agreed with, and a lot that I didn't. Especially that 
&lt;blockquote&gt;“peer reviews for security are a waste of time.”
&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;This statement is wrong on every level.&lt;/p&gt;

&lt;p&gt;Everyone should know by now that &lt;a href="http://swreflections.blogspot.com/2011/05/not-doing-code-reviews-whats-your.html"&gt;code reviews find real bugs&lt;/a&gt; – even informal, lightweight code reviews. &lt;/p&gt;

&lt;blockquote&gt;“Reviews catch more than half of a product’s defects regardless of the domain, level of maturity of the organization, or lifecycle phase during which they were applied”. &lt;a href="http://www.cs.umd.edu/~mvz/pub/eworkshop02.pdf"&gt;What We Have Learned About Fighting Defects&lt;/a&gt;
&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Software security vulnerabilities are like other software bugs – you find them through testing or through reviews. If peer code reviews are a good way to find bugs, why would they be a waste of time for finding security bugs?&lt;/p&gt;

&lt;p&gt;There are only a few developers anywhere who write security plumbing: authentication and session management, access control, password management, crypto and secrets handling. Or other kinds of plumbing like the data access layer and data encoding and validators that also have security consequences. All of this is the kind of kind of stuff that should be handled in frameworks anyway – if you’re writing this kind of code, you better have a good reason for doing it and you better know what you are doing. It’s obviously tricky and high-risk high-wire work, so unless you’re a team of one, your code and decisions need to be carefully reviewed by somebody else who is at least as smart as you are. If you don’t have anyone on the team who can review your work, then what the hell are you doing trying to write it in the first place?&lt;/p&gt;

&lt;p&gt;Everybody else has to be responsible for writing good, &lt;a href="http://swreflections.blogspot.com/2012/03/defensive-programming-being-just-enough.html"&gt;defensive application code&lt;/a&gt;. Their responsibilities are:
&lt;ul&gt;&lt;li&gt;Make sure their code works – that the logic is correct&lt;/li&gt;
&lt;li&gt;Use the framework properly&lt;/li&gt;
&lt;li&gt;Check input data and return values&lt;/li&gt;
&lt;li&gt;Handle errors and exceptions correctly&lt;/li&gt;
&lt;li&gt;Use safe routines/APIs/libraries&lt;/li&gt;
&lt;li&gt;Be careful with threading and locking and synchronization&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;A good developer can review this code for security and privacy requirements: making sure that you are masking or encrypting or – even better – not storing PII and secrets, auditing, properly following access control rules. And they can review the logic and workflow, look for race conditions, check data validation, make sure that error handling and exception handling is done right and that you are using frameworks and libraries carefully. &lt;/p&gt;

&lt;p&gt;This is what code reviews are for. To look for and find coding problems. If you find these problems – and code reviews are one of the most effective ways of doing this – your code will be safer and more secure. So I don’t get it. Why are peer reviews for security a waste of time?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/YfHH7ly-gmo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/6908400110296020707/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=6908400110296020707" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/6908400110296020707?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/6908400110296020707?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/YfHH7ly-gmo/peer-reviews-for-security-are-waste-of.html" title="Peer reviews for security are a waste of time?" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/03/peer-reviews-for-security-are-waste-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYBRn8-eyp7ImA9WhBRFU0.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-3200417772146099074</id><published>2013-03-05T08:49:00.000-08:00</published><updated>2013-03-05T08:49:17.153-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-05T08:49:17.153-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="RSA" /><category scheme="http://www.blogger.com/atom/ns#" term="devops" /><category scheme="http://www.blogger.com/atom/ns#" term="rugged" /><category scheme="http://www.blogger.com/atom/ns#" term="OWASP" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><category scheme="http://www.blogger.com/atom/ns#" term="Continuous Deployment" /><title>Appsec at RSA 2013</title><content type="html">&lt;p&gt;This was my second time at the &lt;a href="http://www.rsaconference.com/events/2013/usa/"&gt;RSA conference&lt;/a&gt; on IT security.  &lt;a href="http://software-security.sans.org/blog/2012/03/08/appsec-at-rsa-2012-conference/"&gt;Like last year&lt;/a&gt;, I focused on the appsec track, starting with a half-day mini-course on how to write secure applications for developers, presented by &lt;a href="https://twitter.com/manicode"&gt;Jim Manico&lt;/a&gt; and &lt;a href="https://twitter.com/EoinKeary"&gt;Eoin Keary&lt;/a&gt; representing OWASP. It was a well-attended session. Solid, clear guidance from people who really do understand what it takes to write secure code. They explained why relying on pen testing is never going to be enough (your white hat pen tester gets 2 weeks a year to hack your app, the black hats get 52 weeks a year), and covered all of the main problems, including password management (secure storage and forgot password features), how to protect the app from click jacking, proper session management, access control design. They showed code samples (good and bad) and pointed developers to OWASP libraries and &lt;a href="https://www.owasp.org/index.php/Cheat_Sheets"&gt;Cheat Sheets&lt;/a&gt;, as well as other free tools.&lt;/p&gt;

&lt;h2&gt;We have to solve XSS and SQL Injection&lt;/h2&gt;

&lt;p&gt;They spent a lot of time on &lt;a href="https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)"&gt;XSS&lt;/a&gt; (the most common vulnerability in web apps) and &lt;a href="https://www.owasp.org/index.php/SQL_Injection"&gt;SQL injection&lt;/a&gt; (the most dangerous). Keary recommended that a good first step for securing an app is to find and fix all of the SQL injection problems: SQL injection is easy to see and easy to fix (change the code to use prepared statements with bind variables), and getting this done will not only make your app more secure, it also proves your organization’s ability to find security problems and fix them successfully.&lt;/p&gt;

&lt;p&gt;SQL injection and XSS kept coming up throughout the conference. In a later session, &lt;a href="https://twitter.com/NGalbreath"&gt;Nick Galbreath&lt;/a&gt; looked deeper into SQL injection attacks and what developers can do to &lt;a href="http://www.client9.com/2013/02/27/sql-risc-new-directions-in-sqli-prevention/"&gt;detect and block them&lt;/a&gt;. By researching thousands of SQL injection attacks, he found that attackers use constructs in SQL that web application developers rarely use: unions, comments, string and character functions, hex number literals and so on. By looking for these constructs in SQL statements you can easily identify if the system is being attacked, and possibly block the attacks. This is the core idea behind database firewalls like &lt;a href="http://www.greensql.com/content/greensql-database-security"&gt;Green SQL&lt;/a&gt; and &lt;a href="http://www.dbnetworks.com/"&gt;DB Networks&lt;/a&gt;, both companies that exhibited their solutions at RSA.&lt;/p&gt;

&lt;p&gt;On the last day of the conference, &lt;a href="https://communities.coverity.com/blogs/security/authors/rgaucher"&gt;Romain Gaucher&lt;/a&gt; from Coverity Research asked “&lt;a href="http://www.coverity.com/company/press-releases/read/coverity-at-rsa-2013"&gt;Why haven’t we stamped out SQL Injection and XSS yet?&lt;/a&gt;”. He found through a static analysis review of several code bases that while many developers are trying to stop SQL injection by using parameterized queries, it’s not possible to do this in all cases. About 15% of SQL code could not be parameterized properly – or at least it wasn't convenient for the developers to come up with a different approach. Gaucher also reinforced how much of a pain in the butt it is trying to &lt;a href="https://communities.coverity.com/blogs/security/2013/02/26/fixing-xss-a-practical-guide-for-developers"&gt;protect an app from XSS&lt;/a&gt;:

&lt;blockquote&gt;“XSS is not a single vulnerability”. XSS is a group of vulnerabilities that mostly involve injection of tainted data into various HTML contexts”.
&lt;/blockquote&gt;
It’s the same problem that Jim Manico explained in the secure development class: in order to prevent XSS you have to understand the context and do context-sensitive encoding, and hope that you don’t make a mistake. To help make this problem manageable, in addition to libraries available from OWASP, Coverity has &lt;a href="https://github.com/coverity/coverity-security-library"&gt;open sourced a library&lt;/a&gt; to protect Java apps from XSS and SQL injection.&lt;/p&gt;

&lt;h2&gt;The Good&lt;/h2&gt;

&lt;p&gt;While most of the keynotes offered a chance to catch up on email, the Crypto Panel was interesting. Chinese research into crypto is skyrocketing. Which could be a good thing. Or not. I was interested to hear Dan Boneh at Stanford talk more about the research that he has done into digital certificate handling and SSL outside of browsers. His team found that in almost all cases, people &lt;a href="https://crypto.stanford.edu/~dabo/pubs/abstracts/ssl-client-bugs.html"&gt;who try to do SSL certificate validation in their own apps do it wrong&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/k8em0"&gt;Katie Moussouris&lt;/a&gt; at Microsoft presented an update on ISO standards work for &lt;a href="http://www.darkreading.com/security/application-security/240149802/a-vulnerability-disclosure-game-changer.html"&gt;vulnerability handling&lt;/a&gt;. &lt;a href="http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=53231"&gt;ISO 30111&lt;/a&gt; lays out a structured process for investigating, triaging and resolving software security vulnerabilities. There were no surprises in the model - the only surprise is that the industry actually needs an ISO standard for the blindingly obvious, but it should set a good bar for people who don't know where to start.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/jeremiahg"&gt;Jeremiah Grossman&lt;/a&gt; explained that there are two sides to the web application security problem. One half is weaknesses in web sites like SQL injection and lousy password handling and mistakes in access control. The other half is attacks that exploit fundamental problems in browsers. Attacks that try to break out of the browser – which browser vendors put a lot of attention to containing through sandboxing and anti-phishing and anti-malware protection – and attacks that stay inside the browser but compromise data inside the browser like XSS and CSRF, which get no attention from browser vendors so it’s up to application developers to deal with.&lt;/p&gt;

&lt;p&gt;Grossman also presented some statistics on the state of web application security, using data that White Hat Security is collecting from its customer base. Recognizing that their customers are representative of more mature organizations that already do regular security testing of their apps, the results are still encouraging. The average number of vulnerabilities per app is continuing to decline year on year. SQL injection is now the 14th most common vulnerability, found in only 7% of tested apps – although more than 50% of web apps are vulnerable to XSS, for the reasons discussed above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/cigital"&gt;Gary McGraw from Cigital&lt;/a&gt; agreed that as an industry, software is getting better. Defect density is going down (not as fast as it should be, but real progress is being made), but the software security problem isn't going away because we are writing a lot more code, and more code inevitably means more bugs. He reiterated that we need to stay focused on the fundamentals – we already know what to do, we just have to do it. 
&lt;blockquote&gt;“The time has come to stop looking for new bugs to add to the list. Just fix the bugs”.&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Another highlight was the &lt;a href="http://www.darkreading.com/application-security/167901123/security/news/240149897/using-devops-to-upgrade-application-security"&gt;panel on Rugged Devops&lt;/a&gt;, which continued a discussion that started at OWASP Appsec late last year, and covered pretty much the same ground: how important it is to get developers and operations working together to make software run in production safely, that we need more automation (testing, deployment, monitoring), and how devops provides an opportunity to improve system security in many ways and should be embraced, not resisted by the IT security community. &lt;/p&gt;

&lt;p&gt;The ideas are based heavily on what Etsy and Netflix and Twitter have done to build security into their rapid development/deployment practices. I agreed with ½ of the panel (Nick Galbreath and David Mortman, who have real experience in software security in Devops shops) almost all of the time, and disagreed with the other ½ of the panel most of the rest of the time. There’s still too much hype over continuously deploying changes 10 or 100 or 1000 times a day, and over the Chaos Monkey. Etsy moved to &lt;a href="http://www.slideshare.net/mikebrittain/continuous-delivery-the-dirty-details"&gt;Continuous Deployment&lt;/a&gt; multiple times per day because they couldn’t properly manage their release cycles – that doesn't mean that everyone has to do the same thing or should even try. And you probably do need something like Chaos Monkey if you’re going to trust your business to infrastructure &lt;a href="http://blogs.wsj.com/cio/2012/12/27/netflix-amazon-outage-shows-any-company-can-fail/"&gt;as unreliable as AWS&lt;/a&gt;, but again, that’s not a choice that you have to make. There’s a lot more to devops, it’s unfortunate that these ideas get so much attention.&lt;/p&gt;

&lt;h2&gt;The Bad and the Ugly&lt;/h2&gt;

&lt;p&gt;There was only one low point for me – a panel with &lt;a href="https://twitter.com/viega"&gt;John Viega&lt;/a&gt; formerly of McAfee and &lt;a href="https://twitter.com/bradarkin"&gt;Brad Arkin&lt;/a&gt; from Adobe called “&lt;a href="http://securitywatch.pcmag.com/none/308760-rsa-is-software-security-a-waste-of-time"&gt;Software Security: a Waste of Time&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;Viega started off playing the devil’s advocate, asserting that most people should do nothing for appsec, it’s better and cheaper to spend their time and money on writing software that works and deal with security issues later. Arkin disagreed, but unfortunately it wasn't clear from the panel what he felt an organization should do instead. Both panellists questioned the value of most of the tools and methods that appsec relies on. Neither believed that static analysis tools scale, or that manual security code audits are worth doing. Viega also felt that “peer reviews for security are a waste of time”. Arkin went on to say:

&lt;blockquote&gt;“I haven’t seen a Web Application Firewall that’s worth buying, and I've stopped looking”
&lt;br&gt;
“The best way to make somebody quit is to put them in a threat modelling exercise”
&lt;br&gt;
“You can never fuzz and fix every bug”
&lt;/blockquote&gt;

Arkin also argued against regulation, citing the failure of PCI to shore up security for the retail space – ignoring that the primary reason that many companies even attempt to secure their software is because PCI requires them to take some responsible steps. But Arkin at least does believe that secure development training is important and that every developer should receive some security training. Viega disagreed, and felt that training only matters for a small number of developers who really care.&lt;/p&gt;
 
&lt;p&gt;This panel was like a Saturday Night Live skit that went off the rails. I couldn't tell when the panellists were being honest or when they were ironically playing for effect. This session lived up to its name, and really was a waste of time.&lt;/p&gt;

&lt;h2&gt;The Toys&lt;/h2&gt;

&lt;p&gt;This year’s trade show was even bigger than last year, with overflow space across the hall. There were no race cars or sumo wrestlers at the booths this year, and fewer strippers (ahem models) moonlighting (can you call it "moonlighting" if you're doing it during the day?) as booth bunnies although there was a guy dressed like Iron Man and way too many carnival games. &lt;/p&gt;

&lt;p&gt;This year’s theme was something to do with Big Data in security so there were lots of expensive analytics tools for sale. For appsec, the most interesting thing that I saw was &lt;a href="http://www.cigital.com/products/secureassist/"&gt;Cigital Secure Assist&lt;/a&gt; a plug-in for different IDEs that provides fast feedback on security problems in code (Java, .NET or PHP) every time you open or close a file. The Cigital staff were careful not to call this a static analysis tool (they’re not trying to compete with Fortify or Coverity or Klocwork), but what excited me was the quality of the feedback, the small client-side footprint, and that they intend to make it available for direct purchase over the web for developers at a very reasonable price point, which means that this could finally be a viable option for smaller development shops that want to take care of security issues in code. &lt;/p&gt;

&lt;p&gt;All in all, a good conference and a rare opportunity to meet so many smart people focused on IT security. I still think for pure appsec that OWASP’s annual conference is better, but there's nothing quite like RSA.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/1854tEGqXkU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/3200417772146099074/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=3200417772146099074" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3200417772146099074?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3200417772146099074?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/1854tEGqXkU/appsec-at-rsa-2013.html" title="Appsec at RSA 2013" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/03/appsec-at-rsa-2013.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAMQXozeyp7ImA9WhBSFEs.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-2128803508396309757</id><published>2013-02-21T07:33:00.000-08:00</published><updated>2013-02-21T07:33:00.483-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-21T07:33:00.483-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="devops" /><category scheme="http://www.blogger.com/atom/ns#" term="agile development" /><title>Hardening Sprints - in Portuguese</title><content type="html">My &lt;a href="http://swreflections.blogspot.com/2013/01/hardening-sprints-what-are-they-do-you.html"&gt;post on Hardening Sprints&lt;/a&gt; has been translated into Portuguese at the Brazilian iMasters site. If your Portuguese is good, you can read the post &lt;a href="http://imasters.com.br/desenvolvimento/o-que-e-e-o-que-nao-e-refatoracao-de-acordo-com-kent-beck-e-martin-fowler/"&gt;here&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/b5lOcU4RGnk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/2128803508396309757/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=2128803508396309757" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/2128803508396309757?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/2128803508396309757?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/b5lOcU4RGnk/hardening-sprints-in-portuguese.html" title="Hardening Sprints - in Portuguese" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/02/hardening-sprints-in-portuguese.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UHSHw-fSp7ImA9WhBSE0U.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-1633794471614496080</id><published>2013-02-20T10:33:00.003-08:00</published><updated>2013-02-20T10:33:59.255-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-20T10:33:59.255-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="bugs" /><category scheme="http://www.blogger.com/atom/ns#" term="code reviews" /><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><category scheme="http://www.blogger.com/atom/ns#" term="static analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="bug tracking" /><title>A Bug is a Terrible Thing to Waste</title><content type="html">&lt;p&gt;Some development teams, &lt;a href="http://accurev.com/blog/2008/01/02/is-defect-tracking-dead-in-an-agile-world/"&gt;especially Agile teams, don’t bother tracking bugs&lt;/a&gt;. Instead of &lt;a href="http://fragile.org.uk/2010/04/why-i-dont-use-bug-tracking-software/"&gt;using a bug tracking system&lt;/a&gt;, when testers find a bug, they talk to the developer and get it fixed, or they write a failing test that needs to be fixed and add it to the Continuous Integration test suite, or if they have to, they &lt;a href="http://www.mountaingoatsoftware.com/blog/bugs-on-the-product-backlog"&gt;write up a bug story on a card&lt;/a&gt; and post it on the wall so the team knows about it and somebody will commit to fixing it.&lt;/p&gt;

&lt;p&gt;Other teams &lt;a href="http://www.joelonsoftware.com/articles/fog0000000029.html"&gt;live by their bug tracking systems&lt;/a&gt;, using tools like &lt;a href="http://www.atlassian.com/software/jira/"&gt;Jira&lt;/a&gt; or &lt;a href="http://www.bugzilla.org/"&gt;Bugzilla&lt;/a&gt; or &lt;a href="http://www.fogcreek.com/fogbugz/"&gt;FogBugz&lt;/a&gt; to record bugs as well as changes and other work. There are arguments to be made for both of these approaches.&lt;/p&gt;

&lt;h2&gt;Arguments for tracking bugs – and for not tracking bugs&lt;/h2&gt;

&lt;p&gt;In &lt;a href="http://www.amazon.com/Agile-Testing-Practical-Guide-Testers/dp/0321534468"&gt;Agile Testing: A Practical Guide for Testers and Agile Teams&lt;/a&gt;, Lisa Crispin and Janet Gregory examine the pros and cons of using a defect tracking system. &lt;/p&gt;

&lt;p&gt;Using a system to track bugs can be the only effective way to manage problems for teams who can’t meet face-to-face - for example, distributed teams spread across different time zones. It can also be useful for teams who have inherited open bugs in a legacy system; and a necessary evil for teams who are forced to track bugs for compliance reasons. The information in a bug database is a potential knowledge base for testers and developers joining the team – they can review bugs that were found before in the area of the code that they are working on to understand what problems they should look out for. And bug data can be used to collect metrics and create trends on bugs – &lt;a href="http://gojko.net/2011/05/17/bug-statistics-are-a-waste-of-time/"&gt;if you think that bug metrics are useful&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But &lt;a href="http://lisacrispin.com/downloads/NDCDefects.pdf"&gt;the Lean/Agile view is that using a defect tracking system mostly gets in the way&lt;/a&gt; and slows people down. The team should stay focused on finding bugs, fixing them, and then forget about them. Bugs are &lt;a href="http://agile.dzone.com/articles/lean-avoiding-waste"&gt;waste&lt;/a&gt;, and everything about them is waste – dead information, and dead time that is better spent delivering value. Worse, using a defect tracking system prevents testers and developers from talking with each other, and encourages testers to take a &lt;a href="http://agile.dzone.com/news/what-do-you-mean-dont-submit"&gt;“Quality Police” mindset&lt;/a&gt;. Without a tool, people have to talk to each other, and have to learn to play nicely together.&lt;/p&gt;

&lt;p&gt;This is a short-term, tactical point of view, focused on what is needed to get the software out the door and working. It’s &lt;a href="http://evan.bottch.com/2010/08/29/projects-are-evil-and-must-be-destroyed/"&gt;project-thinking, not product thinking&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Bugs over the Long Term&lt;/h2&gt;

&lt;p&gt;But if you’re working on a system over a long time like we are, if you're managing a product or running a service, you know that it’s not that simple. You can’t just look at what’s in front of you, and where you want to be in a year or more. You also have to look back, at the work that was done before, at problems that happened before, at decisions that were made before, to understand why you are where you are today and where you may be heading in the future.&lt;/p&gt;

&lt;p&gt;Because some problems never go away. And other problems will come back unless you do something to stop it. And you’ll find out that other problems which you thought you had licked never really went away. The information from old bugs, what happened and what somebody did to fix them (or why they couldn't fix them), which workarounds worked (and which didn't) can help you understand and deal with the problems that you are seeing today, and help you to keep improving the system and how you build it and keep it running. &lt;/p&gt;

&lt;p&gt;Because you should understand the history of changes and fixes to the code if you’re going to change it. If you like the way the code is today, you might want to know how and why it got this way. If you don’t like it, you’ll want to know how and why it got this way – it’s arrogant to assume that you won’t make the same mistakes or be forced into the same kinds of situations. Revision control will tell you what was changed and when and who did it, the bug tracking system will tell you why. &lt;/p&gt;

&lt;p&gt;Because you need to know where you have instability and risk in the system. You need to identify defect-dense code or &lt;a href="http://swreflections.blogspot.com/2012/02/technical-debt-how-much-is-it-really.html"&gt;error-prone code&lt;/a&gt; – code that contains too many bugs, code that is costing you too much to maintain and causing too many problems, code that is too expensive to keep running the way that is today. Code that you should rewrite ASAP to improve stability and reduce your ongoing costs. But you can’t identify this code without knowing the history of problems in the system.&lt;/p&gt;

&lt;p&gt;Because you may need to prove to auditors or regulators and customers and investors that you are doing a responsible job of testing and finding bugs and fixing them and getting the fixes out.&lt;/p&gt;

&lt;p&gt;And because you want to know how effective the team is in finding, fixing and preventing bugs. Are you seeing fewer bugs today? Or more bugs? Are you seeing the same kinds of bugs – are you making the same mistakes? Or different mistakes? &lt;/p&gt;

&lt;h2&gt;Do you need to track every Bug?&lt;/h2&gt;

&lt;p&gt;As long as bugs are found early enough, there’s little value in tracking them. It’s when bugs escape that they need to be tracked: bugs that the developer didn't find right away on their own, or in pairing, or through the standard automated checks and tests that are run in &lt;a href="http://www.martinfowler.com/articles/continuousIntegration.html"&gt;Continuous Integratio&lt;/a&gt;n.&lt;/p&gt;

&lt;p&gt;We don’t log
&lt;ul&gt;&lt;li&gt;defects found in unit tests or other automated tests – unless for some reason the problem can’t or won’t be fixed right away;&lt;/li&gt;
&lt;li&gt;problems &lt;a href="http://sqa.stackexchange.com/questions/5516/is-it-common-to-track-defects-found-during-code-reviews"&gt;found in peer reviews&lt;/a&gt; – unless something in the review is considered significant and can’t get addressed immediately. Or a problem is found in a late review, after testing has already started, and the code will need to be retested. Or the reviewer finds something wrong in code that wasn't changed, an old bug – it’s still a problem that needs to be looked at, but we may not be prepared to deal with it right now. All problems found in external reviews, like a security review or an audit, are logged;
&lt;li&gt;&lt;a href="http://www.klocwork.com/blog/static-analysis/static-analysis-is-not-bugzilla/"&gt;static analysis findings&lt;/a&gt; – most of the problems caught by these tools are &lt;a href="http://swreflections.blogspot.ca/2009/06/value-of-static-analysis-tools.html"&gt;simple coding mistakes&lt;/a&gt; that can be seen and fixed right away, and there’s also usually a fair amount of noise (&lt;a href="http://www.cs.umd.edu/~pugh/BugWorkshop05/papers/34-chou.pdf"&gt;false positives&lt;/a&gt;) that has to be filtered out. We run static analysis checks and review them daily, and only log findings if we agree that the finding is real but the developer isn't prepared to fix it immediately (which almost never happens, unless we’re running a new tool against an existing code base for the first time). Many static analysis tools have their own systems for tracking static analysis findings any ways, so we can always go back and review outstanding issues later;&lt;/li&gt;
&lt;li&gt;bugs found when developers and testers decide to &lt;a href="http://www.kohl.ca/articles/pairtesting.pdf"&gt;pair together to test&lt;/a&gt; changes early in development, when they are mostly exploring how something should work – we don’t usually log these bugs unless they can’t be / won’t be fixed (can’t be reproduced later for example). &lt;/li&gt;&lt;/ul&gt;

&lt;h2&gt;A Bug is a Terrible thing to Waste&lt;/h2&gt;

&lt;p&gt;We log all other bugs regardless of whether they are found in production, in internal testing, partner testing, User Acceptance Testing, or external testing (such as a pen test).
Because most of the time, when software is handed to a tester, it’s supposed to be working. If the tester finds bugs, especially serious ones, then this is important information to the tester, to the developer, and to the rest of the team. It can highlight risks. It can show where more testing and reviews need to be done. It can highlight deeper problems in the design, a lack of understanding that could cause other problems.&lt;p&gt;

&lt;p&gt;If you believe that &lt;a href="http://swreflections.blogspot.com/2012/04/you-dont-need-testers-or-do-you.html"&gt;testing provides important information&lt;/a&gt; not just about the state of your software, but also on how you are designing and building it – then everyone needs to be able to see this information, and understand it over time. Some problems can’t be seen or fully understood right away, or in 1-week or 2-week sprint-sized chunks. It can take a while before you recognize that you have a serious weakness in the design or that something is broken in your approach to development or in your culture. You’ll need to experience a few problems before you start to find relationships between them and before you can look for their root cause. You’ll need data from the past in order to solve problems in the future.&lt;/p&gt;

&lt;p&gt;Tracking bugs isn't a waste if you learn from bugs. Throwing the information on bugs away is the real waste. &lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/ATDzr2MhygQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/1633794471614496080/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=1633794471614496080" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1633794471614496080?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1633794471614496080?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/ATDzr2MhygQ/a-bug-is-terrible-thing-to-waste.html" title="A Bug is a Terrible Thing to Waste" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/02/a-bug-is-terrible-thing-to-waste.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMEQnc9eCp7ImA9WhBTF0o.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-7168160240871482513</id><published>2013-02-13T08:34:00.001-08:00</published><updated>2013-02-13T08:36:43.960-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-13T08:36:43.960-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="devops" /><category scheme="http://www.blogger.com/atom/ns#" term="Continuous Delivery" /><category scheme="http://www.blogger.com/atom/ns#" term="agile" /><category scheme="http://www.blogger.com/atom/ns#" term="management" /><category scheme="http://www.blogger.com/atom/ns#" term="Continuous Deployment" /><category scheme="http://www.blogger.com/atom/ns#" term="agile development" /><title>Releasing more often drives better Dev and better Ops</title><content type="html">&lt;p&gt;One of the most important decisions that we made as a company was to release less software, more often. After we went live, we tried to deliver updates quarterly, because until then we had followed a &lt;a href="http://www.construx.com/File.ashx?cid=816"&gt;staged delivery&lt;/a&gt; lifecycle to build the system, with analysis and architecture upfront, and design and development and testing done in 3-month phases.&lt;/p&gt;

&lt;p&gt;But this approach didn't work once the system was running. Priorities kept changing as we got more feedback from more customers, too many things needed to fixed or tuned right away, and we had to deal with urgent operational issues. We kept interrupting development to deploy interim releases and patches and then re-plan and re-plan again, wasting everyone’s time and making it harder to keep track of what we needed to do. Developers and ops were busy getting customers on and fire fighting which meant we couldn't get changes out when we needed to. So we decided to shorten the release cycle down from 3 months to 1 month, and then shorten it down again to 3 weeks and then 2 weeks, making the releases smaller and more focused and easier to manage.&lt;/p&gt;

&lt;h2&gt;Smaller, more frequent releases changes how Development is done&lt;/h2&gt;

&lt;p&gt;Delivering less but more often, whether you are doing it to reduce time-to-market and get fast feedback in a startup, or to contain risk and manage change in an enterprise, forces you to reconsider how you develop software. It changes how you plan and estimate and how you think about risks and how you manage risks. It changes how you do design, and how much design you need to do. It changes how you test. It changes what tools people need, and how much they need to rely on tools.&lt;/p&gt;

&lt;p&gt;It changes your priorities. It changes the way that people work together and how they work with the customer, creating more opportunities and more reasons to talk to each other and learn from each other. It changes the way that people think and act – because they have to think and act differently in order to keep up and still do a good job.&lt;/p&gt;

&lt;h2&gt;Smaller, more frequent releases changes how Development and Ops work together&lt;/h2&gt;

&lt;p&gt;Changing how often you release and deploy will also change how operations works and how developers and operations work together. There’s not enough time for heavyweight release management and change control with lots of meetings and paperwork. You need an approach that is easier and cheaper. But changing things more often also means more chances to make mistakes. So you need an approach that will reduce risk and catch problems early.&lt;/p&gt;

&lt;p&gt;Development teams that release software once a year or so won’t spend a lot of time thinking about release and deployment and operations stuff in general because they don’t have to. But if they’re deploying every couple of weeks, if they’re constantly having to push software out, then it makes sense for them to take the time to understand what production actually looks like and make deployment  - and roll-back – easier on them and easier on ops.&lt;/p&gt;
 
&lt;p&gt;You don’t have to automate everything to start – and you probably shouldn't until you understand the problems well enough. We started with check lists and scripting and manual configuration and manual system tests. We put everything under source control (not just code), and then started standardizing and automating deployment and configuration and roll-back steps, replacing manual work and check lists with automated audited commands and &lt;a href="http://swreflections.blogspot.com/2012/11/health-checks-run-time-asserts-and.html"&gt;health checks&lt;/a&gt;. We've moved away from manual server setup and patching to managing infrastructure with Puppet. We’re still aligning test and production so that we can test more deployment steps more often with fewer production-specific changes. We still don’t have a one-button deploy and maybe never will, but release and deployment today is simpler and more standardized and safer and much less expensive.&lt;/p&gt;

&lt;h2&gt;Deployment is just the start&lt;/H2&gt;

&lt;p&gt;Improving &lt;a href="http://www.kitchensoap.com/2009/12/12/devops-cooperation-doesnt-just-happen-with-deployment/"&gt;deployment is just the start&lt;/a&gt; of a dialogue that can extend to the rest of operations. Because they’re working together more often, developers and ops will learn more about each other and start to understand each other’s languages and priorities and problems. &lt;/p&gt;

&lt;p&gt;To get this started, we encouraged people to read &lt;a href="http://www.amazon.com/Visible-Ops-Handbook-Implementing-Practical/dp/0975568612"&gt;Visible Ops&lt;/a&gt; and sent ops and testers and some of the developers and even managers on &lt;a href="http://www.pinkelephant.com/Products/Education/Courses/V3F.htm"&gt;ITIL Foundation training&lt;/a&gt; so that we all understood the differences between incident management and problem resolution, and how to do RCA, and the importance of proper change management – it was probably overkill but it made us all think about operations and take it seriously.
We get developers and testers and operations staff together to plan and review releases, and to support production and in &lt;a href="http://swreflections.blogspot.ca/2011/06/moving-forward-from-failure.html"&gt;RCA&lt;/a&gt; whenever we have a serious problem, and we work together to figure out why things went wrong and what we can do to prevent them from happening again. Developers and ops pair up to investigate and solve operational problems and to improve how we design and roll out new architecture, and how we secure our systems and how we set up and manage development and test environments&lt;/p&gt;

&lt;p&gt;It sounds easy. It wasn't. It took a while, and there were disagreements and problems and back sliding, like any time you fundamentally change the way that people work. But if you do this right, people will start to create connections and build relationships and eventually trust and transparency across groups – which is &lt;a href="http://java.dzone.com/articles/john-allspaw-discusses-devops"&gt;what Devops is really about&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;You don’t have to change your organization structure or overhaul the culture – in most cases, you won’t have this kind of mandate anyways. You don’t have to buy into &lt;a href="http://swreflections.blogspot.com/2011/05/continuous-deployment-is-no-holy-grail.html"&gt;Continuous Deployment&lt;/a&gt; or even &lt;a href="http://blogs.forrester.com/jeffrey_hammond/11-09-09-the_relationship_between_dev_ops_and_continuous_delivery_a_conversation_with_jez_humble_of_thought"&gt;Continuous Delivery&lt;/a&gt;, or &lt;a href="http://www.agileweboperations.com/the-implications-of-infrastructure-as-code"&gt;infrastructure as code&lt;/a&gt;, or use &lt;a href="http://www.opscode.com/products/"&gt;Chef&lt;/a&gt; or &lt;a href="https://puppetlabs.com/solutions/devops/"&gt;Puppet&lt;/a&gt; or any other &lt;a href="http://www.devopscon.com/wordpress/presentation/a-devops-jungle-of-tools-infrastructure-vs-deployment-automation/"&gt;Devops tools&lt;/a&gt; – although tools do help.&lt;/p&gt;

&lt;p&gt;Once you start moving faster, from deploying once a year every few months to once a month and as your organization’s pace accelerates, people will change the way that they work because they have to. &lt;/p&gt;

&lt;p&gt;Today the way that we work, and the way that we think about development and operations, is much different and definitely healthier. We can respond to business changes and to problems faster, and at the same time our reliability record has improved dramatically. We didn't set out to “be Agile” – it wasn't until we were on our way to shorter release cycles that we looked more closely at Scrum and XP and later Kanban to see how these methods could help us develop software. And we weren't trying to “do Devops” either – we were already down the path to better dev and ops collaboration before people started talking about &lt;a href="http://www.cmcrossroads.com/article/what-is-devops"&gt;these ideas at Velocity&lt;/a&gt; and wherever else. All we did was agree as a company to change how often we pushed software into production. &lt;a href="http://en.wikisource.org/wiki/The_Road_Not_Taken"&gt;And that has made all the difference&lt;/a&gt;.&lt;/p&gt;




&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/OFBPKHgkbBw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/7168160240871482513/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=7168160240871482513" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7168160240871482513?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7168160240871482513?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/OFBPKHgkbBw/releasing-more-often-drives-better-dev.html" title="Releasing more often drives better Dev and better Ops" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/02/releasing-more-often-drives-better-dev.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4DRXw_eCp7ImA9WhBTEUo.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-6888220678077012614</id><published>2013-02-06T10:22:00.004-08:00</published><updated>2013-02-06T10:22:54.240-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-06T10:22:54.240-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="maintenance" /><category scheme="http://www.blogger.com/atom/ns#" term="code reviews" /><category scheme="http://www.blogger.com/atom/ns#" term="Clean Code" /><title>Code and Code Reviews: What’s in a Name?</title><content type="html">&lt;p&gt;In a &lt;a href="http://swreflections.blogspot.com/2011/05/not-doing-code-reviews-whats-your.html"&gt;code review&lt;/a&gt; a developer needs to look at the code from two different perspectives:
&lt;ol&gt;&lt;li&gt;Correctness. Is the code logically correct, does it do what it is supposed to do? &lt;a href="http://swreflections.blogspot.com/2012/03/defensive-programming-being-just-enough.html"&gt;Will it hold up in the real world&lt;/a&gt;? Is it safe? Does it handle errors and exceptions? Does it check for bad input parameters and return values? Is it secure? And where performance is important, &lt;a href="http://www.coderanch.com/t/202049/Performance/java/code-review-performance"&gt;is it efficient&lt;/a&gt;?&lt;/li&gt;
&lt;li&gt;Maintainability. Can I understand this code well enough to maintain it, could I change it safely myself? Is it readable and consistent? Is the logic too complex, are the pieces too big? Is it unit tested and if not can it be unit tested? This is where a reviewer looks out for &lt;a href="http://swreflections.blogspot.com/2012/03/is-copy-and-paste-programming-really.html"&gt;too much copying and pasting&lt;/a&gt;, whether hand-rolled code could be done using standard libraries or language features instead, adherence to style guidelines and standards.&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;

&lt;p&gt;It’s obvious that using good names for classes and methods and variables is important in making code understandable (if you can’t understand it, you can’t tell if it is doing what it is supposed to do) and easier to maintain. Books like &lt;a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882"&gt;Clean Code&lt;/a&gt; and &lt;a href="http://www.cc2e.com/Default.aspx"&gt;Code Complete&lt;/a&gt; have entire chapters on proper naming. But even good, experienced developers have a hard time coming up with the right abstractions and good, meaningful, &lt;a href="http://www.objectmentor.com/resources/articles/Naming.pdf"&gt;intention-revealing names&lt;/a&gt; for them. It’s especially hard if they’re working on code that they don’t know that well.&lt;/p&gt;

&lt;p&gt;Bad names cause reviewers to stumble, or to make the wrong assumptions about what the code is doing. There are lame names – lazy, ambiguous, generic names that don’t help the reader understand what’s happening in the code. Then there are names which are misleading or just plain wrong – names which used to be right, but aren't now because the logic changed but the name didn't. You’re reading through code, it calls &lt;i&gt;postPayment&lt;/i&gt;, but &lt;i&gt;postPayment&lt;/i&gt; doesn't just post a payment, it does a lot more now – or worse, it doesn't post a payment at all any more.&lt;/p&gt;

&lt;p&gt;Focusing on naming becomes more important over time as more code gets changed more often. The design changes, responsibilities change, often incrementally and subtly. Code gets added, then later other code gets deleted or moved. The programmer making the latest change just wants to focus on what they’re doing, fix the code and get out, and doesn't look at the bigger picture, doesn't notice that the meaning of the code has changed or become less clear because of what they have just done.&lt;/p&gt;

&lt;p&gt;Reviewers need to be on the watch for these kinds of problems.&lt;/p&gt;

&lt;p&gt;But naming isn't just about making it easier for somebody else to read the code and maintain it – or even making it easier for you to read it and change it yourself when you come back to it later. As a colleague of mine has pointed out, if someone can’t come up with a good name for a method or class, it’s a sign that they are having problems understanding what they were working on. So in reviewing code, a bad name is more than just a distraction or an irritation – it’s a warning sign that there could be more problems in the code, that the developer might not have understood the design well enough to make the change correctly, or that they weren't paying close enough attention to what they were working on, and they may have made other mistakes that you – the reviewer – need to be on the lookout for.&lt;/p&gt;

&lt;p&gt;Focusing on naming sometimes seems fussy and nit picky, another battle in the endless “style wars” which end in hand-to-hand fighting over bracket placement and indentation. But good naming is much more important than aesthetics or standardization. It’s about making sure that code is working correctly, and that it will stay that way.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/JfxTKr1ZmeI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/6888220678077012614/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=6888220678077012614" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/6888220678077012614?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/6888220678077012614?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/JfxTKr1ZmeI/code-and-code-reviews-whats-in-name.html" title="Code and Code Reviews: What’s in a Name?" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/02/code-and-code-reviews-whats-in-name.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UDSX45fip7ImA9WhNaFUs.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-4720227121443379929</id><published>2013-01-30T09:01:00.001-08:00</published><updated>2013-01-30T09:01:18.026-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-30T09:01:18.026-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OWASP" /><category scheme="http://www.blogger.com/atom/ns#" term="technical debt" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><title>Appsec and Technical Debt</title><content type="html">&lt;p&gt;&lt;a href="http://swreflections.blogspot.ca/2012/02/technical-debt-how-much-is-it-really.html"&gt;Technical debt&lt;/a&gt; is a fact of life for anyone working in software development: work that needs to be done to make the system cleaner and simpler and cheaper to run over the long term, but that the business doesn't know about or doesn't see as a priority.  This is because technical debt is mostly hidden from the people that use the system: the system works ok, even if there are shortcuts in design that make the system harder for developers to understand and change than it should be; or code that’s hard to read or that has been copied too many times; &lt;a href="http://swreflections.blogspot.ca/2012/12/are-bugs-part-of-technical-debt.html"&gt;maybe some bugs&lt;/a&gt; that the customers don’t know about and that the development team is betting they won’t have to fix; and the platform has fallen behind on patches. &lt;/p&gt;

&lt;p&gt;It’s the same for most application security vulnerabilities. The system runs fine, customers can’t see anything wrong, but there’s something missing or not-quite-right under the hood, and bad things might happen if these problems aren't taken care of in time.&lt;/p&gt;

&lt;h2&gt;Where does Technical Debt come from?&lt;/h2&gt;
&lt;p&gt;Technical debt is the accumulation of many decisions made over the life of a system. &lt;a href="http://martinfowler.com/bliki/TechnicalDebtQuadrant.html"&gt;Martin Fowler has a nice 2x2 matrix&lt;/a&gt; that explains how these decisions add to a system’s debt load:
 
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-9kF1Tz7MxAM/UQlD5qZl7yI/AAAAAAAAAA8/_v5oTKoFsMQ/s1600/techDebtQuadrant.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="240" width="320" src="http://3.bp.blogspot.com/-9kF1Tz7MxAM/UQlD5qZl7yI/AAAAAAAAAA8/_v5oTKoFsMQ/s320/techDebtQuadrant.png" /&gt;&lt;/a&gt;&lt;/div&gt;


I think that this same matrix can be used to understand more about where application security problems come from, and how to deal with them.&lt;/p&gt;
&lt;h2&gt;Deliberate Decisions&lt;/h2&gt;

&lt;p&gt;Many appsec problems come from the top half of the quadrant, where people make deliberate, conscious decisions to short cut security work when they are designing and developing software. This is where the “debt” metaphor properly applies, because someone is taking out a loan against the future, trading off time against cost – making a &lt;a href="http://architects.dzone.com/articles/technical-debt-strategic-vs"&gt;strategic decision&lt;/a&gt; to save time now, get the software out the door knowing that they have taken on risks and costs that will have to be repaid later. &lt;/p&gt;

&lt;p&gt;This is the kind of decision that technology startups make all the time. &lt;a href="http://theleanstartup.com/"&gt;Thinking Lean&lt;/a&gt;, it really doesn't matter if a system is secure if nobody ever uses it. So build out important features first and get customers using them, then take care of making sure everything’s secure later if the company lasts that long. Companies that do make it this far often end up in a vicious cycle of getting hacked, fixing vulnerabilities and getting hacked again until they rewrite a lot of the code and eventually change how they think about security and secure development.&lt;/p&gt;

&lt;p&gt;Whether you are acting recklessly (top left) or prudently (top right) depends on whether you understand what your security and privacy obligations are, and understand what risks you are taking on by not meeting them. Are you considering security in requirements and in the design of the system and in how it’s built? Are you keeping track of the trade-offs that you are making? Do you know what it takes to build a secure system, and are you prepared to build more security in later, knowing how much this is going to cost? &lt;/p&gt;

&lt;p&gt;Unfortunately, when it comes to application security, many of these decisions are made irresponsibly. But there also situations when people don’t know enough about application security to make conscious trade-off decisions, even reckless decisions. They are in the bottom half of the quadrant, making mistakes and taking on significant risks without knowing it.&lt;/p&gt;

&lt;h2&gt;Inadvertent Mistakes&lt;/h2&gt;

&lt;p&gt;Many technical debt problems (and a lot of application security vulnerabilities) are the result of ignorance: from developers not understanding enough about the kind of system they are building or the language or platform that they are using or even the basics of making software to know if they are doing something wrong or if they aren't doing something that they should be doing. This is technical debt that is hidden even from people inside the team. &lt;/p&gt;

&lt;p&gt;When it comes to appsec, there are too many simple things that too many developers still don’t know about, like how to write embedded SQL properly &lt;a href="https://www.owasp.org/index.php/SQL_Injection"&gt;to protect an app from SQL Injection&lt;/a&gt;, or how important data input validation is and &lt;a href="https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet"&gt;how to do it right&lt;/a&gt;, or even how to do something as simple as a &lt;a href="https://www.owasp.org/index.php/Forgot_Password_Cheat_Sheet"&gt;Forgot Password function&lt;/a&gt; without messing it up and creating security holes. When they’re writing code badly without knowing it, they’re in the bottom left corner of the technical debt quadrant – reckless &lt;b&gt;and&lt;/b&gt; ignorant. &lt;/p&gt;

&lt;p&gt;But it’s also too easy for teams who are trying to be responsible (bottom right) to miss things or make bad mistakes, because they don’t understand the black magic of &lt;a href="https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet"&gt;how to store passwords securely&lt;/a&gt; or because they don’t know about &lt;a href="http://michael-coates.blogspot.ca/2010/11/preventing-xss-with-content-security.html"&gt;Content Security Policy protection against XSS&lt;/a&gt; in web apps, or how to use tokens to &lt;a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet#General_Recommendation:_Synchronizer_Token_Pattern"&gt;protect sessions against CSRF&lt;/a&gt;, or any of the many platform-specific and situation-specific security holes that they have to plug. Most developers won’t know about these problems unless they get training, or until they fail an audit or a pen test, or until the system gets hacked, or maybe they will never know about them, whether the system has been hacked or not. &lt;/p&gt;

&lt;h2&gt;Appsec Vulnerabilities as Debt&lt;/h2&gt;

&lt;p&gt;Thinking of application security vulnerabilities as debt offers some new insights, and a new vocabulary when talking with developers and managers who already understand the idea of technical debt. Chris Wysopal at Veracode has gone farther and created a sensible &lt;a href="http://www.veracode.com/blog/2011/02/application-security-debt-and-application-interest-rates/"&gt;application security debt model&lt;/a&gt; that borrows from existing cost models for technical debt, &lt;a href="http://www.veracode.com/blog/2011/03/a-financial-model-for-application-security-debt/"&gt;calculating the cost of latent application security vulnerabilities&lt;/a&gt; based on risk factors: breach probability and potential breach cost.&lt;p&gt;

&lt;p&gt;Financial debt models like this are intended to help people (especially managers) understand the potential cost of technical debt or application security debt, and make them act more responsibly towards managing their debt. But unfortunately tracking debt costs &lt;a href="http://www.usdebtclock.org/"&gt;hasn't helped the world’s major governments face up to their debt obligations&lt;/a&gt; and it doesn't seem to affect &lt;a href="http://en.wikipedia.org/wiki/Household_debt#United_States_household_debt_statistics"&gt;how most individuals manage their personal debt&lt;/a&gt;. And I don't think that &lt;a href="http://swreflections.blogspot.com/2012/12/dont-take-technical-debt-metaphor-too.html"&gt;this approach&lt;/a&gt; will create real change in how businesses think of application security debt or technical debt, or how much effort they will put in to addressing it.&lt;/p&gt;

&lt;p&gt;Too many people in too many organizations have become too accustomed to living with debt, and they have learned to accept it as part of how they work. Paying off debt can always be put off until later, even if later never comes. Adding appsec vulnerabilities to the existing debt that most managers and developers are already dealing with isn't going to get vulnerabilities taken care of faster, even vulnerabilities that have a high “interest cost”. We need a different way to convince managers and developers that application security needs to be taken seriously.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/UGpP-Ro8264" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/4720227121443379929/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=4720227121443379929" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/4720227121443379929?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/4720227121443379929?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/UGpP-Ro8264/appsec-and-technical-debt.html" title="Appsec and Technical Debt" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-9kF1Tz7MxAM/UQlD5qZl7yI/AAAAAAAAAA8/_v5oTKoFsMQ/s72-c/techDebtQuadrant.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/01/appsec-and-technical-debt.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8DRn86eCp7ImA9WhNbGUo.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-7161920211928192876</id><published>2013-01-23T12:44:00.001-08:00</published><updated>2013-01-23T12:44:37.110-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-23T12:44:37.110-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="DAD" /><category scheme="http://www.blogger.com/atom/ns#" term="agile" /><category scheme="http://www.blogger.com/atom/ns#" term="XP" /><category scheme="http://www.blogger.com/atom/ns#" term="Scrum" /><category scheme="http://www.blogger.com/atom/ns#" term="design" /><category scheme="http://www.blogger.com/atom/ns#" term="architecture" /><category scheme="http://www.blogger.com/atom/ns#" term="agile development" /><title>Design Doesn't Emerge from Code</title><content type="html">&lt;p&gt;I know a lot of people who are transitioning to Agile or already following Agile development methods. Almost all of them are using something &lt;a href="http://swreflections.blogspot.ca/2012/11/why-scrum-won.html"&gt;based on Scrum at the core&lt;/a&gt;, mixed with common XP practices like Continuous Integration and refactoring and automated unit testing – pretty much how Mike Cohn says things should be done in his book &lt;a href="http://www.amazon.com/Succeeding-Agile-Software-Development-Using/dp/0321579364"&gt;Succeeding with Agile&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Emergent Design in Scrum and XP&lt;/h2&gt;

&lt;p&gt;But none of them are doing &lt;a href="http://www.mountaingoatsoftware.com/blog/agile-design-intentional-yet-emergent"&gt;emergent design&lt;/a&gt; as Cohn describes it, or as Kent Beck explains how design is done in &lt;a href="http://www.amazon.com/Extreme-Programming-Explained-Embrace-Change/dp/0201616416"&gt;Extreme Programming&lt;/a&gt;: trying to get away without any upfront design and architecture work, coding features right away and relying on &lt;a href="http://www.extremeprogramming.org/rules/testfirst.html"&gt;test-first development&lt;/a&gt;, &lt;a href="http://www.extremeprogramming.org/rules/refactor.html"&gt;refactoring&lt;/a&gt; and &lt;a href="http://www.extremeprogramming.org/rules/spike.html"&gt;technical spikes&lt;/a&gt; to work out a design on the fly, one week or two weeks at a time.
&lt;blockquote&gt;“For the first iteration, pick a set of simple, basic stories that you expect will force you to create the whole architecture. Then narrow your horizon and implement the stories in the simplest way that can possibly work. At the end of this exercise you will have your architecture. It may not be the architecture you expected, but then you will have learned something.” &lt;nl&gt;Kent Beck
&lt;/blockquote&gt;&lt;/p&gt;

&lt;h2&gt;You don’t need upfront architecture and design?&lt;/h2&gt;

&lt;p&gt;Maybe it’s because everyone I know is working at scale – building big enterprise systems and online systems used by lots of customers, systems that have a lot of constraints and dependencies. Many of them are working on &lt;a href="http://stackoverflow.com/questions/1459941/what-are-greenfield-and-brownfield-applications"&gt;brownfield projects&lt;/a&gt; where you need to understand the existing system’s design and implementation first, before you can come up with a new design and before you can make any changes. Performance-critical, mission-critical systems in highly-regulated environments. &lt;/p&gt;

&lt;p&gt;Emergent, incremental design doesn’t work for these cases. And it doesn’t scale to large projects or any project that has to be delivered along with other projects and that has specified integration points and dependencies – which is pretty much every project that I've ever worked on.&lt;/p&gt;

&lt;p&gt;Bob Martin, another one of the people who helped define how Agile development should be done, &lt;a href="https://sites.google.com/site/unclebobconsultingllc/home/articles/the-scatology-of-agile-architecture"&gt;thinks that this incremental approach to design is, well&lt;/a&gt;…
&lt;blockquote&gt;“One of the more insidious and persistent myths of agile development is that up-front architecture and design are bad; that you should never spend time up front making architectural decisions. That instead you should evolve your architecture and design from nothing, one test-case at a time.
Pardon me, but that’s Horse Shit.”
&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Martin goes on to say that
&lt;blockquote&gt;“there are architectural issues that need to be resolved up front. There are design decisions that must be made early. It is possible to code yourself into a very nasty cul-de-sac that you might avoid with a little forethought.”
&lt;/blockquote&gt;&lt;/p&gt;

&lt;h2&gt;Architecture and Design in Disciplined Agile Delivery&lt;/h2&gt;

&lt;p&gt;The way that most people that I know approach Agile development is better described by Scott Ambler in &lt;a href="http://www.amazon.com/Disciplined-Agile-Delivery-Practitioners- Enterprise/dp/0132810131"&gt;Disciplined Agile Delivery&lt;/a&gt;, a model for scaling Agile to larger systems, projects and organizations. As Ambler’s research shows, &lt;a href="http://www.drdobbs.com/architecture-and-design/disciplined-agile-architecture/240007451"&gt;almost all teams (86%)&lt;/a&gt; spend at least some time (on average a month or more) on upfront on planning, scoping and architecture envisioning – what he calls the &lt;a href="http://disciplinedagiledelivery.wordpress.com/2012/10/01/potential-misconceptions-about-agile-architecture/"&gt;“Inception Phase”&lt;/a&gt; (borrowing from Rational’s &lt;a href="http://en.wikipedia.org/wiki/Unified_Process"&gt;Unified Process&lt;/a&gt;) or what most others call “Sprint 0” or “&lt;a href="http://www.netobjectives.com/files/IterationZero.pdf"&gt;Iteration 0&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;This is time spent to understand the scope of the system at a high-level at least, and the constraints and dependencies that the project needs to work within. Time to model the main chunks of the system and their interfaces, and to choose a technical direction to start with.&lt;/p&gt;

&lt;p&gt;Upfront architectural and design work doesn't have to take &lt;a href="http://c2.com/cgi/wiki?BigDesignUpFront"&gt;a lot of time&lt;/a&gt;. As Ambler points out, for many teams (except for some startups), a lot of architectural decisions have already been made for you:
&lt;blockquote&gt;“In practice, it’s likely you won’t need to do much initial architectural modeling: a large majority of project teams work with technical architecture decisions that were made years earlier. Your organization will most likely already have chosen a network infrastructure, an application-server platform, a database platform, and so on. In these situations your team will need to invest the time to understand those decisions and to consider whether the existing infrastructure build-out is sufficient (and if not, identify potential improvements).”
&lt;/blockquote&gt;It’s when you have a real greenfield development project, when you don’t have anything to leverage and you’re doing something completely new, that you should spend more time on upfront thinking about design – not less.&lt;/p&gt;

&lt;h2&gt;Can you “be Agile” without Emergent Design?&lt;/h2&gt;

&lt;p&gt;Of course you can. Bob Martin points out that there’s nothing in “Agile Development” that says that you shouldn't do design upfront – as much design as you need to for the size of the system that you are building and the environment that you are working in. &lt;/p&gt;

&lt;p&gt;You can and should do iterative, incremental design and development starting with a plan of where you are going and how you think that you are going to get there.  As you go along and prove out your design and respond to feedback and deal with changes in requirements, this is where incremental design actually does come into play – handling changes in direction, filling in gaps, correcting misunderstandings. The design will change and maybe become something that you didn't expect. But you need a place to start from – designs don’t just emerge from code.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/acitLNGYb-0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/7161920211928192876/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=7161920211928192876" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7161920211928192876?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/7161920211928192876?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/acitLNGYb-0/design-doesnt-emerge-from-code.html" title="Design Doesn't Emerge from Code" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/01/design-doesnt-emerge-from-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEGRH8yfSp7ImA9WhNbFEk.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-1950957678665444401</id><published>2013-01-17T09:10:00.000-08:00</published><updated>2013-01-17T09:10:25.195-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-17T09:10:25.195-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Frankensystems" /><category scheme="http://www.blogger.com/atom/ns#" term="Continuous Delivery" /><category scheme="http://www.blogger.com/atom/ns#" term="technical debt" /><category scheme="http://www.blogger.com/atom/ns#" term="architecture" /><category scheme="http://www.blogger.com/atom/ns#" term="refactoring" /><category scheme="http://www.blogger.com/atom/ns#" term="Continuous Deployment" /><title>Frankensystems, Half-Strangled Zombies and other Monsters</title><content type="html">&lt;p&gt;There are lots of ugly things that can happen to a system over time. This is what the arguments over &lt;a href="http://swreflections.blogspot.com/2012/02/technical-debt-how-much-is-it-really.html"&gt;technical debt&lt;/a&gt; are all about – how to keep code from getting ugly and fragile and hard to understand and more expensive to maintain over time, because of sloppiness and short-sighted decision making. But some of the ugliest things that happen to code don’t have anything to do with technical debt. They’re the result of conscious and well-intentioned design changes. &lt;p&gt;

&lt;h2&gt;Well-Intentioned Changes can create Ugly Code&lt;/h2&gt;

&lt;p&gt;Bad things can happen when you decide to re-architect or rewrite a system, or start some &lt;a href="http://www.infoq.com/news/2010/08/large-scale-refactoring"&gt;large-scale refactoring&lt;/a&gt;, but you don’t get the job done. Other more important work comes up before you can finish transitioning all of the code over to the new design or the new platform – or maybe that was never going to happen anyways, because you didn't have the budget and the mandate to do the whole job in the first place. Or the somebody who started the work leaves, and nobody else understands their vision well enough to carry it through – or nobody that’s left cares about it enough to finish it. Or you get just far enough to solve whatever problems your or the customer really cared about, and there’s no good business case to keep going.&lt;/p&gt;

&lt;p&gt;Now you’re left with what a colleague of mine calls a “Frankensystem”: different designs and different platforms spliced together in a way that works but that is horribly difficult to understand and maintain.&lt;/p&gt;

&lt;p&gt;Why does this happen? How do you stop your system from turning into a monster like this?&lt;/p&gt;

&lt;h2&gt;Branching by Abstraction&lt;/h2&gt;

&lt;p&gt;One way that code can get messed up, in the short-term at least, is through &lt;a href="http://paulhammant.com/blog/branch_by_abstraction.html"&gt;Branching by Abstraction&lt;/a&gt;, an idea that has become popular in shops that &lt;a href="http://www.facebook.com/note.php?note_id=96390263919"&gt;Dark Launch&lt;/a&gt; changes through &lt;a href="http://swreflections.blogspot.com/2011/05/continuous-deployment-is-no-holy-grail.html"&gt;Continuous Deployment&lt;/a&gt; or &lt;a href="http://continuousdelivery.com/"&gt;Continuous Delivery&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In Branching by Abstraction (also known as “branching in code”), instead of creating a feature branch to isolate code changes, and then &lt;a href="http://stackoverflow.com/questions/1522775/branching-and-merging-strategies"&gt;merging the changes back when you’re done&lt;/a&gt;, everyone works in trunk. If you need to make bigger code changes, you start by writing temporary scaffolding (abstraction layers, conditional logic, configuration code like &lt;a href="http://paulstack.co.uk/blog/post/feature-switching-a-better-way-to-collaborate.aspx"&gt;feature switches&lt;/a&gt;) to isolate the changes that you’ll need to make, and then you can make your changes directly in the code mainline in small, incremental steps. The &lt;a href="http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/"&gt;scaffolding serves to protect&lt;/a&gt; the rest of the system from the impact of your changes until all of the work is complete.&lt;/p&gt;

&lt;p&gt;Branching by Abstraction tries to address problems with managing the &lt;a href="http://martinfowler.com/bliki/FeatureBranch.html"&gt;misuse of feature branches&lt;/a&gt; (especially long-lived branches) – if you don’t let developers branch, then you don’t have to figure out how to keep all of the branches in sync and manage merge conflicts. But with Branching by Abstraction, until the work is complete and the temporary scaffolding code removed, the code will be harder to maintain and understand, and more brittle and error-prone, as &lt;a href="http://jamesmckay.net/2011/07/why-does-martin-fowler-not-understand-feature-branches/"&gt;James McKay points out&lt;/a&gt;:

&lt;blockquote&gt;“…visible or not, you are still deploying code into production that you know for a fact to be buggy, untested, incomplete and quite possibly incompatible with your live data. Your if statements and configuration settings are themselves code which is subject to bugs – and furthermore can only be tested in production. They are also a lot of effort to maintain, making it all too easy to fat-finger something. Accidental exposure is a massive risk that could all too easily result in security vulnerabilities, data corruption or loss of trade secrets. Your features may not be as isolated from each other as you thought you were, and you may end up deploying bugs to your production environment”.&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;If you decide to branch in code like this (we do branching in code in some cases, and feature branching in others – branching in code is good for rolling out behind-the-scenes plumbing changes, not so good for big functional changes), be careful. Review your scaffolding to ensure that your code changes are completely isolated, and test with old and new configurations (switches off and on) to check for regressions. Minimize the number of changes that the team rolls out at one time, so that there’s no chance of changes overlapping or colliding. And to keep Branching by Abstraction from becoming a maintenance nightmare, make sure that you remove temporary scaffolding as soon as you are done with it.&lt;/p&gt;

&lt;h2&gt;Half-Strangled Zombies&lt;/h2&gt;

&lt;p&gt;Branching by Abstraction can lead to ugly code, at least for the few weeks or months that it will take to roll out each change. But things can get much worse in the code if you try to do a major rewrite or re-architecture of a system incrementally, for example &lt;a href="http://martinfowler.com/bliki/StranglerApplication.html"&gt;“strangling” the existing system&lt;/a&gt; with new code and a new design (another approach coined by ThougtWorks), and &lt;a href="http://www.pols.co.uk/archives/63"&gt;slowly suffocating the old system&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Strangling a system lets you introduce a new design or change over to a new and modern platform without having to finish a long and expensive rewrite first. The strangling work is done in parallel, usually by a separate team, letting the rest of the team to maintain the old code – which of course means that both teams need to keep in sync as changes and fixes are made.&lt;/p&gt;

&lt;p&gt;But if you don’t finish the job, you’ll be left with a kind of zombie, a scary half-dead and half-alive thing with ugly seams showing, as &lt;a href="http://www.natpryce.com/"&gt;Nat Pryce&lt;/a&gt; warns against in &lt;a href="http://stackoverflow.com/questions/1118804/application-strangler-pattern-experiences-thoughts"&gt;this Stack Overflow post&lt;/a&gt;:

&lt;blockquote&gt;"The biggest problem to overcome is lack of will to actually finish the strangling (usually political will from non-technical stakeholders, manifested as lack of budget). If you don't completely kill off the old system, you'll end up in a worse mess because your system now has two ways of doing everything with an awkward interface between the two. Later, another wave of developers will probably decide to strangle what's there, writing yet another strangler application, and again a lack of will might leave the system in an even worse state, with three ways of doing things….
&lt;br&gt;
&lt;br&gt;
I've seen critical systems that have suffered both of these fates, and ended up with about four or five "strategic architectural directions" and "future state architectures". One large multi-site project ended up with eight different new persistence mechanisms in its new architecture. Another ended up with two different database schemas, one for the old way of doing things and another for the new way, neither schema was ever removed from the system and there were also multiple class hierarchies that mapped to one or even both of these schemas."
&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Strangling, and other incremental strategies for re-architecting a system, will let you start showing benefits to the customer early, before all of the work of writing the new system is done. This is both an advantage and a problem. Because once the customer starts to get what they really care about (some nice new screens or mobile access channels or better performance or faster turnaround on rules changes or…) you may not be able to make the business case to finish up the work that’s left. Everyone understands (or should) that this means you’re stuck with some inconsistencies – on the inside certainly, and maybe on the outside too. But whatever is there does the job, and keeping this mess running may cost a lot less than finishing the rewrite, at least in the short term. &lt;/p&gt;

&lt;h2&gt;Frankensystems and Zombies are Everywhere&lt;/h2&gt;

&lt;p&gt;Monster-making happens more often than it should to big systems, especially big, mission-critical systems that a lot of different people have worked on over a long time. As Pryce warns, it can even happen multiple times over the life of a big system, so that you end up with several half-realized architectures grafted together, creating all kinds of nasty maintenance and understanding problems. &lt;p&gt;

&lt;p&gt;When making changes or adding features, developers will have to decide whether to do it the old way or the new way (or the other new way) – or sometimes they will need to do both, which means working across different architectures, using different tools and different languages, and often having to worry about keeping different data models in sync. This complexity means it’s easy to make mistakes or miss or misunderstand something, and testing can be even uglier than the coding.&lt;/p&gt;

&lt;p&gt;You need to recognize these risks when you start down the path of incrementally changing a system’s direction and design – even if you believe you have the commitment and time to finish the job properly. Because there’s a good chance that you’ll end up creating a monster that you will have to live with for years.&lt;p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/zKda5eIKSL0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/1950957678665444401/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=1950957678665444401" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1950957678665444401?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/1950957678665444401?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/zKda5eIKSL0/frankensystems-half-strangled-zombies.html" title="Frankensystems, Half-Strangled Zombies and other Monsters" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/01/frankensystems-half-strangled-zombies.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MEQ30_fSp7ImA9WhNbEUU.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-3364584323859643456</id><published>2013-01-14T10:48:00.000-08:00</published><updated>2013-01-14T10:50:02.345-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-14T10:50:02.345-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SANS" /><category scheme="http://www.blogger.com/atom/ns#" term="testing" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><title>Security Testing: Less, but More Often, can make a Big Difference</title><content type="html">Some interesting findings from the &lt;a href="https://www.sans.org/reading_room/analysts_program/sans_survey_appsec.pdf"&gt;2012 SANS Appsec Security Survey&lt;/a&gt;: almost 1/4 of companies are testing their software on an ongoing, near-continuous basis. How are they doing this, and what does this mean to how applications can be developed and should be tested? Check out my latest post on the SANS Application Street Fighter Blog - "&lt;a href="http://software-security.sans.org/blog/2013/01/14/security-testing-less-but-more-often-can-make-a-big-difference"&gt;Security Testing: Less, but More Often can make a Big Difference&lt;/a&gt;".&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/GDFZJAToL6g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/3364584323859643456/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=3364584323859643456" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3364584323859643456?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3364584323859643456?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/GDFZJAToL6g/security-testing-less-but-more-often.html" title="Security Testing: Less, but More Often, can make a Big Difference" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/01/security-testing-less-but-more-often.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUHSXc6cSp7ImA9WhNUF0g.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-2292226244504567498</id><published>2013-01-09T10:47:00.002-08:00</published><updated>2013-01-09T10:47:18.919-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-09T10:47:18.919-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="DAD" /><category scheme="http://www.blogger.com/atom/ns#" term="agile" /><category scheme="http://www.blogger.com/atom/ns#" term="reliability" /><category scheme="http://www.blogger.com/atom/ns#" term="Scrum" /><category scheme="http://www.blogger.com/atom/ns#" term="management" /><title>Hardening Sprints. What are they? Do you need them?</title><content type="html">&lt;p&gt;For anyone who is developing software using Scrum, XP or another incremental development approach, the idea of a “hardening sprint” or a “release iteration” is bound to come up. But people disagree about what a “hardening sprint” should include, when you need to do one, and if you should do them at all. There is a deep divide between people who recognize that spending some time on hardening is needed for many environments, and people who are adamant that allocating some time for hardening is a sign that you are doing some things – or everything – wrong.&lt;/p&gt;

&lt;h2&gt;Hardening to make sure that Done means Done&lt;/h2&gt;

&lt;p&gt;In a hardening sprint, the team stops focusing on delivering new features or architecture, and instead spends their time on stabilizing the system and getting it ready to be released.&lt;/p&gt; 

&lt;p&gt;For some people, hardening sprints are for completing testing and fixing work that couldn't be done – or didn't get done – earlier. This might include UAT or other final acceptance testing if this is built into a contract or governance model.&lt;/p&gt;

&lt;p&gt;Mike Cohn recognizes that teams may need a &lt;a href="http://www.mountaingoatsoftware.com/blog/correct-use-of-a-release-sprint"&gt;“release sprint”&lt;/a&gt; at the end of each release cycle, because the team’s definition of “done” may not be enough – that a &lt;a href="http://www.infoq.com/news/2008/02/done-shippable-quality"&gt;"potentially shippable product"&lt;/a&gt; and a system that is actually “shippable” or ready for production aren't the same thing. He suggests that after every 3-5 feature iterations, the team may want to schedule a release sprint to do work like expensive manual system and integration testing and extra reviews, whatever is needed to make sure that what they think is done, is actually done.&lt;/p&gt;

&lt;p&gt;Anand Viswanath, in &lt;a href="http://blog.anandvishwanath.in/2011/09/end-of-regression-stabilisationhardenin.html"&gt;“The end of regression, stabilisation, hardening or release sprints”&lt;/a&gt;, describes a common approach where teams schedule 1 or 2 stabilization sprints every 4-6 iterations to do regression testing and system testing in a staging environment, and then fix whatever bugs are found. As he points out, it’s hard to predict how much testing might be required and long it will take to fix whatever problems are found, so the idea is to time box this work and then triage the results. &lt;/p&gt;

&lt;p&gt;Because this can be an expensive and risky and stressful way to work, Vishwanath recommends following &lt;a href="http://continuousdelivery.com/"&gt;Continuous Delivery&lt;/a&gt; to build an automated test pipeline through to staging in order to catch as many problems as early as possible. This is a good idea, but most large projects, especially projects starting from a legacy code base, will still probably need some kind of hardening or integration testing phase at regular points regardless of what kind of continuous testing they are doing. &lt;/p&gt;

&lt;p&gt;Some testing, like interoperability testing with other systems and operational testing, can’t be done effectively until later, when there is enough of a working system to do end-to-end testing, and some of this testing can only be done in staging (if you have a staging environment), or in production. For some systems, load testing and stress testing and soak testing also needs to be left to later, because these teams don’t have access to a big enough test system to run high load scenarios before they get to production.&lt;/p&gt;

&lt;h2&gt;Is Hardening a sign that you aren't doing things right?&lt;/h2&gt;

&lt;p&gt;Not everyone thinks that scheduling a hardening sprint for testing and fixing like this is a good idea:

&lt;blockquote&gt; “[a hardening sprint] might take the cake for stupid things invented that has lead to institutionalized delusion and ‘Agile’ dysfunction.”
Janelle Klein, &lt;a href="http://janelleklein.blogspot.ca/2011/04/who-came-up-with-hardening-sprint.html"&gt;Who Came up with the “Hardening Sprint”?&lt;/a&gt;&lt;/blockquote&gt;

For many people, a &lt;a href="http://scrumplus.blogspot.ca/2011/10/process-smell-hardening-sprint.html"&gt;hardening sprint or release sprint is a bad “process smell”&lt;/a&gt;: a sign that the team isn't working properly or thinking clearly: 
&lt;blockquote&gt;“The problem with “hardening sprints” is that you are lying. You make believe your imaginary burndown during the initial sprints shows that you are approaching Done. But it’s a lie--you aren't getting any closer to being ready for Production until you begin your Test phase. You wrote a pile of code that you didn't test adequately. You don’t know how good it is, you don’t know how much work you have left to do, and you don’t know how much longer it will take, until you are deep into your Test phase.”
Richard Kasperowski, &lt;a href="http://kasperowski.com/2010/09/hardening-sprints-sorry-youre-not-agile.html"&gt;Hardening sprints? Sorry, you’re not Agile&lt;/a&gt;
&lt;/blockquote&gt;&lt;/p&gt;


&lt;p&gt;Ron Jeffries says that a &lt;a href="https://groups.google.com/forum/?fromgroups=#!topic/scrumalliance/_huCoEZBSZg"&gt;hardening sprint for testing and fixing is a clear anti-pattern&lt;/a&gt;. I agree: if you need a separate sprint to fix bugs, then you’re doing something wrong. But that doesn't mean that you won’t need extra time to fix things before the system goes live – knowing that it is wrong doesn't make the bugs go away, you still have to fix them. As somebody else on this same discussion thread points out, there is a risk that your “definition of done” could fall short of what is actually needed by the customer, so you should plan for 1 or more hardening sprints before release, to double-check and stabilize things, just in case.&lt;/p&gt;

&lt;p&gt;In these cases, the need for hardening sprints is a sign of a team’s immaturity (&lt;a href="http://every2weeks.wordpress.com/2008/03/20/indicators-of-agile-maturity/"&gt;from a post by Paul Beavers&lt;/a&gt;):
&lt;ol&gt;&lt;li&gt;A beginning agile team will prefer to schedule 6 hardening iterations after a 12 iteration development plan. This is “agile” to the hard core “waterfall guy”.&lt;/li&gt;
&lt;li&gt;As time goes by, the team will mature a bit and you will see the seasoned agile team will shrink the number of required hardening iterations at the end, just because they understand they need to “fix” the high severity bugs as they go and QA understands they need to test closer and better early up in the release cycle. &lt;/li&gt;
&lt;li&gt;Further down the road the team will notice that by adding a hardening iteration in the middle of the development cycle (and flushing out even lesser priority bugs earlier on in the process), it will help them to maintain cadence later on.&lt;/li&gt;
&lt;li&gt;The final step of maturity is there when the team starts understanding “hardening is not required any more”, because they made fixing bugs part of their daily routines.&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;


&lt;h2&gt;Hardening is whatever you need to do to Make the System Ready for Production&lt;/h2&gt;

&lt;p&gt;Another way of looking at hardening, is that this is when you stop thinking about features and focus all of your time on the detailed steps of deploying, installing and configuring the system and making sure that everything is working from end-to-end. In a hardening sprint, your most important customers are operations and support, the people who are going to make sure that the system is running, rather than the end users. &lt;/p&gt;

&lt;p&gt;For some teams, this kind of hardening can come as an ugly and expensive surprise, after they understand that what they need to do is to &lt;a href="http://blog.abakas.com/2012/01/hardening-myth.html"&gt;take a working functional prototype and make it ready for the real world&lt;/a&gt;:
&lt;blockquote&gt;“All those things that got skipped in the first phase - error handling, monitoring, administration - need to get put into the product.”
Catherine Powell, The "Hardening Myth"
&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;But a hardening sprint can also be when when you take care of what &lt;a href="https://www.owasp.org/index.php/SAMM_-_Environment_Hardening_-_1"&gt;operations calls hardening&lt;/a&gt;: reviewing and preparing the production environment and securing the run-time, tightening up access to production data, double-checking system and application configs, making sure that auditing is enabled properly, wiring the system in to operations monitoring and metrics collection, checking system dependencies like platform software versions and patch levels (and making sure that all of the systems are consistent, that there aren't any &lt;a href="http://martinfowler.com/bliki/SnowflakeServer.html"&gt;snowflakes&lt;/a&gt;), completing final security reviews and other review and release gates, and making sure that the people installing and running the software have the correct instructions.This is also when you need to prepare your roll-back plan or recovery plan if something bad happens with the release, and test your roll-back and recovery steps. Walk through and rehearse the release process and checklists, and make sure that everyone is prepared to roll out patches quickly after the release is done.&lt;/p&gt;

&lt;h2&gt;Hardening is something that you have to do&lt;/h2&gt;

&lt;p&gt;Some people see an obvious need for hardening sprints. For example, Dean Leffingwell includes hardening sprints in his &lt;a href="http://scaledagileframework.com/"&gt;“Scaled Agile Framework”&lt;/a&gt;, because there is &lt;a href="http://scalingsoftwareagilityblog.com/scaled-agile-framework-hardening-iteration/"&gt;some work that can only really be done in a final hardening phase&lt;/a&gt;:&lt;ul&gt;&lt;li&gt;Final exploratory and field testing&lt;/li&gt;
&lt;li&gt;Checklist validation against release, QA and standards governance&lt;/li&gt;
&lt;li&gt;Release signoffs if you need them&lt;/li&gt;
&lt;li&gt;Ops documentation&lt;/li&gt;
&lt;li&gt;Deployment package&lt;/li&gt;
&lt;li&gt;Communicate release to everyone (hard to do in big companies)&lt;/li&gt;
&lt;li&gt;Traceability etc for high assurance and regulatory compliance &lt;/li&gt;&lt;/ul&gt;
Leffingwell makes it clear that hardening shouldn't include system integration, fixing high priority bugs,  automating test scripts, user documentation, regression testing and code cleanup. There is other work that should be done earlier – but in the first year or so, will probably need to be done in a late hardening phase:
&lt;ul&gt;&lt;li&gt;Cross-component integration, integration with third-party/customer&lt;/li&gt;
&lt;li&gt;Integrated system-level testing&lt;/li&gt;
&lt;li&gt;Final QA sign-offs&lt;/li&gt;
&lt;li&gt;User doc finalization&lt;/li&gt;
&lt;li&gt;Localization&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;Dan Rawsthorne explains that teams need at least one &lt;a href="http://blogs.collab.net/agile/release-sprint"&gt;release sprint&lt;/a&gt; at first to get ready for release to production, because until you've actually done it, you don’t really know what you need to do. Release sprints include tasks like:
&lt;ul&gt;&lt;li&gt;Exploratory testing to double check that key features are working properly&lt;/li&gt;
&lt;li&gt;Stress testing/load testing/performance testing – testing that is expensive to setup and do&lt;/li&gt;
&lt;li&gt;Interoperability testing with other production systems&lt;/li&gt;
&lt;li&gt;Fix whatever comes out of this testing&lt;/li&gt;
&lt;li&gt;Review and finish off any documentation&lt;/li&gt;
&lt;li&gt;Train support and sales and customers on new features&lt;/li&gt;
&lt;li&gt;Help with press releases and other marketing material&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://"&gt;Software Project Manager’s Bridge to Agility&lt;/a&gt; anticipates that teams will need at least a short hardening iteration before the system is ready for release, even if they frontload as much testing as possible. A release iteration is not a test-fix phase – it’s when you prepare for the release: capturing screenshots for marketing materials, final tests, small tweaks, finish documentation for whoever needs it, training. The authors suggest however that if some developers have any time left over in the release iteration, they can do some refactoring and other cleanup – which I think is bad advice, given that at this point you don’t want to be introducing any new variables or risks.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://disciplinedagiledelivery.wordpress.com/2012/02/08/why-are-there-phases/"&gt;Disciplined Agile Delivery&lt;/a&gt;, a method that was developed by Scott Ambler at IBM to scale Agile practices to large organizations and large projects, includes a Transition Phase before each release to take care of:
&lt;ul&gt;&lt;li&gt;Transition planning and coordination&lt;/li&gt;
&lt;li&gt;End-of-lifecycle testing and fixing &lt;/li&gt;
&lt;li&gt;Testing and rehearsing deployment&lt;/li&gt;
&lt;li&gt;Data setup and migration&lt;/li&gt;
&lt;li&gt;Pilots and beta testing (short UAT if necessary)&lt;/li&gt;
&lt;li&gt;Reviewing and finalizing documentation&lt;/li&gt;
&lt;li&gt;Preparing operations and support&lt;/li&gt;
&lt;li&gt;Stakeholder training&lt;/li&gt;&lt;/ul&gt;
This kind of transition can take almost no time, or it can take several weeks, depending on the situation.&lt;/p&gt;

&lt;p&gt;Hardening – taking some time to make sure that the system is really ready to be released – can’t be avoided. The longer your release cycles, the further away development is from day-to-day production, the more hardening you need. Even if you've been doing disciplined testing and reviews in stream, you’re going to find some problems at the end. Even if you planned ahead for transition, you’re going to run into operational details that you didn't know about or didn't understand until the end.&lt;/p&gt;

&lt;p&gt;When we first launched our platform from startup, we had to do hardening and stabilization work before going live to get the system ready, and some more work afterwards to deal with operational issues and requirements that we weren't prepared for. We included time at the end of subsequent releases for extra testing, deployment and roll back planning, and release coordination. &lt;/p&gt;

&lt;p&gt;But as we shortened our release cycle, releasing less but more often, and as we built more fail-safes into the system and as we learned more about what we needed to do in ops, and as we invested more in simplifying and automating deployment and everything else that we could, we found that we didn't need time any outside of our regular iterations for hardening. We’re still doing hardening – but now this is part of the day-to-day job of building and releasing software.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/ChcFXgE54qM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/2292226244504567498/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=2292226244504567498" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/2292226244504567498?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/2292226244504567498?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/ChcFXgE54qM/hardening-sprints-what-are-they-do-you.html" title="Hardening Sprints. What are they? Do you need them?" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/01/hardening-sprints-what-are-they-do-you.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQHQHY8eCp7ImA9WhNUEk4.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-696139718073183147</id><published>2013-01-03T09:32:00.000-08:00</published><updated>2013-01-03T09:32:11.870-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-03T09:32:11.870-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="risk management" /><category scheme="http://www.blogger.com/atom/ns#" term="Construx" /><category scheme="http://www.blogger.com/atom/ns#" term="maintenance" /><category scheme="http://www.blogger.com/atom/ns#" term="management" /><title>Classic Mistakes in Software Development and Maintenance</title><content type="html">&lt;p&gt;&lt;blockquote&gt;…the only difference between experienced and inexperienced developers is that the experienced ones realize when they’re making mistakes.&lt;br&gt; 
Jeff Atwood, &lt;a href="http://www.codinghorror.com/blog/2007/06/escaping-from-gilligans-island.html"&gt;Escaping from Gilligan’s Island&lt;/a&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;An important part of risk management, and responsible management at all, is making sure that you aren't doing anything obviously stupid. Steve McConnell’s list of &lt;a href="http://www.construx.com/Page.aspx?cid=2537"&gt;Classic Mistakes&lt;/a&gt;is a place to start: a list of common basic mistakes in developing software and in managing development work, mistakes that are made so often, by so many people, that we all need to be aware of them. &lt;/p&gt;

&lt;p&gt;McConnell originally created this list in 1996 for his book &lt;a href="http://www.stevemcconnell.com/rd.htm"&gt;Rapid Development&lt;/a&gt; (still one of the best books on managing software development). The original list of 36 mistakes was updated in 2008 to a total of 42 common mistakes based on a survey of more than 500 developers and managers. The  mistakes that have the highest impact, the mistakes that will most likely led to failure, are:
&lt;ol&gt;&lt;li&gt;Unrealistic expectations&lt;/li&gt;
&lt;li&gt;Weak personnel&lt;/li&gt;
&lt;li&gt;Overly optimistic schedules&lt;/li&gt;
&lt;li&gt;Wishful thinking&lt;/li&gt;
&lt;li&gt;Shortchanged QA&lt;/li&gt;
&lt;li&gt;Inadequate design&lt;/li&gt;
&lt;li&gt;Lack of project sponsorship&lt;/li&gt;
&lt;li&gt;Confusing estimates with targets&lt;/li&gt;
&lt;li&gt;Excessive multi-tasking&lt;/li&gt;
&lt;li&gt;Lack of user involvement&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;

&lt;p&gt;Most of the mistakes listed have not changed since 1996 (and were probably well known long before that). Either they’re fundamental, or as an industry we just aren't learning, or we don’t care. Or we can't find the time or secure a mandate to do things right, because of the relentless focus on short-term results:

&lt;blockquote&gt;Stakeholders won’t naturally take a long-term view: they tend to minimize the often extreme down-the-road headaches that result from the cutting of corners necessitated by the rush, rush, rush mentality. They’ll drive the car without ever changing the oil.&lt;br&gt;
Peter Kretzman, &lt;a href="http://www.peterkretzman.com/2008/01/07/software-developments-classic-mistakes-and-the-role-of-the-ctocio/"&gt;Software development’s classic mistakes and the role of the CTO/CIO&lt;/a&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;The second most severe mistake that a development organization can make is to staff the team with weak personnel: hiring fast or cheap rather than holding out for people who have more experience and better skills, but who cost more. Although the impact of making this mistake is usually severe, it happens in only around half of projects – most companies aren't stupid enough to staff a development team with weak developers, at least not a big, high-profile project. &lt;/p&gt;

&lt;h2&gt;Classic Mistakes in Software Maintenance&lt;/h2&gt;

&lt;p&gt;But a lot of companies staff maintenance teams this way, with noobs and maybe a couple of burned out old-timers who are putting in their time and willing to deal with the demands of maintenance until they retire.

&lt;blockquote&gt;You get stuck in maintenance only if you are not good enough to work on new projects. After spending millions of dollars and many developer-years of effort on creating an application, the project is entrusted to the care of the lowest of the low. Crazy!&lt;br&gt;
Pete McBreen, &lt;a href="http://www.mcbreen.ab.ca/SoftwareCraftsmanship/"&gt;Software Craftsmanship&lt;/a&gt;
&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Capers Jones (&lt;a href="http://www.crosstalkonline.org/storage/issue-archives/2007/200712/200712-Jones.pdf"&gt;Geriatric Issues of Ageing Software&lt;/a&gt; 2007, &lt;a href="http://www.amazon.com/Estimating-Software-Costs-Bringing-Realism/dp/0071483004"&gt;Estimating Software Costs&lt;/a&gt; 2008) has found that staffing a maintenance team with inexperienced people destroys productivity and is one of the worst practices that any organization can follow:

&lt;table border="0", cellpadding="10"&gt;

&lt;tr&gt;

&lt;td&gt;Worst Practice&lt;/td&gt;

&lt;td&gt;Effect on Productivity&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Not identifying and cleaning up error-prone code – the 20% of code that contains 80% of bugs&lt;/td&gt;

&lt;td&gt;-50%&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Code with embedded data and hard-coded variables – which contributes to “mass update” problems when this data changes&lt;/td&gt;

&lt;td&gt;-45%&lt;/td&gt;

&lt;/tr&gt;


&lt;tr&gt;

&lt;td&gt;Staffing maintenance teams with inexperienced people&lt;/td&gt;

&lt;td&gt;-40%&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;High complexity code that is hard to understand and change (often the same code that is error-prone)&lt;/td&gt;

&lt;td&gt;-30%&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Lack of good tools for source code navigation and test coverage&lt;/td&gt;

&lt;td&gt;-28%&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;Inefficient or nonexistent change control methods&lt;/td&gt;

&lt;td&gt;-27%&lt;/td&gt;

&lt;/tr&gt;

&lt;/table&gt;&lt;/p&gt;

&lt;p&gt;Many of these mistakes are due to not recognizing and not dealing with basic code quality and &lt;a href="http://swreflections.blogspot.ca/2012/02/technical-debt-how-much-is-it-really.html"&gt;technical debt issues&lt;/a&gt;, figuring out what code is causing you the most trouble and cleaning it up.&lt;/p&gt;

&lt;p&gt;The rest are basic, obvious management issues. Keep the people who built the system and who understand it and know how and why it works working on it as long as you can. Make it worth their while to stay, give them meaningful things to work on, and make sure that they have good tools to work with. Find ways for them to work together efficiently, with each other, with other developers, with operations and with the customer.&lt;p&gt;

&lt;p&gt;These simple, stupid mistakes add up over time to huge costs, when you consider that &lt;a href="http://eight2late.wordpress.com/2009/07/16/maintenance-matters/"&gt;maintenance makes up between 40% and 80% of total software costs&lt;/a&gt;. Like the classic mistakes in new development, mistakes in maintenance are obvious and fixable. We know we shouldn't do these things, we know what’s going to happen, and yet we keep doing them, over and again, and we're surprised when things fail. Why?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/5a1HH3Vh1wM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/696139718073183147/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=696139718073183147" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/696139718073183147?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/696139718073183147?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/5a1HH3Vh1wM/classic-mistakes-in-software.html" title="Classic Mistakes in Software Development and Maintenance" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2013/01/classic-mistakes-in-software.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIGRXo4cCp7ImA9WhNWGEg.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-5647434954403088850</id><published>2012-12-18T10:48:00.000-08:00</published><updated>2012-12-18T10:48:44.438-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-18T10:48:44.438-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="quality" /><category scheme="http://www.blogger.com/atom/ns#" term="technical debt" /><category scheme="http://www.blogger.com/atom/ns#" term="static analysis" /><title>Don’t take the Technical Debt Metaphor too far</title><content type="html">&lt;p&gt;Because “technical debt” has the word “debt” in it, many people have decided that it makes sense to think and work with &lt;a href="http://www.infoq.com/news/2010/03/monetizing-technical-debt"&gt;technical debt in monetary terms&lt;/a&gt;, and treat &lt;a href="http://theagileexecutive.com/2009/09/29/technical-debt-on-your-balance-sheet/"&gt;technical debt as a real financial cost&lt;/a&gt;. This is supposed to make it easier for technical people to &lt;a href="http://www.computerworld.com/s/article/9190198/The_new_push_to_measure_software_s_true_cost"&gt;explain technical debt to the business&lt;/a&gt;, and easier to make a business case for paying debt off.&lt;/P&gt;

&lt;p&gt;Putting technical debt into financial terms also allows consultants and vendors to try to scare business executives into buying their tools or their help – like Gartner calculating that &lt;a href="http://www.computerworld.com/s/article/352022/Gartner_Warns_of_App_Maintenance_Debt_?intsrc=print_latest"&gt;world wide “IT debt” costs&lt;/a&gt; will exceed $1.5 in a couple of more years, or &lt;a href="http://blog.castsoftware.com/crash-report-exposes-millions-in-technical-debt/"&gt;CAST software’s assessment&lt;/a&gt; that the average enterprise is carrying millions of dollars of technical debt.&lt;/p&gt;

&lt;p&gt;Businesses understand debt. Businesses make a decision to take on debt on and they track it, account for it and manage it. The business always knows how much debt they have, why they took it on, and when they need to pay it off. Businesses don’t accidentally take on debt – debt doesn't just show up on the books one day. &lt;/p&gt;

&lt;h2&gt;We don't know when we're taking technical debt on&lt;/h2&gt;

&lt;p&gt;But developers accidentally take on debt all of the time – what Martin Fowler calls &lt;a href="http://martinfowler.com/bliki/TechnicalDebtQuadrant.html"&gt;“inadvertent debt”&lt;/a&gt;, due to inexperience and misunderstandings, everything from “What’s Layering?” to “Now we know how we should have done it” looking at the design a year or two later.&lt;/p&gt;

&lt;blockquote&gt;"The point is that while you're programming, you are learning. It's often the case that it can take a year of programming on a project before you understand what the best design approach should have been."
&lt;/blockquote&gt;
Taking on this kind of debt is inevitable – and you’ll never know when you’re taking it on or how much, because you don’t know what you don’t know.  &lt;/p&gt;

&lt;p&gt;Even when developers take on debt consciously, they don’t understand the costs at the time – the principal or the interest. Most teams don’t record when they make a trade-off in design or a shortcut in coding or test automation, never mind try to put a value on paying off their choice.&lt;/p&gt;

&lt;p&gt;We don’t understand (or often even see) technical debt costs until long after we've taken the costs on. When you’re dealing with quality and stability problems; or when you're estimating out a change and you recognize that you made mistakes in the past or that you took shortcuts that you didn't realize before or shortcuts that you did know about but that turned out to be much more expensive than you expected; or once you understand that you chose the wrong architecture or the wrong technical platform. Or maybe you've just run a static analysis tool like &lt;a href="http://www.castsoftware.com/resources/technical-debt-estimation"&gt;CAST&lt;/a&gt; or &lt;a href="http://www.sonarsource.org/evaluate-your-technical-debt-with-sonar/"&gt;SONAR&lt;/a&gt; which tells you that you have thousands of dollars of technical debt in your code base that you didn't know about until now.&lt;/p&gt;
 
&lt;p&gt;Now try and explain to a business executive that you just realized or just remembered that you have put the company into debt for tens or hundreds of thousands of dollars. Businesses don’t and can’t run this way.&lt;/p&gt;

&lt;h2&gt;We don't know how much technical debt is really costing us&lt;/h2&gt;

&lt;p&gt;By expressing everything in financial terms, we’re also pretending that technical debt costs are all hard costs to the business and that we actually know how much the principal and interest costs are: we’re $100,000 in debt and the interest rate is 3% per year. Assigning a monetary value to technical debt costs give them a false sense of precision and accuracy. &lt;/p&gt;

&lt;p&gt;Let's be honest. There aren't clear and consistent criteria for costing technical debt and modelling technical debt repayment – we don’t even have a &lt;a href="http://swreflections.blogspot.ca/2012/12/are-bugs-part-of-technical-debt.html"&gt;definition of what technical debt is&lt;/a&gt; that we can all agree on. Two people can come up with a different technical debt assessment for the same system, because what I think technical debt is and what you think technical debt is aren't the same. And just because a tool says that technical debt costs are $100,000.00 for a code base, doesn't make the number true.&lt;/p&gt;
 
&lt;p&gt;Any principal and interest that you calculate (or some tool calculates for you) are made-up numbers and the business will know this when you try to defend them – which you are going to have to do, if you want to talk in financial terms with someone who does finance for a living. You’re going to be on shaky ground at best – at worse, they’ll understand that you’re not talking about real business debt and wonder what you’re trying to pull off.&lt;/p&gt;

&lt;p&gt;The other problem that I see is “debt fatigue”. Everyone is overwhelmed by the global government debt crisis and the real estate debt crisis and the consumer debt crisis and the fiscal cliff and whatever comes next. Your business may be already fighting its own problems with managing its financial debt. Technical debt is one more argument about debt that nobody is looking forward to hearing. &lt;/p&gt;

&lt;h2&gt;We don’t need to talk about debt with the business&lt;/h2&gt;

&lt;p&gt;We don’t use the term “technical debt” with the business, or try to explain it in financial debt terms. If we need to rewrite code because it is unstable, we treat this like any other problem that needs to be solved – we cost it out, explain the risks, and prioritize this work with everything else. If we need to rewrite or restructure code in order to make upcoming changes easier, cheaper and less risky, we explain this as part of the work that needs to be done, and justify the costs. If we need to replace or upgrade a platform technology because we are getting poor support from the supplier, we consider this a business risk that needs to be understood and managed. And if code should be refactored or tests filled in, we don’t explain it, we just do it as part of day-to-day engineering work.&lt;/p&gt;

&lt;p&gt;We’re dealing with technical debt in terms that the business understands without using a phony financial model. We’re not pretending that we’re carrying off-balance sheet debt that the company needs to rely on technologists to understand and manage. We’re leaving debt valuation and payment amortization arguments to the experts in finance and accounting where they belong, and focusing on solving problems in software, which is where we belong.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/ejNukbhK92g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/5647434954403088850/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=5647434954403088850" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/5647434954403088850?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/5647434954403088850?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/ejNukbhK92g/dont-take-technical-debt-metaphor-too.html" title="Don’t take the Technical Debt Metaphor too far" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>5</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2012/12/dont-take-technical-debt-metaphor-too.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QNRnc-eCp7ImA9WhNWFUw.&quot;"><id>tag:blogger.com,1999:blog-5028009537158799436.post-3397141980744370455</id><published>2012-12-14T10:56:00.000-08:00</published><updated>2012-12-14T10:56:37.950-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-14T10:56:37.950-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SANS" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><title>SANS Application Security Survey</title><content type="html">Frank Kim and I helped out with an industry-wide survey on application security practices. The results of the survey and our analysis can be found in the SANS Analyst Program Reading Room &lt;a href="https://www.sans.org/reading_room/analysts_program/sans_survey_appsec.pdf"&gt;here&lt;/a&gt;.

&lt;img src="http://feeds.feedburner.com/~r/BuildingRealSoftware/~4/E1f5q1yTV1E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://swreflections.blogspot.com/feeds/3397141980744370455/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5028009537158799436&amp;postID=3397141980744370455" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3397141980744370455?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5028009537158799436/posts/default/3397141980744370455?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BuildingRealSoftware/~3/E1f5q1yTV1E/sans-application-security-survey.html" title="SANS Application Security Survey" /><author><name>Jim Bird</name><uri>http://www.blogger.com/profile/17371102366836131341</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://swreflections.blogspot.com/2012/12/sans-application-security-survey.html</feedburner:origLink></entry></feed>
