Browse Source

added theme and refactored presentation to use azion theme

master
Julio Biason 7 years ago
parent
commit
4043153b82
  1. BIN
      _images/avatar-20170726.png
  2. BIN
      _images/azion-logo.png
  3. 305
      theme/azion.css
  4. 69
      theme/azion.scss
  5. 443
      unit-in-unittests-2.html

BIN
_images/avatar-20170726.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

BIN
_images/azion-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

305
theme/azion.css

@ -0,0 +1,305 @@
/**
* Azion theme for Reveal.js
*
* By Julio Biason, http://presentations.juliobiason.net
*/
@import url(../../lib/font/source-sans-pro/source-sans-pro.css);
section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 {
color: #fff; }
.reveal section h1.semi-opaque {
background-color: rgba(0, 0, 0, 0.7);
color: #fff;
text-shadow: 2px 2px #000; }
.reveal section img.company-logo {
height: 1em;
margin-right: 5px;
margin-left: 5px;
margin-top: 0px;
margin-bottom: 0px;
box-shadow: none; }
/*********************************************
* GLOBAL STYLES
*********************************************/
body {
background: #F2F5F8;
background-color: #F2F5F8; }
.reveal {
font-family: "Source Sans Pro", Helvetica, sans-serif;
font-size: 42px;
font-weight: normal;
color: #000; }
::selection {
color: #fff;
background: #98bdef;
text-shadow: none; }
::-moz-selection {
color: #fff;
background: #98bdef;
text-shadow: none; }
.reveal .slides > section,
.reveal .slides > section > section {
line-height: 1.3;
font-weight: inherit; }
/*********************************************
* HEADERS
*********************************************/
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
margin: 0 0 20px 0;
color: #000;
font-family: "Source Sans Pro", Helvetica, sans-serif;
font-weight: 600;
line-height: 1.2;
letter-spacing: normal;
text-transform: uppercase;
text-shadow: none;
word-wrap: break-word; }
.reveal h1 {
font-size: 2.5em; }
.reveal h2 {
font-size: 1.6em; }
.reveal h3 {
font-size: 1.3em; }
.reveal h4 {
font-size: 1em; }
.reveal h1 {
text-shadow: none; }
/*********************************************
* OTHER
*********************************************/
.reveal p {
margin: 20px 0;
line-height: 1.3; }
/* Ensure certain elements are never larger than the slide itself */
.reveal img,
.reveal video,
.reveal iframe {
max-width: 95%;
max-height: 95%; }
.reveal strong,
.reveal b {
font-weight: bold; }
.reveal em {
font-style: italic; }
.reveal ol,
.reveal dl,
.reveal ul {
display: inline-block;
text-align: left;
margin: 0 0 0 1em; }
.reveal ol {
list-style-type: decimal; }
.reveal ul {
list-style-type: disc; }
.reveal ul ul {
list-style-type: square; }
.reveal ul ul ul {
list-style-type: circle; }
.reveal ul ul,
.reveal ul ol,
.reveal ol ol,
.reveal ol ul {
display: block;
margin-left: 40px; }
.reveal dt {
font-weight: bold; }
.reveal dd {
margin-left: 40px; }
.reveal q,
.reveal blockquote {
quotes: none; }
.reveal blockquote {
display: block;
position: relative;
width: 70%;
margin: 20px auto;
padding: 5px;
font-style: italic;
background: rgba(255, 255, 255, 0.05);
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); }
.reveal blockquote p:first-child,
.reveal blockquote p:last-child {
display: inline-block; }
.reveal q {
font-style: italic; }
.reveal pre {
display: block;
position: relative;
width: 90%;
margin: 20px auto;
text-align: left;
font-size: 0.55em;
font-family: monospace;
line-height: 1.2em;
word-wrap: break-word;
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); }
.reveal code {
font-family: monospace; }
.reveal pre code {
display: block;
padding: 5px;
overflow: auto;
max-height: 400px;
word-wrap: normal; }
.reveal table {
margin: auto;
border-collapse: collapse;
border-spacing: 0; }
.reveal table th {
font-weight: bold; }
.reveal table th,
.reveal table td {
text-align: left;
padding: 0.2em 0.5em 0.2em 0.5em;
border-bottom: 1px solid; }
.reveal table th[align="center"],
.reveal table td[align="center"] {
text-align: center; }
.reveal table th[align="right"],
.reveal table td[align="right"] {
text-align: right; }
.reveal table tbody tr:last-child th,
.reveal table tbody tr:last-child td {
border-bottom: none; }
.reveal sup {
vertical-align: super; }
.reveal sub {
vertical-align: sub; }
.reveal small {
display: inline-block;
font-size: 0.6em;
line-height: 1.2em;
vertical-align: top; }
.reveal small * {
vertical-align: top; }
/*********************************************
* LINKS
*********************************************/
.reveal a {
color: #2a76dd;
text-decoration: none;
-webkit-transition: color .15s ease;
-moz-transition: color .15s ease;
transition: color .15s ease; }
.reveal a:hover {
color: #6ca0e8;
text-shadow: none;
border: none; }
.reveal .roll span:after {
color: #fff;
background: #1a53a1; }
/*********************************************
* IMAGES
*********************************************/
.reveal section img {
margin: 15px 0px;
background: rgba(255, 255, 255, 0.12);
border: 4px solid #000;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); }
.reveal section img.plain {
border: 0;
box-shadow: none; }
.reveal a img {
-webkit-transition: all .15s linear;
-moz-transition: all .15s linear;
transition: all .15s linear; }
.reveal a:hover img {
background: rgba(255, 255, 255, 0.2);
border-color: #2a76dd;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); }
/*********************************************
* NAVIGATION CONTROLS
*********************************************/
.reveal .controls .navigate-left,
.reveal .controls .navigate-left.enabled {
border-right-color: #2a76dd; }
.reveal .controls .navigate-right,
.reveal .controls .navigate-right.enabled {
border-left-color: #2a76dd; }
.reveal .controls .navigate-up,
.reveal .controls .navigate-up.enabled {
border-bottom-color: #2a76dd; }
.reveal .controls .navigate-down,
.reveal .controls .navigate-down.enabled {
border-top-color: #2a76dd; }
.reveal .controls .navigate-left.enabled:hover {
border-right-color: #6ca0e8; }
.reveal .controls .navigate-right.enabled:hover {
border-left-color: #6ca0e8; }
.reveal .controls .navigate-up.enabled:hover {
border-bottom-color: #6ca0e8; }
.reveal .controls .navigate-down.enabled:hover {
border-top-color: #6ca0e8; }
/*********************************************
* PROGRESS BAR
*********************************************/
.reveal .progress {
background: rgba(0, 0, 0, 0.2); }
.reveal .progress span {
background: #2a76dd;
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }

69
theme/azion.scss

@ -0,0 +1,69 @@
/**
* Azion theme for Reveal.js
*
* By Julio Biason, http://presentations.juliobiason.net
*/
// Default mixins and settings -----------------
@import "../template/mixins";
@import "../template/settings";
// ---------------------------------------------
// Include theme-specific fonts
@import url(../../lib/font/source-sans-pro/source-sans-pro.css);
// Override theme settings (see ../template/settings.scss)
$backgroundColor: #F2F5F8;
$mainColor: #000;
$headingColor: #000;
$mainFontSize: 42px;
$mainFont: 'Source Sans Pro', Helvetica, sans-serif;
$headingFont: 'Source Sans Pro', Helvetica, sans-serif;
$headingTextShadow: none;
$headingLetterSpacing: normal;
$headingTextTransform: uppercase;
$headingFontWeight: 600;
$linkColor: #2a76dd;
$linkColorHover: lighten( $linkColor, 15% );
$selectionBackgroundColor: lighten( $linkColor, 25% );
$heading1Size: 2.5em;
$heading2Size: 1.6em;
$heading3Size: 1.3em;
$heading4Size: 1.0em;
section.has-dark-background {
&, h1, h2, h3, h4, h5, h6 {
color: #fff;
}
}
.reveal {
section {
h1 {
.semi-opaque {
background-color: rgba(0, 0, 0, 0.7);
color: #fff;
text-shadow: 2px 2px #000;
}
}
img.company-logo {
height: 1em;
margin-right: 5px;
margin-left: 5px;
margin-top: 0px;
margin-bottom: 0px;
box-shadow: none;
}
}
}
// Theme template ------------------------------
@import "../template/theme";
// ---------------------------------------------

443
unit-in-unittests-2.html

@ -0,0 +1,443 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>"Unit" em "Unit Tests"</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="theme/azion.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<style type="text/css" media="screen">
.happy {
color: yellow;
}
.reveal section img {
border: none;
}
.reveal ul.empty {
list-style: none outside;
}
li {
display: block;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<section data-background="_images/tdd-kentbeck-book.jpg">
<h1 class="semi-opaque">"Unit" em "Unit Tests"</h1>
</section>
</section>
<section>
<section>
<img src="_images/avatar-20170726.png" alt="Me" style="float:left;width:200px;" class="no-border">
<div>
<ul class="empty">
<li>Júlio Biason</li>
<li>Azion Technologies<img src="_images/azion-logo.png" alt="Azion logo" class='company-logo'></li>
<li>@juliobiason</li>
<li>julio.biason@gmail.com</li>
<li><a href="http://presentations.juliobiason.net">http://presentations.juliobiason.net</a></li>
</ul>
</div>
</section>
<section>
<img src="_images/start-a-fight.jpg" alt="Eu faço perguntas em reuniões que eu não sei nada e reunião explode; não é de propósito" class='stretch'/>
<aside class="notes">
Eu sou famoso (ou era) por entrar eu reuniões, fazer uma
pergunta e a reunião explodir em discussões (úteis, diga-se
de passagem). Mas eu não fazia isso de propósito.
</aside>
</section>
<section>
<img src="_images/filho-do-capeta.jpg" alt="... mas hoje eu vim botar os filho dos outro no go horse." class='stretch'/>
<aside class="notes">
... mas hoje eu vim "botá os fio dos otro no Go Horse, fazê
eles escrevê menos teste"
</aside>
</section>
</section>
<section>
<section>
<img src="_images/tdd-where-it-went-wrong.png" alt="TDD: Where it went wrong" class="stretch"/>
<p>Ian Cooper: <a href="https://vimeo.com/68375232">"TDD, where did it all go wrong"</a></p>
</section>
<section>
<p>Apresentação de Ian Cooper ressoou muito com experiências
feitas com TDD puro e "testes de ponta-a-ponta".</p>
</section>
</section>
<section>
<section>
<p>Mas antes...</p>
</section>
<section>
<p>Quem já...</p>
<ul class="empty">
<li class="fragment">... falou de "testes de unidade"?</li>
<li class="fragment">... discutiu a "unidade" dos testes de unidade?</li>
</ul>
</section>
<section>
<img src="_images/faustao-arrow.png" alt="Errow" class="stretch"/>
</section>
<section>
<img src="_images/errou-rude.png" alt="Errou rude" class="stretch"/>
</section>
</section>
<section>
<section>
<h2>Exemplo</h2>
<pre><code class="python">
class Client:
def __init__(self, name):
self.name = name
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<p>Novo requisito: "somente aceitar nomes válidos, que tem 2
palavras ou mais."</p>
</section>
<section>
<h2>Exemplo</h2>
<p>SOLID principles:</p>
<ul>
<li><strong>SRP - Single Responsability Principle</strong></li>
<li>OCP - Open/closed principle</li>
<li>LSP - Liskov substitution principle (design by contract)</li>
<li>ISP - Interface Segreation Principle</li>
<li>DIP - Dependency Inversion Principle</li>
</ul>
</section>
<section>
<h2>Exemplo</h2>
<pre><code class="python">
def _multiple_names(name):
split_names = name.split(' ')
return len(split_names) > 1
def _validate_name(name):
if not _multiple_names(name):
raise Exception("Invalid name")
return name
class Client:
def __init__(self, name):
self.name = _validate_name(name)
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code class="python">
import pytest
def test_single_name():
assert not _multiple_names('Cher')
def test_multiple_name():
assert _multiple_names('Julio Biason')
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code class="python">
def test_valid_name():
_validate_name('Julio Biason')
def test_invalid_name():
with pytest.raises(Exception):
_validate_name('Cher')
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code class="python">
def test_client_error():
with pytest.raises(Exception):
Client(name='Cher')
def test_client():
Client(name='Julio Biason')
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code>
$ pytest client.py
==== test session starts ====
rootdir: /home/jbiason/unitt, inifile:
collected 6 items
client.py ......
==== 6 passed in 0.03 seconds ====
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code>
$ pytest --cov=client client.py
==== test session starts ====
plugins: cov-2.4.0
collected 6 items
client.py ......
---- coverage: platform linux, python 3.4.3-final-0 ----
Name Stmts Miss Cover
-------------------------------
client.py 25 0 100%
==== 6 passed in 0.11 seconds ====
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<p>"Não podemos perder a Cher, a Xuxa, a Madonna, a Björk e o String como clientes!"</p>
</section>
<section>
<h2>Exemplo</h2>
<pre><code class="python">
class Client:
def __init__(self, name):
self.name = name
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code>
==== FAILURES ====
____ test_client_error ____
def test_client_error():
with pytest.raises(Exception):
&gt; Client(name='Cher')
E Failed: DID NOT RAISE &lt;class 'Exception'>
client.py:37: Failed
==== 1 failed, 5 passed in 0.63 seconds ====
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code>
$ pytest client.py
==== test session starts ====
rootdir: /home/jbiason/unitt, inifile:
plugins: cov-2.4.0
collected 6 items
client.py ......
==== 6 passed in 0.03 seconds ====
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<pre><code>
$ pytest --cov=client client.py
==== test session starts ====
rootdir: /home/jbiason/unitt, inifile:
plugins: cov-2.4.0
collected 6 items
client.py ......
---- coverage: platform linux, python 3.4.3-final-0 ----
Name Stmts Miss Cover
-------------------------------
client.py 24 0 100%
==== 6 passed in 0.12 seconds ====
</code></pre>
</section>
<section>
<h2>Exemplo</h2>
<p>Encontre o erro.</p>
</section>
</section>
<section>
<section>
<h2>TDD</h2>
<p>Kent Beck:</p>
<ul>
<li>"Run in isolation", nothing more, nothing less.</li>
<li>"Avoid testing implementation details, test behaviours"</li>
</ul>
</section>
<section>
<h2>TDD</h2>
<p>Discussões como "qual a unidade a ser testada" é que geraram
coisas como BDD e ATDD (Acceptance Test-Driven Development).</p>
</section>
<section>
<h2>TDD</h2>
<p>Reddit: <a href="https://www.reddit.com/r/django/comments/5bearg/should_i_write_unit_tests_for_djangos_built_in/" target="_blank">Devo escrever testes para a validação interna do Django?</a></p>
<h1 class="fragment">SIM!</h1>
</section>
<section>
<h2>TDD</h2>
<p>Nossos testes End-to-End.</p>
<aside class="notes">
Explicação do que aconteceu com os testes do gerenciador de alertas.
</aside>
</section>
<section>
<h2>TDD</h2>
<img src="_images/tdd-lifecycle.png" alt="The TDD lifecycle" class="stretch">
</section>
<section>
<h2>TDD</h2>
<p>SOLID principles:</p>
<ul>
<li>SRP - Single Responsability Principle</li>
<li>OCP - Open/closed principle</li>
<li><strong>LSP - Liskov substitution principle (design by contract)</strong></li>
<li>ISP - Interface Segreation Principle</li>
<li>DIP - Dependency Inversion Principle</li>
</ul>
<p>Funciona para aplicações inteiras; veja VIM vs NeoVim.</p>
</section>
</section>
<section>
<h2>Resumo</h2>
<ul>
<li>Escreva testes que verifiquem requisitos, não a
implementação do requisito</li>
<li>Implementação pode mudar, os testes não deveriam.</li>
<li>Garanta que o teste dependa apenas de si mesmo
e não de outros testes.</li>
<li>Use cobertura (coverage) para identificar código
a ser removido, não para escrever mais testes.</li>
</ul>
</section>
<section data-background='_images/thats-all-folks.jpg'>
<section>
<h1 class="fragment semi-opaque">Perguntas?</h1>
</section>
</section>
</div>
</div>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
// showNotes: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true },
{ src: 'reveal.js/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>
Loading…
Cancel
Save