Automatizando testes de
Javascript no Front-end
Presenter Notes
Iraê Carvalho
@irae
tech.irae.pro
(blog)
linkedin.com/in/iraee
github.com/irae
Presenter Notes
Por que testar seu código?
corrigir bugs é chato
corrigir de novo é mais chato
segurança ao subir o código
documentação
continuous deployment
Presenter Notes
Ferramentas
Static code analisys
Unit test
Coverage
Browser tests
Presenter Notes
Validadores
JsLint
JsHint
npm install jslint jshint
Presenter Notes
validadores são um tipo de static code analisys
Testes unitários e/ou funcionais
qUnit
YUI Test
JSUnit
Jasmine
Mocha
Buster.js
etc...
Presenter Notes
assinaturas / contratos
testes diretos e indiretos
Exemplos
Presenter Notes
Cobertura de código
JSCoverage
YUITest
Presenter Notes
Análise dos testes unitários
Detecta quais linhas foram ou não executadas
Aponta a falta de testes
Cobertura de código
Presenter Notes
Cobertura de código
Presenter Notes
Browser tests
Selenium
Cucumber
Pyccuracy
Zombie
Phantom JS
Presenter Notes
Pyccuracy
BDD Style
Usa o Selenium
Fácil de escrever os testes
Presenter Notes
Jenkins
Presenter Notes
Scripts e exemplos
Presenter Notes
Perguntas?
@irae
tech.irae.pro
(blog)
linkedin.com/in/iraee
github.com/irae
https://github.com/irae/frontend-tests-pt
Presenter Notes
Referências (1/3)
Reading
http://en.wikipedia.org/wiki/Software_testing
http://net.tutsplus.com/tutorials/javascript-ajax/how-to-test-your-javascript-code-with-qunit/
https://github.com/heynemann/pyccuracy/wiki/
https://github.com/guilhermechapiewski/pyccuracy-presentation
Presenter Notes
Referências (2/3)
Tools
http://www.jshint.com/
http://visionmedia.github.com/mocha/
http://yuilibrary.com/projects/yuitest/
http://jenkins-ci.org/
http://busterjs.org/
https://github.com/douglascrockford/JSLint
https://github.com/jquery/qunit
https://github.com/yui/yuitest
Presenter Notes
Referências (3/3)
Repositories / Projects
https://github.com/twada/qunit-tap
https://github.com/bitzesty/qunit-mock
https://github.com/joshuaclayton/qunit-examples
Presenter Notes
Table of Contents
Table of Contents
Automatizando testes de
Javascript no Front-end
1
Iraê Carvalho
2
Por que testar seu código?
3
Ferramentas
4
Validadores
5
Testes unitários e/ou funcionais
6
Exemplos
7
Cobertura de código
8
Cobertura de código
9
Cobertura de código
10
Browser tests
11
Pyccuracy
12
Jenkins
13
Scripts e exemplos
14
Perguntas?
15
Referências (1/3)
16
Referências (2/3)
17
Referências (3/3)
18
Help
Help
Table of Contents
t
Exposé
ESC
Full screen slides
e
Presenter View
p
Source Files
s
Slide Numbers
n
Toggle screen blanking
b
Show/hide slide context
c
Notes
2
Help
h