Download - Desenvolvimento orientado a Testes
![Page 1: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/1.jpg)
Test-Driven Development
@denisferrari
![Page 2: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/2.jpg)
UMA HISTÓRIA
![Page 3: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/3.jpg)
Quer fazer um projeto?
CLARO!
![Page 4: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/4.jpg)
ALGUM TEMPO DEPOIS:
170 Tabelas
Regras de negócio complexas
Clientes importantes
~50 UCs
De 2 para 80 Users
.NET ao extremo
![Page 5: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/5.jpg)
Experiência traumática
![Page 6: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/6.jpg)
HÉRCULES NÃO FARIA
![Page 7: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/7.jpg)
Durante um jantar
![Page 8: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/8.jpg)
Aparece uma emergência
![Page 9: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/9.jpg)
Durante um momento descontraído
![Page 10: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/10.jpg)
O SGBD não responde
![Page 11: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/11.jpg)
Durante uma noite de sono
![Page 12: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/12.jpg)
O cliente reporta um erro
![Page 13: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/13.jpg)
Durante sua série favorita
![Page 14: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/14.jpg)
![Page 15: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/15.jpg)
Valeu a pena?
![Page 16: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/16.jpg)
Pessoas se enganam
![Page 17: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/17.jpg)
Algo faltava…
![Page 18: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/18.jpg)
Vamos aprender com quem faz
![Page 19: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/19.jpg)
Vamos para o mercado!
![Page 20: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/20.jpg)
Possuem os mesmos* problemas
![Page 21: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/21.jpg)
Prazos curtos
![Page 22: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/22.jpg)
Falhas de comunicação
![Page 23: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/23.jpg)
Contratos rígidos
![Page 24: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/24.jpg)
Problemas com processos
![Page 25: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/25.jpg)
Previsibilidade
![Page 26: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/26.jpg)
Projeto castelo de cartas
![Page 27: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/27.jpg)
Super-homens
![Page 28: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/28.jpg)
Projeto castelo de areia
![Page 29: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/29.jpg)
Queima de dinheiro
![Page 30: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/30.jpg)
Stress
![Page 31: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/31.jpg)
Chaos Report
http://www1.standishgroup.com/newsroom/chaos_2009.php
![Page 32: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/32.jpg)
Começa ruim
![Page 33: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/33.jpg)
Depois piora
![Page 34: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/34.jpg)
FALTA QUALIDADE!
![Page 35: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/35.jpg)
Devido aos traumas do passado
![Page 36: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/36.jpg)
![Page 37: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/37.jpg)
Algumas conclusões
Excelência técnica e teórica
Equipe, comunicação
TDD & IC
Scrum & XP
DDD
Programação em par
![Page 38: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/38.jpg)
VISÃO GERAL SOBRE TESTES
![Page 39: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/39.jpg)
Espiral da morte
![Page 40: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/40.jpg)
TDD
![Page 41: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/41.jpg)
Objetivos
![Page 42: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/42.jpg)
Mantra
Verde
Vermelho Refatorar
![Page 43: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/43.jpg)
Lista de testes
![Page 44: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/44.jpg)
Escreva o teste
![Page 45: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/45.jpg)
Faça o teste passar
![Page 46: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/46.jpg)
Refatore o seu código
![Page 47: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/47.jpg)
Exemplo
• Exemplo: Testar o envio da string “Mindworks” através de um socket.
public void TestarComunicacaoSocket() {
Assert.IsTrue(readerSocket.Close()); Assert.AreEqual(“Mindworks”, buf); }
public void TestarComunicacaoSocket() { string buf = reader.Contents();
Assert.IsTrue(readerSocket.Close()); Assert.AreEqual(“Mindworks”, buf); }
public void TestarComunicacaoSocket() { Socket readerSocket = new Socket(“localhost”, 8080); string buf = reader.Contents();
Assert.IsTrue(readerSocket.Close()); Assert.AreEqual(“Mindworks”, buf); }
public void TestarComunicacaoSocket() { Server server = new Server(8080, “”Mindworks”); Socket readerSocket = new Socket(“localhost”, 8080); string buf = reader.Contents();
Assert.IsTrue(readerSocket.Close()); Assert.AreEqual(“Mindworks”, buf); }
![Page 48: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/48.jpg)
Passos de bebe
![Page 49: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/49.jpg)
10 a 15 minutos
![Page 50: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/50.jpg)
Noção de progresso
![Page 51: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/51.jpg)
Facilitar a comunicação
![Page 52: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/52.jpg)
Construção sustentável
![Page 53: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/53.jpg)
Integração contínua
![Page 54: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/54.jpg)
Coding Dojo
![Page 55: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/55.jpg)
Programação em par
![Page 56: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/56.jpg)
BENEFÍCIOS DO TDD
![Page 57: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/57.jpg)
Maior qualidade
![Page 58: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/58.jpg)
Menor custo
![Page 59: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/59.jpg)
Corte no TCO (Custo Total de Posse )
![Page 60: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/60.jpg)
Garante testes unitários
![Page 61: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/61.jpg)
Menos bugs
![Page 62: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/62.jpg)
Software mais desacoplado
![Page 63: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/63.jpg)
Especificação executável
![Page 64: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/64.jpg)
FERRAMENTAS P/ TDD
![Page 65: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/65.jpg)
Visual Studio 2010
![Page 66: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/66.jpg)
ALM
![Page 67: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/67.jpg)
NUnit
![Page 68: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/68.jpg)
Beck, K. Test-Driven Development by Example, Addison Wesley, 2003
![Page 69: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/69.jpg)
![Page 70: Desenvolvimento orientado a Testes](https://reader036.vdocuments.pub/reader036/viewer/2022081513/55799b21d8b42ae72b8b52af/html5/thumbnails/70.jpg)
Obrigado!
@denisferrari
www.heroisdati.com
tinyurl.com/grupomsdeves
www.minhacarreira.com
www.mindworks.com.br