From 682e5858758ef98de8c1f3b5c21fd64d68c94224 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Thu, 22 Aug 2019 12:43:09 -0300 Subject: [PATCH] Added notes --- filosofando-testes.html | 121 +++++++++++++++++++++++++++++++--------- 1 file changed, 95 insertions(+), 26 deletions(-) diff --git a/filosofando-testes.html b/filosofando-testes.html index 9d77740..6f32a93 100644 --- a/filosofando-testes.html +++ b/filosofando-testes.html @@ -48,6 +48,10 @@ li { display: block; } + + .semi-opaque { + background-color: rgba(0, 0, 0, 0.7); + } @@ -67,9 +71,8 @@
@@ -85,10 +88,6 @@ -
- Me chamaram de Mini Hitler -
-
... mas hoje eu vim botar os filho dos outro no go horse. @@ -103,6 +102,14 @@ ... e eu sou meio não-ortodoxo sobre testes.
+ +
@@ -111,7 +118,7 @@
@@ -120,6 +127,14 @@
TDD: Where it went wrong

Ian Cooper: "TDD, where did it all go wrong"

+ +
@@ -131,13 +146,44 @@
  • "Run in isolation", nothing more, nothing less.
  • "Avoid testing implementation details, test behaviours"
  • + +

    TDD

    -

    Discussões como "qual a unidade a ser testada" é que geraram - coisas como BDD e ATDD (Acceptance Test-Driven Development).

    +

    + Discussões como "qual a unidade a ser testada" é + que geraram coisas como BDD e ATDD (Acceptance + Test-Driven Development). +

    + +
    @@ -145,9 +191,31 @@

    Reddit: Devo escrever testes para a validação interna do Django?

    + +

    SIM!

    -

    ... bom, talvez sim.

    +
    @@ -156,7 +224,8 @@

    Nossos testes End-to-End.

    @@ -267,7 +336,7 @@

    Coverage

    Exemplo

    -
    
    +                        
    
     class Client:
         def __init__(self, name):
             self.name = name
    @@ -286,7 +355,7 @@ class Client:
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     def _multiple_names(name):
         split_names = name.split(' ')
         return len(split_names) > 1
    @@ -306,7 +375,7 @@ class Client:
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     import pytest
     
     def test_single_name():
    @@ -321,7 +390,7 @@ def test_multiple_name():
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     def test_valid_name():
         _validate_name('Julio Biason')
     
    @@ -335,7 +404,7 @@ def test_invalid_name():
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     def test_client_error():
         with pytest.raises(Exception):
             Client(name='Cher')
    @@ -349,7 +418,7 @@ def test_client():
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     $ pytest client.py
     ==== test session starts ====
     rootdir: /home/jbiason/unitt, inifile:
    @@ -365,7 +434,7 @@ client.py ......
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     $ pytest --cov=client client.py
     ==== test session starts ====
     plugins: cov-2.4.0
    @@ -393,7 +462,7 @@ client.py      25      0   100%
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     class Client:
         def __init__(self, name):
             self.name = name
    @@ -404,7 +473,7 @@ class Client:
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     ==== FAILURES ====
     ____ test_client_error ____
     
    @@ -422,7 +491,7 @@ client.py:37: Failed
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     $ pytest  client.py
     ==== test session starts ====
     rootdir: /home/jbiason/unitt, inifile:
    @@ -439,7 +508,7 @@ client.py ......
                             

    Coverage

    Exemplo

    -
    
    +                        
    
     $ pytest --cov=client  client.py
     ==== test session starts ====
     rootdir: /home/jbiason/unitt, inifile:
    @@ -481,9 +550,9 @@ client.py      24      0   100%
     
     						
      -
    • @juliobiason
    • -
    • https://functional.cafe/@juliobiason
    • -
    • julio.biason@gmail.com
    • +
    • Júlio Biason
    • +
    • https://functional.cafe/@juliobiason
    • +
    • julio.biason@pm.me
    • http://presentations.juliobiason.net