Tdd not sure if testing or developing
-
Upload
renato-oliveira -
Category
Documents
-
view
2.907 -
download
1
Transcript of Tdd not sure if testing or developing
![Page 1: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/1.jpg)
TDD: Not sure if testing or developing
Real World Django Talks
![Page 3: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/3.jpg)
Real World Django Talks! pt 2/...
Renato Oliveira
Filipe Ximenes
![Page 4: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/4.jpg)
TDD
Test-driven development
![Page 5: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/5.jpg)
Oh, wait!
![Page 6: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/6.jpg)
![Page 7: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/7.jpg)
"Ciência da computação tem tanto a ver com o computador como a Astronomia com o telescópio, a Biologia com o microscópio, ou a Química com os tubos de ensaio."
Edsger Dijkstra
![Page 8: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/8.jpg)
"TDD tem tanto a ver sobre testes quanto a Ciência da computação tem a ver sobre computadores!"
Unknown!
![Page 9: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/9.jpg)
TDD
Processo de desenvolvimento de software que se baseia na repetição de um ciclo curto de repetições:
![Page 10: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/10.jpg)
Escreva um teste automatizado que define a melhoria ou nova funcionalidade desejada.
![Page 11: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/11.jpg)
O teste falha.
![Page 12: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/12.jpg)
Escreva a menor quantidade de código para passar no teste.
![Page 13: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/13.jpg)
O teste passa.
![Page 14: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/14.jpg)
Refatore o código!
![Page 15: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/15.jpg)
Ok, isto deixa o processo de desenvolvimento um pouco lento...
![Page 16: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/16.jpg)
Para quem não está acostumado com TDD, fica bastante lento!
![Page 17: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/17.jpg)
Mas com a prática, o overhead diminui e só fica a parte boa!
![Page 18: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/18.jpg)
Refactoring!
Refatoração é alterar o código sem alterar sua funcionalidade.
- Removendo duplicação- Melhorar design do código- Remover smells.
![Page 19: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/19.jpg)
Refactoring!
Refatoração sem testes pode se tornar um pesadelo
![Page 20: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/20.jpg)
Mas refactoring é um assunto pra uma próxima palestra!
![Page 21: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/21.jpg)
Testes
Prós- Asseguram uma qualidade maior no código- Garante que o sistema continue
funcionando após mudanças
Contra- Não garantem que o código é "Bug free"- Pequeno aumento no tempo de
desenvolvimento
![Page 22: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/22.jpg)
Testes em python
Doctest
![Page 23: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/23.jpg)
Testes em python
Unittest
![Page 24: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/24.jpg)
TDD com Django
Quando uma app é criada o arquivo tests.py é criado dentro dela...
![Page 25: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/25.jpg)
TDD com Django
Você já deu uma olhada nele?
![Page 26: Tdd not sure if testing or developing](https://reader033.fdocuments.net/reader033/viewer/2022060116/55843c27d8b42ad8268b4c2a/html5/thumbnails/26.jpg)
TDD com Django
Show me some code!