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

<channel>
	<title>Ayr</title>
	<atom:link href="http://blog.ayrtonaraujo.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ayrtonaraujo.net</link>
	<description>ton</description>
	<lastBuildDate>Mon, 04 Apr 2016 21:20:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.5.3</generator>
	<item>
		<title>The last 3 *nix vulnerabilities you should be aware</title>
		<link>http://blog.ayrtonaraujo.net/2016/04/the-last-3-unix-vulnerabilities-you-should-be-aware/</link>
		<comments>http://blog.ayrtonaraujo.net/2016/04/the-last-3-unix-vulnerabilities-you-should-be-aware/#respond</comments>
		<pubDate>Mon, 04 Apr 2016 21:15:26 +0000</pubDate>
		<dc:creator><![CDATA[Ayrton]]></dc:creator>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sec]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vulnerabilities]]></category>

		<guid isPermaLink="false">http://blog.ayrtonaraujo.net/?p=94</guid>
		<description><![CDATA[First, your server and workstation should be all right if you have all the last security updates. So, there&#8217;s no need to panic. 🙂 Secondly, this is my personal option based on the daily things I have seen from the middle of the year 2015 to now. This post is for advanced users that handle many [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>First, your server and workstation should be all right if you have all the last security updates. So, there&#8217;s no need to panic. <img src="https://s.w.org/images/core/emoji/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Secondly, this is my personal option based on the daily things I have seen from the middle of the year 2015 to now. This post is for advanced users that handle many servers on a regular basis.</p>
<p>Let&#8217;s start with the micro review.</p>
<p><span id="more-94"></span></p>
<h2>CVE-2016-0728 &#8211; The local privilege escalation vulnerability in the Linux kernel:</h2>
<p>&nbsp;</p>
<p>Privilege escalation vulnerabilities aren&#8217;t very common with GNU/Linux distributions. Especially because the daemons and process usually don&#8217;t run at the top of the root user.</p>
<p>Since <a href="https://en.wikipedia.org/wiki/Shellshock_%28software_bug%29">Shellshock</a>, we do not see big bugs of this type:</p>
<p><a href="http://perception-point.io/2016/01/14/analysis-and-exploitation-of-a-linux-kernel-vulnerability-cve-2016-0728/">http://perception-point.io/2016/01/14/analysis-and-exploitation-of-a-linux-kernel-vulnerability-cve-2016-0728/</a></p>
<p>&nbsp;</p>
<h2>CVE-2016-0777 and CVE-2016-0778 &#8211; The roaming feature for SSH clients:</h2>
<p>&nbsp;</p>
<p>We see server sides vulnerabilities every time during the management duties. What about a client side issue that makes you vulnerable while accessing a server?</p>
<p>If you run SSH on the wrong server and have the UseRoaming feature active (that is, by default) someone could steal your SSH private key:</p>
<p><a href="https://www.digitalocean.com/community/questions/openssh-client-bug-cve-2016-0777-and-cve-2016-0778">https://www.digitalocean.com/community/questions/openssh-client-bug-cve-2016-0777-and-cve-2016-0778</a></p>
<p>&nbsp;</p>
<h2>CVE-2015-7547 &#8211; THE DNS exploit</h2>
<p>&nbsp;</p>
<p>This one caused sleepless nights of many engineers in late 2015.</p>
<p>Considered the bug that caused the <a href="https://en.wikipedia.org/wiki/Distributed_denial-of-service_attacks_on_root_nameservers#cite_note-5">3th worst DDoS attack to DNS Root Servers the history of the Internet</a> it caused DNS resolutions errors for the most part of the planet triggering intermittent instability for internet service providers and hosting providers everywhere for months.</p>
<p><img class="size-thumbnail wp-image-118 alignleft" src="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2016/04/mother-of-good.png?resize=150%2C150" alt="mother of good" srcset="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2016/04/mother-of-good.png?resize=150%2C150 150w, http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2016/04/mother-of-good.png?zoom=2&amp;resize=150%2C150 300w, http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2016/04/mother-of-good.png?zoom=3&amp;resize=150%2C150 450w" sizes="(max-width: 150px) 100vw, 150px" data-recalc-dims="1" /></p>
<p>&nbsp;</p>
<p>No more comments on this one:</p>
<p><a href="https://blog.cloudflare.com/a-tale-of-a-dns-exploit-cve-2015-7547/">https://blog.cloudflare.com/a-tale-of-a-dns-exploit-cve-2015-7547/</a></p>
<p><a href="http://root-servers.org/news/events-of-20151130.txt" target="_blank">http://root-servers.org/news/events-of-20151130.txt </a></p>
<h2></h2>
<h2><strong>Bonus:</strong></h2>
<p>This one is not new but started to be an issue again recently with the popularization of private networks accessible only via SSH Tunnels due to lack of IPv4:<br />
<a href="https://www.clockwork.com/news/2012/09/28/602/ssh_agent_hijacking">https://www.clockwork.com/news/2012/09/28/602/ssh_agent_hijacking</a></p>
<p>&nbsp;</p>
<p>Feel free to post at the comments your personal rank.</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ayrtonaraujo.net/2016/04/the-last-3-unix-vulnerabilities-you-should-be-aware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using OpenSSH 7.0 with legacy SSH implementations</title>
		<link>http://blog.ayrtonaraujo.net/2015/09/using-openssh-7-0-with-legacy-ssh-implementations/</link>
		<comments>http://blog.ayrtonaraujo.net/2015/09/using-openssh-7-0-with-legacy-ssh-implementations/#respond</comments>
		<pubDate>Sun, 27 Sep 2015 23:44:04 +0000</pubDate>
		<dc:creator><![CDATA[Ayrton]]></dc:creator>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[archlinux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ayrtonaraujo.net/?p=77</guid>
		<description><![CDATA[There&#8217;s a new version of OpenSSH out there recently. In this new version, 7.0, the installation has deprecated ssh-dss and diffie-hellman-group1-sha1 key exchange method for security enforcement. So, the best fix if you face issues would be updating your OpenSSH Servers to the most recent versions. However, if you don&#8217;t have access to the servers [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There&#8217;s a new version of OpenSSH out there recently.</p>
<p>In this new version, 7.0, the installation has deprecated ssh-dss and diffie-hellman-group1-sha1 key exchange method for security enforcement.</p>
<p>So, the best fix if you face issues would be updating your OpenSSH Servers to the most recent versions.</p>
<p>However, if you don&#8217;t have access to the servers configuration, there&#8217;s a temporary workaround for keep using the legacy implementations.</p>
<p>For the ssh-dss error, create an entry in your ~/.ssh/config with the following content:</p>
<pre><code>Host somehost.example.org
    PubkeyAcceptedKeyTypes +ssh-dss
</code></pre>
<p>And, for the diffie-hellman-group1-sha1 error, the following entry:</p>
<pre><code>Host somehost.example.org
    KexAlgorithms +diffie-hellman-group1-sha1
</code></pre>
<p>You could also add other hosts, followed by comma:</p>
<pre><code>Host somehost.example.org, otherhost.example.org
</code></pre>
<p>Or even regular expressions and IP addresses:</p>
<pre><code>Host app*.example.org, *.example.com, 192.168.0.1
</code></pre>
<p>That&#8217;s all, folks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ayrtonaraujo.net/2015/09/using-openssh-7-0-with-legacy-ssh-implementations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blinking lights when the build status change</title>
		<link>http://blog.ayrtonaraujo.net/2015/08/lights-build-status-change/</link>
		<comments>http://blog.ayrtonaraujo.net/2015/08/lights-build-status-change/#respond</comments>
		<pubDate>Wed, 05 Aug 2015 22:10:13 +0000</pubDate>
		<dc:creator><![CDATA[Ayrton]]></dc:creator>
				<category><![CDATA[Agile methodologies]]></category>
		<category><![CDATA[CEBTENZZVAT ZBGURESHPXRE]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[blynclight]]></category>
		<category><![CDATA[build automation]]></category>
		<category><![CDATA[coffeescript]]></category>
		<category><![CDATA[continuous delivery]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[leds]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[traffic lights]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ayrtonaraujo.net/?p=38</guid>
		<description><![CDATA[In Agile methodologies, we learn as good practice to start giving visibility in more efficient ways besides using the typical e-mail method. For example, a physical kanban board is more suitable for communicating as a digital version. As everyone will see the progress and obstacles as they get close to a team (and, of course, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In Agile methodologies, we learn as good practice to start giving visibility in more efficient ways besides using the typical e-mail method.</p>
<p>For example, a physical kanban board is more suitable for communicating as a digital version. As everyone will see the progress and obstacles as they get close to a team (and, of course, the board should be near the team). The digital version is not bad, but it needs a lot more self-discipline than the physical one.</p>
<p>I will talk more about good practices to give visibility to digital kanbans over the next posts. Today I want to tell a little about how to do this with the continuous integration process.</p>
<p>Throughout continuous integration, we have a distinct scenario because typically only the development team members follow this process, where it is quite common:</p>
<ul>
<li>The build agent starts to send e-mails when someone breaks tests;</li>
<li>Developers do not open the mailbox very often throughout the day. Usually, they are focused on making code with due heroic dates that the dev team stipulated themselves (or at least agreed);</li>
<li>When devs start to being disturbed by the build agent, they move the related emails to a label and skip the inbox;</li>
<li>These emails never will be seen again.</li>
</ul>
<p>What if we create a physical way to communicate these changes? As the physical kanban, everyone would know what&#8217;s going on when they approach the team workspace, instantly.</p>
<p>Here&#8217;re some interesting examples:</p>
<p><a href="http://i0.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light01.jpg"><img src="http://i0.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light01.jpg?resize=150%2C150" alt="ci-light01" class="aligncenter size-thumbnail wp-image-43" srcset="http://i0.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light01.jpg?resize=150%2C150 150w, http://i0.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light01.jpg?zoom=2&amp;resize=150%2C150 300w" sizes="(max-width: 150px) 100vw, 150px" data-recalc-dims="1" /></a></p>
<p><a href="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light02.jpg"><img src="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light02.jpg?resize=224%2C300" alt="ci-light02" class="aligncenter size-medium wp-image-44" srcset="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light02.jpg?resize=224%2C300 224w, http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light02.jpg?w=440 440w" sizes="(max-width: 224px) 100vw, 224px" data-recalc-dims="1" /></a></p>
<p><a href="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light03.jpg"><img src="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light03.jpg?resize=300%2C200" alt="ci-light03" class="aligncenter size-medium wp-image-45" srcset="http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light03.jpg?resize=300%2C200 300w, http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light03.jpg?resize=1024%2C682 1024w, http://i1.wp.com/blog.ayrtonaraujo.net/wp-content/uploads/2015/08/ci-light03.jpg?w=1406 1406w" sizes="(max-width: 300px) 100vw, 300px" data-recalc-dims="1" /></a></p>
<p>However, before you start learning basic electronics and buying a bunch of stuff, I would like to teach you a very simple way to get started.</p>
<p>Start small, as people start enjoying it (especially people who sponsor the project), you should starting building complete lights for all your build pipeline.</p>
<p>For my example, I will use this light:</p>
<p><a href="http://www.blynclight.com/products/blync-light?variant=328886579" target="_blank">http://www.blynclight.com/products/blync-light?variant=328886579</a></p>
<p>You will need a machine with a USB port and connectivity to your local network. You could use a Raspberry Pi or a Linux machine that is close to the team.</p>
<p>That parts could be more expensive than buy an Arduino and some lights, however, you will only need 5 minutes to make it work. As the working hours of your team should be more expensive, this will be the cheapest way to get started as start from scratch with the electronic components.</p>
<p>The fun part about this light is a NodeJS library:</p>
<p><a href="https://www.npmjs.com/package/blync" target="_blank">https://www.npmjs.com/package/blync</a></p>
<p>Some examples of usage (finally):</p>
<style>.gist table { margin-bottom: 0; }</style>
<div class="gist-oembed" data-gist="ayr-ton/8731331ea64583b0b3fc.json"></div>
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="4" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;">
<div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;">
<div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div>
</div>
<p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="https://instagram.com/p/5ibIyJOf4N/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_top">Ayrton, what is the build status?</a></p>
<p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">A video posted by Ayrton  Araújo (@ayrtonfreeman) on <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2015-07-24T23:47:48+00:00">Jul 24, 2015 at 4:47pm PDT</time></p>
</div>
</blockquote>
<p><script async defer src="//platform.instagram.com/en_US/embeds.js"></script></p>
<p>How does it work?</p>
<p>First you need add a user to plugdev group and create the <code>90-libusb.rules</code> inside this path:</p>
<pre><code>/etc/udev/rules.d/
</code></pre>
<p>Reload udev rules:</p>
<pre><code>sudo udevadm control --reload-rules
</code></pre>
<p>You could test if everything is working fine with the <code>light-cli.coffee</code>:</p>
<pre><code>coffee light-cli.coffee green
coffee light-cli.coffee red
coffee light-cli.coffee white
coffee light-cli.coffee magenta
coffee light-cli.coffee blue
coffee light-cli.coffee cyan 
coffee light-cli.coffee yellow 
coffee light-cli.coffee off
</code></pre>
<p>Expose a REST API:</p>
<pre><code>coffee light-api.coffee
</code></pre>
<p>You could use <a href="https://github.com/foreverjs/forever" target="_blank">forever</a> to keep the API working after system restart.</p>
<p>Getting the things real:</p>
<p>When a build starts, you could call in the job:</p>
<pre><code>curl http://lightmachineIPorDOMAIN:3333/api/v0/yellow
</code></pre>
<p>When a build succeed, you could call:</p>
<pre><code>curl http://lightmachineIPorDOMAIN:3333/api/v0/green
</code></pre>
<p>If if fails:</p>
<pre><code>curl http://lightmachineIPorDOMAIN:3333/api/v0/red
</code></pre>
<p>Now you can use your imagination. I&#8217;m color blind. <img src="https://s.w.org/images/core/emoji/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ayrtonaraujo.net/2015/08/lights-build-status-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu shell overpowered</title>
		<link>http://blog.ayrtonaraujo.net/2015/07/ubuntu-shell-overpowered/</link>
		<comments>http://blog.ayrtonaraujo.net/2015/07/ubuntu-shell-overpowered/#comments</comments>
		<pubDate>Thu, 30 Jul 2015 23:53:24 +0000</pubDate>
		<dc:creator><![CDATA[Ayrton]]></dc:creator>
				<category><![CDATA[CEBTENZZVAT ZBGURESHPXRE]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[shellscript]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://blog.ayrtonaraujo.net/?p=9</guid>
		<description><![CDATA[In order to have more productivity under my environment, as a command line centric guy, I started three years ago to use zsh as my default shell. And for who never tried it, I would like to share my personal thoughts. What are the main advantages? Extended globbing: For example, (.) matches only regular files, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>In order to have more productivity under my environment, as a command line centric guy, I started three years ago to use zsh as my default shell. And for who never tried it, I would like to share my personal thoughts.</p>
<h3>What are the main advantages?</h3>
<ul>
<li>Extended globbing: For example, <em>(.) matches only regular files, not directories, whereas a</em>z(/) matches directories whose names start with a and end with z. There are a bunch of other things;</li>
<li>Inline glob expansion: For example, type rm *.pdf and then hit tab. The glob *.pdf will expand inline into the list of .pdf files, which means you can change the result of the expansion, perhaps by removing from the command the name of one particular file you don&#8217;t want to rm;</li>
<li>Interactive path expansion: Type cd /u/l/b and hit tab. If there is only one existing path each of whose components starts with the specified letters (that is, if only one path matches /u<em>/l</em>/b*), then it expands in place. If there are two, say /usr/local/bin and /usr/libexec/bootlog.d, then it expands to /usr/l/b and places the cursor after the l. Type o, hit tab again, and you get /usr/local/bin;</li>
<li>Nice prompt configuration options: For example, my prompt is currently displayed as tov@zyzzx:/..cts/research/alms/talk. I prefer to see a suffix of my current working directory rather than have a really long prompt, so I have zsh abbreviate that portion of my prompt at a maximum length.</li>
</ul>
<p>Font: http://www.quora.com/What-are-the-advantages-and-disadvantages-of-using-zsh-instead-of-bash-or-other-shells</p>
<p>The Z shell is mainly praised for its interactive use, the prompts are more versatility, the completion is more customizable and often faster than bash-completion. And, easy to make plugins. One of my favorite integrations is with git to have better visibility of current repository status.</p>
<p>As it focuses on the interactive use, is a good idea to keep maintaining your shell scripts starting with <code>#!/bin/bash</code> for interoperability reasons. Bash is still most mature and stable for shell scripting in my point of view.</p>
<h3>So, how to install and set up?</h3>
<blockquote><p>
  sudo apt-get install zsh zsh-lovers -y
</p></blockquote>
<p>zsh-lovers will provide to you a bunch of <a href="http://grml.org/zsh/zsh-lovers.html">examples</a> to help you understand better ways to use your shell.</p>
<p>To set zsh as the default shell for your user:</p>
<blockquote><p>
  chsh -s /bin/zsh
</p></blockquote>
<p>Don&#8217;t try to set zsh as default shell to your full system or some things should stop to work.</p>
<p>Two friends of mine, Yuri Albuquerque and Demetrius Albuquerque (brothers of a former hacker family =x) also recommended using https://github.com/robbyrussell/oh-my-zsh. Thanks for the tip.</p>
<p>How to install oh-my-zsh as a normal user?</p>
<blockquote><p>
  curl -L http://install.ohmyz.sh | sh
</p></blockquote>
<p>My <code>$ZSH_THEME</code> is set to &#8220;bureau&#8221; under my <code>$HOME/.zshrc</code>. You can try &#8220;random&#8221; or other themes located inside <code>$HOME/.oh-my-zsh/themes</code>.</p>
<p>And, if you use Ruby under RVM, I also recommend to read this:<br />
http://rvm.io/integration/zsh</p>
<p>Happy hacking <img src="https://s.w.org/images/core/emoji/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ayrtonaraujo.net/2015/07/ubuntu-shell-overpowered/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Desmitificando o TDD e o BDD</title>
		<link>http://blog.ayrtonaraujo.net/2015/07/desmitificando-o-tdd-e-o-bdd/</link>
		<comments>http://blog.ayrtonaraujo.net/2015/07/desmitificando-o-tdd-e-o-bdd/#respond</comments>
		<pubDate>Thu, 30 Jul 2015 23:31:43 +0000</pubDate>
		<dc:creator><![CDATA[Ayrton]]></dc:creator>
				<category><![CDATA[CEBTENZZVAT ZBGURESHPXRE]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[csd]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://blog.ayrtonaraujo.net/?p=21</guid>
		<description><![CDATA[A partir de várias discussões com amigos da comunidade de desenvolvimento sobre boas práticas de TDD/BDD, alguns treinamentos relacionados e lições aprendidas colhidas, resolvi deixar meus 2 centavos sobre o assunto juntamente das referências sobre as polêmicas que venho trazer por meio desta postagem. Começando com as duas fatídicas perguntas, uma máxima que ouço com [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>A partir de várias discussões com amigos da comunidade de desenvolvimento sobre boas práticas de TDD/BDD, alguns treinamentos relacionados e lições aprendidas colhidas, resolvi deixar meus 2 centavos sobre o assunto juntamente das referências sobre as polêmicas que venho trazer por meio desta postagem.</p>
<p>Começando com as duas fatídicas perguntas, uma máxima que ouço com muita frequência e uma triste realidade:</p>
<blockquote><p>
  &#8220;Já fez o TDD?&#8221; &#8211; Referindo-se a testes de unidade</p>
<p>  &#8220;TDD vs BDD? Qual é o melhor e quando usar cada um deles?&#8221; &#8211; Ser humano perdido</p>
<p>  &#8220;Você só pode usar o BDD para testes de tela, não serve para outro tipo de testes.&#8221; &#8211; Maximus Decimus Meridius</p>
<p>  &#8220;Faço os testes unitários depois, porque aí tenho o que testar. Não vejo sentido fazer os testes primeiro.&#8221; &#8211; Desenvolvedor que não quis ser identificado
</p></blockquote>
<p>Vamos às minhas explicações e considerações:</p>
<h2>De volta ao básico</h2>
<p>O Desenvolvimento Orientado a Testes (TDD) é uma técnica de desenvolvimento de software multiplicadora do seguinte workflow:</p>
<ul>
<li>Escrever os &#8220;testes&#8221;;</li>
<li>Fazê-los falhar;</li>
<li>Implementar nosso código;</li>
<li>Fazer os testes passarem;</li>
<li>Refatorar;</li>
<li>Volte para o primeiro passo.</li>
</ul>
<h2>Defina &#8220;testes&#8221;</h2>
<p>A técnica descreve &#8220;teste&#8221; como toda e qualquer expectativa tida sobre um código-fonte. Vezes, expressamos essas expectivas por meio de testes unitários, mas não impede que possamos especificar usando testes de integração ou testes de tela, por exemplo.</p>
<h2>Por que temos que falhar os testes?</h2>
<p>Porque é só uma especificação, não implementamos nada ainda. É como o roteiro de uma palestra ou show. Descrevemos para tomar nota do que esperar da apresentação final e não nos perdermos durante a implementação do &#8220;show&#8221;.</p>
<h2>Testes de integração? Testes de tela? Testes de unidade?</h2>
<p>A técnica não impede que definamos essas espectativas por meio de testes de integração ou testes de tela, por exemplo. Mas é sempre bom ter em mente que cada um desses possui objetivos e focos diferentes. Nada impede também o uso conjunto deles, até encorajo.</p>
<p>Pesquisando um pouco, vemos que existem muitos outros tipos de testes.</p>
<h2>E o BDD?</h2>
<p>Dan North, um importante coach do mundo agile, descobriu que as pessoas passaram a entender melhor os princípios do TDD quando ele parou de usar a palavra &#8220;teste&#8221;. Ele passou a substituir isso por &#8220;cenários&#8221;, &#8220;comportamentos&#8221;, &#8220;exemplos&#8221;, resultando na compreensão mais rápida dos princípios do desenvolvimento orientado a testes.</p>
<p>Num caso pessoal meu, comentando sobre testes de unidade, vejo muito a justificativa de escrever os testes após o desenvolvimento ser mais natural, pois escrever primeiro sem ter o que testar não faria sentido. Parando para analisar numa perspectiva &#8220;testicentrista&#8221;, esse raciocínio faz todo sentido e é perfeitamente natural, o que acaba causando toda a confusão conceitual acerca do TDD.</p>
<p>Aslak Hellesøy, em seu livro sobre o Cucumber, diz que o Desenvolvimento Orientado a Comportamentos (BDD) é nada mais nada menos que uma formalização das das melhores técnicas descritas no Desenvolvimento Orientado a Testes (TDD) feita por bons praticantes.</p>
<p>Basicamente, o BDD é uma tentativa dos usuários bem sucedidos de TDD de re-explicar o conceito de Desenvolvimento Orientado a Testes (TDD), incrementando suas próprias experiências ao longo de quase uma década de uso.</p>
<h2>Refatoração</h2>
<p>Após implementar seu código de acordo com os padrões de arquitetura escolhidos e assegurar-se de que as expectativas (testes) estão passando, o passo seguinte é a refatoração. Na minha humilde opinião, esse é o objetivo da coisa toda.</p>
<p>Como assim?</p>
<p>Na minha compreensão, todo esse workflow tem o objetivo de garantir a refatoração do nosso código com tranquilidade, checando sempre se as expectativas estão batendo. Porque, inicialmente, além do nosso código ser mais verboso, a qualidade dele é geralmente duvidosa. Não devemos postergar esse passo para dar andamento à construção de novas expectativas.</p>
<p>&#8220;Os custos de correção de defeitos e refatorações após a implantação são 10x maiores que na fase de construção e 100x maiores que na fase de design.&#8221; (Barry W. Boehm: Software Process Management)</p>
<p>Esta prática pode ser comparada à uma monografia escrita para conclusão de curso &#8211; quando refatorada durante toda a produção, o custo nas correções aplicadas ao texto é menor, e a qualidade terá um padrão elevado. Diferente de quando as correções acumulam-se, de modo que tudo será corrigido no final. Independente da escolha, a refatoração será sempre necessária para manter a qualidade da monografia, porém, a quantidade de esforço e os resultados serão distintos para os dois casos.</p>
<h3>Fontes:</h3>
<ul>
<li>http://blog.mattwynne.net/2012/11/20/tdd-vs-bdd/</li>
<li>https://github.com/cucumber/cucumber</li>
<li>http://pichiliani.com.br/2014/06/15-fatos-sobre-programacao-que-voce-provavelmente-nao-sabia/</li>
<li>Treinamentos da K21 e Adaptworks;</li>
<li>The Cucumber Book;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ayrtonaraujo.net/2015/07/desmitificando-o-tdd-e-o-bdd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perdeu os primeiros episódios da #horadevops?</title>
		<link>http://blog.ayrtonaraujo.net/2015/07/perdeu-os-primeiros-episodios-da-horadevops/</link>
		<comments>http://blog.ayrtonaraujo.net/2015/07/perdeu-os-primeiros-episodios-da-horadevops/#comments</comments>
		<pubDate>Thu, 30 Jul 2015 23:27:45 +0000</pubDate>
		<dc:creator><![CDATA[Ayrton]]></dc:creator>
				<category><![CDATA[Agile methodologies]]></category>
		<category><![CDATA[CEBTENZZVAT ZBGURESHPXRE]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[chaosmonkey]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[continuos delivery]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[horadevops]]></category>
		<category><![CDATA[Infra as a Code]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[simianarmy]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://blog.ayrtonaraujo.net/?p=31</guid>
		<description><![CDATA[Você pode acompanhar os episódios aqui: Quer só o áudio?]]></description>
				<content:encoded><![CDATA[<p>Você pode acompanhar os episódios aqui:</p>
<p><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/videoseries?list=PLDgcLtqGAPQgUgy8Z-BXXyoSX7T-gKMZ1&#038;hl=en_US' allowfullscreen='true' style='border:0;'></iframe></p>
<p>Quer só o áudio?</p>
<p><iframe width="500" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&#038;url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F109781772&#038;show_artwork=true&#038;maxwidth=500&#038;maxheight=750"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ayrtonaraujo.net/2015/07/perdeu-os-primeiros-episodios-da-horadevops/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: blog.ayrtonaraujo.net @ 2016-08-09 21:31:23 by W3 Total Cache -->