SlideShare uma empresa Scribd logo
1 de 106
Baixar para ler offline
Como NÃO testar SW? 
uma palestra da
@freire_da_silva 
• Director of Product Safety @IndustrialLogic 
• Agil desde 2001, lean desde a 1ª série 
• Founder: AgilCoop, AgilBits e ).( 
• Mestrado na USP: 
“Reflexões sobre 
o Ensino de Metodologias Ágeis 
na Academia, Indústria e Governo” 
• Gosto de nadar e construir casas 
• Experiência e alex@industriallogic.com sucesso com muitos amigos:
Você 
TESTA?
TODO SW 
TEM BUG?
TODO SW 
TEM BUG!
/1947
1999: ! 
Imperial instead of metric units ! 
cause Mars Climate Orbiter… 
to disintegrate!
sslKeyExchange.c 
if((err=SSLFreeBuffer(&hashCtx))!=0) 
goto fail; 
if((err=ReadyHash(&SHA1,&hashCtx))!=0) 
goto fail; 
if((err=SHA1.update(&hashCtx,&rand))!=0) 
goto fail; 
goto fail; 
if((err=SHA1.update(&hashCtx,&sign))!=0) 
goto fail; 
if((err=SHA1.final(&hashCtx,&hsOut))!=0) 
goto fail; 
err = sslRawVerify(…);
sslKeyExchange.c 
if((err=SSLFreeBuffer(&hashCtx))!=0) 
goto fail; 
if((err=ReadyHash(&SHA1,&hashCtx))!=0) 
goto fail; 
if((err=SHA1.update(&hashCtx,&rand))!=0) 
goto fail; 
goto fail; 
if((err=SHA1.update(&hashCtx,&sign))!=0) 
goto fail; 
if((err=SHA1.final(&hashCtx,&hsOut))!=0) 
goto fail; 
err = sslRawVerify(…);
/* Read type & payload length first */ 
hbtype = *p++; 
n2s(p,payload); 
p1 = p; 
! 
/* Enter response type, length 
& copy payload */ 
*bp++ = TLS1_HB_RESPONSE; 
s2n(payload, bp); 
memcpy(bp, p1, payload);
/* Read type & payload length first */ 
hbtype = *p++; 
n2s(p,payload); 
if (1+2+payload+16 > 
s->s3->rrec.length) 
return 0; 
/* silently discard per 
RFC 6520 sec. 4 */ 
p1 = p; 
! 
/* Enter response type, length 
& copy payload */ 
*bp++ = TLS1_HB_RESPONSE; 
s2n(payload, bp); 
memcpy(bp, p1, payload);
Você 
AUTOMATIZA 
SEUS 
TESTES?
?
#1e5d91
#1e5d91
1describe “test” do 
2 it “should do nothing” do 
3 fail 
4 end 
5 end
1describe “test” do 
2 it “should do nothing” do 
3 fail 
4 end 
5 end
1describe “test” do 
2 it “should do nothing” do 
3 true 
4 end 
5 end
1describe “test” do 
2 it “should do nothing” do 
3 true 
4 end 
5 end ?
SCALABILITY 
NON-FUNCTIONAL 
REQUIREMENTS 
RELIABILITY 
SECURITY 
USABILITY 
MAINTAINABILITY 
ACCESSIBILITY
#1e5d91
por James Reason 
RISCOS 
FALHAS
Você 
APAGA 
seus testes?
?
100% COVERED CODE. 
LINE 
OF CODE YOU COVER
60@Test 
61public void setPrice() { 
62 Item item = new 
63 BasicItem(0.0, true); 
64 
65 assertEquals(0.0, 
66 item.getPrice()); 
67 
68 //set new price 
69 item.setPrice(1.0); 
70 assertEquals(1.0, 
71 item.getPrice()); 
72}
74@Test 
75public void isImported_true(){ 
76 Item item = new 
77 BasicItem(0.0, true); 
78 
79 assertTrue(item.isImported()); 
80}
74@Test 
75public void isImported_false(){ 
76 Item item = new 
77 BasicItem(0.0, false); 
78 
79 assertFalse(item.isImported()); 
80}
28public Double getPrice(){ 
25 return price; 
26} 
27 
28public boolean isImported(){ 
29 return imported; 
30}
WHY DO 
WE TEST?
1while true do 
2 print “vou parar?” 
3end
!Murphy’s 
law
P 
AIN
FLOW
Cost of Quality 
Assurance (QA) 
Analysis Design Coding Unit Tests Acceptance Tests Production
freqüencia de Uso Das 
Funcionalidades 
RARO 
19% 
Sempre 
7% 
Frequente 
13% 
Algumas VEZES 
Nunca 
45% 
16%
Pair Programming
?
feedback 
vs 
noise
Speed Robustness
non-deterministic 
flaky 
code
Test 
failed 
21 
-mes 
locally 
& 
36 
-mes 
in 
dev 
build 
in 
the 
last 
6 
months.
@google 
If they fail we simply run flaky tests 
3x (and keep statistics). Developer 
time is much more valuable than 
server time.
1@Test 
2public void 
errorExerciseUploadTooBig { 
3 goToExerciseIntroPage(); 
4 goToNextPage(); 
5 
6 type(“labArchive”, 
path() + TOO_BIG); 
7 pause(1000L); 
8 assertText(“error: 
Upload too big!”); 
9}
sleep() 
demais
How much 
QUALITY is 
ENOUGH?
Bugs/1KLOC 
5 
4 
3 
1 
0 
0,004 
Indústria Nasa
Cost($/LOC) 
900 
675 
450 
225 
0 
5 
850 
Indústria Nasa
It will only run once
VS 
<- costumer 
facing 
back 
office ->
@martinfowler 
you’re doing enough testing if the 
following is true: 
■You rarely get bugs that escape 
into production 
■You are rarely hesitant to change 
some code for fear it will cause 
production bugs
@joshuakerievsky Test first/after misses the point that 
TDD is more about emergent design 
than it is about testing. Do you 
practice emergent design?
@kentbeck If I don’t typically make a mistake(...), 
I don’t test for it. 
! 
Wish there were more examples of 
“what not to test and how not to 
test”.
2def create_name(fname, 
lname): 
3 if not isInstance(fname, 
basestring): 
4 raise TypeError(“fname 
must be a String”) 
5 if not isInstance(lname, 
basestring): 
6 raise TypeError(“lname 
must be a String”) 
7 name = fname + lname
1 require ‘spec_helper‘ 
2 describe Candidate do 
3 context ‘associations‘ do 
4 it { should have_many(:proposals) } 
5 end 
6 
7 context ‘validations‘ do 
8 it { should validate_presence_of :name } 
9 
10 it { should ensure_lenght_of(:phone). 
11 is_at_least(7). 
12 is_at_most(14) 
13 } 
14 
15 it { should_not 
16 allow_value(‘blah‘).for(:site) } 
17 
18 it { should 
19 allow_value(‘http://www.blah.com‘) 
20 .for(:site) } 
21 end 
22end
1 require ‘valid_url‘ 
2 class Candidate < ActiveRecord::Base 
3 has_many :proposals 
4 
5 validates :name, presence: true 
6 
7 validates :phone, :length => 
8 {:in => 8..14}, 
9 :allow_blank 
10 
11 validates :site, :url => true, 
12 :allow_nil => true 
13 
14end
1 require ‘spec_helper‘ 
2 describe Candidates do 
3 
4 let(:candidate) {double ‘candidate‘} 
5 
6 before :each do 
7 Candidate 
8 .should_receive(:find) 
9 .with(1).and_return(candidate) 
10 end 
11 
12 it ‘should find the candidate‘ do 
13 c = Candidate.find(1) 
14 c.should eql candidate 
15 end 
16end
1Feature: Create proposal 
2 As a candidate 
3 I want to post my proposals 
4 So that voters can evaluate them 
5 
6 Scenario: 
7 Given I am logged in 
8 And I am posting a proposal 
9 When 
10 I fill all fields of the proposal 
11 Then 
12 I should see a success message
1Scenario: Client sees tooltip for plan 
2 Given 
3 I select the ‘light‘ plan 
4 When 
5 I mouse over ‘tooltip‘ 
6 Then 
7 I should see ‘tooltip‘ content 
8 And 
9 I mouse out ‘tooltip‘ 
10 Then 
11 I should not see ‘tooltip‘ content
1require ‘spec_helper‘ 
2describe ShoppingCart do 
3 
4 let(:user) {double ‘user‘} 
5 let(:product) {double ‘product‘} 
6 
7 before :each do 
8 Authenticator.should_receive(:auth) 
9 .and_return(true) 
10 end 
11 
12 it ‘should addProduct & getTotal‘ do 
13 Authenticator.auth(user) 
14 cart = ShoppingCart.new 
15 cart.add_product(product) 
16 cart.get_total 
17 end 
18end
50@Test 
51public void changeMarks() { 
52 bot.leftClickAt(view, 
53 800, 508); 
54 addMarkAt(‘drama’, 1); 
55 
56 bot.leftClickAt(view, 
57 900, 508); 
58 addMarkAt(‘act’, 3); 
59 
60 bot.verifyTooltipAt(30, 190); 
61}
PIXEL NAZI
1 require ‘spec_helper‘ 
2 describe AddressController do 
3 
4 it ‘should calculate shipping‘ do 
5 get :shipping, :zipcode => ‘90210‘ 
6 assigns(:shipping).should == ‘8.2‘ 
7 end 
8 
9 end
external 
dependencies:
DR Y
WET
fixtures 
considered 
harmful?
JAVASCRIPT?
module('MultiSelectQuizTests',{ 
setup: function() { 
var container = 
document.getElementById("qunit-fixture"); 
var question = "Which foods are Mexican?"; 
var answers = [ 
{ 'answerText': 'Tacos', 'value': true }, 
{ 'answerText': 'Sushi', 'value': false } 
]; 
! 
this.myQuiz = new MultiSelectQuiz 
( container, question, answers ); 
}, 
}); 
! 
test( "One correct", function() { 
checkRadio(0, true); 
checkRadio(1, true); 
deepEqual(this.myQuiz.grade(), 1, "just 1"); 
});
CSS?
it(‘centers logo at top of page’, function() { 
expect(isConTenteCenteredInPage(logo)).toBe(true); 
expect(elementPicelsFromTopOfPage(logo)).toBe(12); 
expect(fontSizeOf(logo)).toBe(22); 
expect(textColorOf(logo)).toBe(WHITE); 
});
análise de uma falha 
Students(Can’t(Access(Service( 
New(Produc5on( 
Server( 
And$ 
Ok(To(Toggle(( 
Test(Passes( 
Immune(System( 
Fails( 
No(Auto?( 
Rollback( 
No(SMS( 
No(Policy( 
And$ And$ And$ 
Non?Standard( 
Tomcat(Runner( 
Nginx(Points( 
To(Down( 
Service( 
Non?Standard( 
Java(Version( JRE(Crash( 
No(Policy(
Test 
journeys
NÃO É 
BUG 
É FEATURE
80% só até amanhã! 
código de desconto: DEVDAY2014 
JAVASCRIPT 
PYTHON 
HTTP://industriallogic.com/shop

Mais conteúdo relacionado

Mais procurados

Unit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterUnit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterWayan Wira
 
Test First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in GrailsTest First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in GrailsTim Berglund
 
Test First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in GrailsTest First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in GrailsTim Berglund
 
Beautiful java script
Beautiful java scriptBeautiful java script
Beautiful java scriptÜrgo Ringo
 
Test First
Test FirstTest First
Test Firstsivalsk
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to ProductionMark Baker
 
Redux Thunk - Fu - Fighting with Async
Redux Thunk - Fu - Fighting with AsyncRedux Thunk - Fu - Fighting with Async
Redux Thunk - Fu - Fighting with AsyncArtur Szott
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test DriveGraham Lee
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Michelangelo van Dam
 
Una Critica a Rails by Luca Guidi
Una Critica a Rails by Luca GuidiUna Critica a Rails by Luca Guidi
Una Critica a Rails by Luca GuidiCodemotion
 
Unit testing with Easymock
Unit testing with EasymockUnit testing with Easymock
Unit testing with EasymockÜrgo Ringo
 
Testing My Patience
Testing My PatienceTesting My Patience
Testing My PatienceAdam Lowry
 
ES3-2020-P3 TDD Calculator
ES3-2020-P3 TDD CalculatorES3-2020-P3 TDD Calculator
ES3-2020-P3 TDD CalculatorDavid Rodenas
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Michelangelo van Dam
 
ruby on rails pitfalls
ruby on rails pitfallsruby on rails pitfalls
ruby on rails pitfallsRobbin Fan
 
UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013Michelangelo van Dam
 
Metaprogramming in .NET
Metaprogramming in .NETMetaprogramming in .NET
Metaprogramming in .NETjasonbock
 

Mais procurados (20)

Android TDD
Android TDDAndroid TDD
Android TDD
 
Your code are my tests
Your code are my testsYour code are my tests
Your code are my tests
 
Unit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterUnit testing CourseSites Apache Filter
Unit testing CourseSites Apache Filter
 
Test First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in GrailsTest First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in Grails
 
Test First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in GrailsTest First Refresh Second: Test-Driven Development in Grails
Test First Refresh Second: Test-Driven Development in Grails
 
Beautiful java script
Beautiful java scriptBeautiful java script
Beautiful java script
 
Test First
Test FirstTest First
Test First
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to Production
 
Redux Thunk - Fu - Fighting with Async
Redux Thunk - Fu - Fighting with AsyncRedux Thunk - Fu - Fighting with Async
Redux Thunk - Fu - Fighting with Async
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test Drive
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
QA for PHP projects
QA for PHP projectsQA for PHP projects
QA for PHP projects
 
Una Critica a Rails by Luca Guidi
Una Critica a Rails by Luca GuidiUna Critica a Rails by Luca Guidi
Una Critica a Rails by Luca Guidi
 
Unit testing with Easymock
Unit testing with EasymockUnit testing with Easymock
Unit testing with Easymock
 
Testing My Patience
Testing My PatienceTesting My Patience
Testing My Patience
 
ES3-2020-P3 TDD Calculator
ES3-2020-P3 TDD CalculatorES3-2020-P3 TDD Calculator
ES3-2020-P3 TDD Calculator
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013
 
ruby on rails pitfalls
ruby on rails pitfallsruby on rails pitfalls
ruby on rails pitfalls
 
UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013
 
Metaprogramming in .NET
Metaprogramming in .NETMetaprogramming in .NET
Metaprogramming in .NET
 

Destaque

Do push para a produção: Os desafios de automação em Continuous Delivery
Do push para a produção: Os desafios de automação em Continuous DeliveryDo push para a produção: Os desafios de automação em Continuous Delivery
Do push para a produção: Os desafios de automação em Continuous DeliveryCamilo Ribeiro
 
Desenvolvimento Dirigido por Testes
Desenvolvimento Dirigido por TestesDesenvolvimento Dirigido por Testes
Desenvolvimento Dirigido por TestesCamilo Ribeiro
 
Criando pipelines de entrega contínua multilinguagem com Docker e Jenkins
Criando pipelines de entrega contínua multilinguagem com Docker e JenkinsCriando pipelines de entrega contínua multilinguagem com Docker e Jenkins
Criando pipelines de entrega contínua multilinguagem com Docker e JenkinsCamilo Ribeiro
 
Quando tdd não é o suficiente
Quando tdd não é o suficienteQuando tdd não é o suficiente
Quando tdd não é o suficienteCamilo Ribeiro
 
Introdução a Automação de Teste de Software
Introdução a Automação de Teste de SoftwareIntrodução a Automação de Teste de Software
Introdução a Automação de Teste de SoftwareCamilo Ribeiro
 
Boas práticas de Automação de Testes
Boas práticas de Automação de TestesBoas práticas de Automação de Testes
Boas práticas de Automação de TestesCamilo Ribeiro
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsCamilo Ribeiro
 
Papéis em Teste e Qualidade de Software
Papéis em Teste e Qualidade de SoftwarePapéis em Teste e Qualidade de Software
Papéis em Teste e Qualidade de SoftwareCamilo Ribeiro
 
Teste de Software Introdução à Qualidade
Teste de Software Introdução à Qualidade Teste de Software Introdução à Qualidade
Teste de Software Introdução à Qualidade Camilo Ribeiro
 

Destaque (10)

Técnicas de Teste
Técnicas de TesteTécnicas de Teste
Técnicas de Teste
 
Do push para a produção: Os desafios de automação em Continuous Delivery
Do push para a produção: Os desafios de automação em Continuous DeliveryDo push para a produção: Os desafios de automação em Continuous Delivery
Do push para a produção: Os desafios de automação em Continuous Delivery
 
Desenvolvimento Dirigido por Testes
Desenvolvimento Dirigido por TestesDesenvolvimento Dirigido por Testes
Desenvolvimento Dirigido por Testes
 
Criando pipelines de entrega contínua multilinguagem com Docker e Jenkins
Criando pipelines de entrega contínua multilinguagem com Docker e JenkinsCriando pipelines de entrega contínua multilinguagem com Docker e Jenkins
Criando pipelines de entrega contínua multilinguagem com Docker e Jenkins
 
Quando tdd não é o suficiente
Quando tdd não é o suficienteQuando tdd não é o suficiente
Quando tdd não é o suficiente
 
Introdução a Automação de Teste de Software
Introdução a Automação de Teste de SoftwareIntrodução a Automação de Teste de Software
Introdução a Automação de Teste de Software
 
Boas práticas de Automação de Testes
Boas práticas de Automação de TestesBoas práticas de Automação de Testes
Boas práticas de Automação de Testes
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
 
Papéis em Teste e Qualidade de Software
Papéis em Teste e Qualidade de SoftwarePapéis em Teste e Qualidade de Software
Papéis em Teste e Qualidade de Software
 
Teste de Software Introdução à Qualidade
Teste de Software Introdução à Qualidade Teste de Software Introdução à Qualidade
Teste de Software Introdução à Qualidade
 

Semelhante a Como NÃO testar o seu projeto de Software. DevDay 2014

Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516SOAT
 
Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113SOAT
 
Developer Test - Things to Know
Developer Test - Things to KnowDeveloper Test - Things to Know
Developer Test - Things to Knowvilniusjug
 
Developer Tests - Things to Know
Developer Tests - Things to KnowDeveloper Tests - Things to Know
Developer Tests - Things to KnowVaidas Pilkauskas
 
How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiHow Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiRan Mizrahi
 
Cool JVM Tools to Help You Test
Cool JVM Tools to Help You TestCool JVM Tools to Help You Test
Cool JVM Tools to Help You TestSchalk Cronjé
 
What's New in JavaScript
What's New in JavaScriptWhat's New in JavaScript
What's New in JavaScriptDan Cohn
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014Guillaume POTIER
 
Aaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security TeamsAaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security Teamscentralohioissa
 
[2014/10/06] HITCON Freetalk - App Security on Android
[2014/10/06] HITCON Freetalk - App Security on Android[2014/10/06] HITCON Freetalk - App Security on Android
[2014/10/06] HITCON Freetalk - App Security on AndroidDEVCORE
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopFastly
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockRobot Media
 
Achievement Unlocked: Drive development, increase velocity, and write blissfu...
Achievement Unlocked: Drive development, increase velocity, and write blissfu...Achievement Unlocked: Drive development, increase velocity, and write blissfu...
Achievement Unlocked: Drive development, increase velocity, and write blissfu...All Things Open
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma Christopher Bartling
 
Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)vilniusjug
 
Test driven node.js
Test driven node.jsTest driven node.js
Test driven node.jsJay Harris
 

Semelhante a Como NÃO testar o seu projeto de Software. DevDay 2014 (20)

Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
 
Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113Conf soat tests_unitaires_Mockito_jUnit_170113
Conf soat tests_unitaires_Mockito_jUnit_170113
 
Developer Test - Things to Know
Developer Test - Things to KnowDeveloper Test - Things to Know
Developer Test - Things to Know
 
Developer Tests - Things to Know
Developer Tests - Things to KnowDeveloper Tests - Things to Know
Developer Tests - Things to Know
 
How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran MizrahiHow Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran Mizrahi
 
Rails and security
Rails and securityRails and security
Rails and security
 
Cool JVM Tools to Help You Test
Cool JVM Tools to Help You TestCool JVM Tools to Help You Test
Cool JVM Tools to Help You Test
 
Test innode
Test innodeTest innode
Test innode
 
What's New in JavaScript
What's New in JavaScriptWhat's New in JavaScript
What's New in JavaScript
 
Getting Started With Testing
Getting Started With TestingGetting Started With Testing
Getting Started With Testing
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014
 
Aaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security TeamsAaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security Teams
 
[2014/10/06] HITCON Freetalk - App Security on Android
[2014/10/06] HITCON Freetalk - App Security on Android[2014/10/06] HITCON Freetalk - App Security on Android
[2014/10/06] HITCON Freetalk - App Security on Android
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
 
Achievement Unlocked: Drive development, increase velocity, and write blissfu...
Achievement Unlocked: Drive development, increase velocity, and write blissfu...Achievement Unlocked: Drive development, increase velocity, and write blissfu...
Achievement Unlocked: Drive development, increase velocity, and write blissfu...
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
 
Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)Developer Tests - Things to Know (Vilnius JUG)
Developer Tests - Things to Know (Vilnius JUG)
 
Test driven node.js
Test driven node.jsTest driven node.js
Test driven node.js
 

Mais de alexandre freire

Making People Awesome @Nubank TDC Floripa 2019
Making People Awesome @Nubank TDC Floripa 2019Making People Awesome @Nubank TDC Floripa 2019
Making People Awesome @Nubank TDC Floripa 2019alexandre freire
 
Technical Product Management at Nubank
Technical Product Management at NubankTechnical Product Management at Nubank
Technical Product Management at Nubankalexandre freire
 
Making People Awesome TDC POA 2018 - Alexandre Freire
Making People Awesome   TDC POA 2018 - Alexandre FreireMaking People Awesome   TDC POA 2018 - Alexandre Freire
Making People Awesome TDC POA 2018 - Alexandre Freirealexandre freire
 
Modern Agile and the Future of SW Development GUMARS 2018
Modern Agile and the Future of SW Development GUMARS 2018Modern Agile and the Future of SW Development GUMARS 2018
Modern Agile and the Future of SW Development GUMARS 2018alexandre freire
 
Deploy Contínuo de Software Legado: Loucura ou Genialidade?
Deploy Contínuo de Software Legado: Loucura ou Genialidade?Deploy Contínuo de Software Legado: Loucura ou Genialidade?
Deploy Contínuo de Software Legado: Loucura ou Genialidade?alexandre freire
 
Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...
Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...
Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...alexandre freire
 
Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015
Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015
Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015alexandre freire
 
Tech Safety - um caminho inesperado à excelência
Tech Safety - um caminho inesperado à excelênciaTech Safety - um caminho inesperado à excelência
Tech Safety - um caminho inesperado à excelênciaalexandre freire
 
Como não testar seu projeto de software
Como não testar seu projeto de softwareComo não testar seu projeto de software
Como não testar seu projeto de softwarealexandre freire
 
Ágil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira ÁgilÁgil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira Ágilalexandre freire
 
Progamacao para não programadores
Progamacao para não programadoresProgamacao para não programadores
Progamacao para não programadoresalexandre freire
 
surge con 2011 lightning talk - closed loop server lifecycle
surge con 2011 lightning talk - closed loop server lifecycle surge con 2011 lightning talk - closed loop server lifecycle
surge con 2011 lightning talk - closed loop server lifecycle alexandre freire
 
Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...
Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...
Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...alexandre freire
 
COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011
COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011
COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011alexandre freire
 

Mais de alexandre freire (16)

Making People Awesome @Nubank TDC Floripa 2019
Making People Awesome @Nubank TDC Floripa 2019Making People Awesome @Nubank TDC Floripa 2019
Making People Awesome @Nubank TDC Floripa 2019
 
Technical Product Management at Nubank
Technical Product Management at NubankTechnical Product Management at Nubank
Technical Product Management at Nubank
 
Making People Awesome TDC POA 2018 - Alexandre Freire
Making People Awesome   TDC POA 2018 - Alexandre FreireMaking People Awesome   TDC POA 2018 - Alexandre Freire
Making People Awesome TDC POA 2018 - Alexandre Freire
 
Modern Agile and the Future of SW Development GUMARS 2018
Modern Agile and the Future of SW Development GUMARS 2018Modern Agile and the Future of SW Development GUMARS 2018
Modern Agile and the Future of SW Development GUMARS 2018
 
Deploy Contínuo de Software Legado: Loucura ou Genialidade?
Deploy Contínuo de Software Legado: Loucura ou Genialidade?Deploy Contínuo de Software Legado: Loucura ou Genialidade?
Deploy Contínuo de Software Legado: Loucura ou Genialidade?
 
Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...
Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...
Como influenciar sua equipe para ser excelente com medo, culpa, vergonha, pun...
 
Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015
Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015
Otimizando sua Máquina Cultural na busca pela excelência QCon SP 2015
 
Agile #FAIL QCon 2013
Agile #FAIL QCon 2013Agile #FAIL QCon 2013
Agile #FAIL QCon 2013
 
Tech Safety - um caminho inesperado à excelência
Tech Safety - um caminho inesperado à excelênciaTech Safety - um caminho inesperado à excelência
Tech Safety - um caminho inesperado à excelência
 
Como não testar seu projeto de software
Como não testar seu projeto de softwareComo não testar seu projeto de software
Como não testar seu projeto de software
 
Divida tecnica
Divida tecnicaDivida tecnica
Divida tecnica
 
Ágil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira ÁgilÁgil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira Ágil
 
Progamacao para não programadores
Progamacao para não programadoresProgamacao para não programadores
Progamacao para não programadores
 
surge con 2011 lightning talk - closed loop server lifecycle
surge con 2011 lightning talk - closed loop server lifecycle surge con 2011 lightning talk - closed loop server lifecycle
surge con 2011 lightning talk - closed loop server lifecycle
 
Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...
Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...
Dívida tecnica: precisando de crédito? Quão fundo entrar e como evitar que o ...
 
COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011
COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011
COWBLAM! - a sua metodologia é a melhor. Agile Brasil 2011
 

Último

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 

Último (20)

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 

Como NÃO testar o seu projeto de Software. DevDay 2014

  • 1. Como NÃO testar SW? uma palestra da
  • 2. @freire_da_silva • Director of Product Safety @IndustrialLogic • Agil desde 2001, lean desde a 1ª série • Founder: AgilCoop, AgilBits e ).( • Mestrado na USP: “Reflexões sobre o Ensino de Metodologias Ágeis na Academia, Indústria e Governo” • Gosto de nadar e construir casas • Experiência e alex@industriallogic.com sucesso com muitos amigos:
  • 3.
  • 5. TODO SW TEM BUG?
  • 6.
  • 7.
  • 8. TODO SW TEM BUG!
  • 10.
  • 11. 1999: ! Imperial instead of metric units ! cause Mars Climate Orbiter… to disintegrate!
  • 12.
  • 13.
  • 14. sslKeyExchange.c if((err=SSLFreeBuffer(&hashCtx))!=0) goto fail; if((err=ReadyHash(&SHA1,&hashCtx))!=0) goto fail; if((err=SHA1.update(&hashCtx,&rand))!=0) goto fail; goto fail; if((err=SHA1.update(&hashCtx,&sign))!=0) goto fail; if((err=SHA1.final(&hashCtx,&hsOut))!=0) goto fail; err = sslRawVerify(…);
  • 15. sslKeyExchange.c if((err=SSLFreeBuffer(&hashCtx))!=0) goto fail; if((err=ReadyHash(&SHA1,&hashCtx))!=0) goto fail; if((err=SHA1.update(&hashCtx,&rand))!=0) goto fail; goto fail; if((err=SHA1.update(&hashCtx,&sign))!=0) goto fail; if((err=SHA1.final(&hashCtx,&hsOut))!=0) goto fail; err = sslRawVerify(…);
  • 16.
  • 17.
  • 18. /* Read type & payload length first */ hbtype = *p++; n2s(p,payload); p1 = p; ! /* Enter response type, length & copy payload */ *bp++ = TLS1_HB_RESPONSE; s2n(payload, bp); memcpy(bp, p1, payload);
  • 19. /* Read type & payload length first */ hbtype = *p++; n2s(p,payload); if (1+2+payload+16 > s->s3->rrec.length) return 0; /* silently discard per RFC 6520 sec. 4 */ p1 = p; ! /* Enter response type, length & copy payload */ *bp++ = TLS1_HB_RESPONSE; s2n(payload, bp); memcpy(bp, p1, payload);
  • 20.
  • 22. ?
  • 23.
  • 26. 1describe “test” do 2 it “should do nothing” do 3 fail 4 end 5 end
  • 27.
  • 28. 1describe “test” do 2 it “should do nothing” do 3 fail 4 end 5 end
  • 29. 1describe “test” do 2 it “should do nothing” do 3 true 4 end 5 end
  • 30.
  • 31. 1describe “test” do 2 it “should do nothing” do 3 true 4 end 5 end ?
  • 32.
  • 33. SCALABILITY NON-FUNCTIONAL REQUIREMENTS RELIABILITY SECURITY USABILITY MAINTAINABILITY ACCESSIBILITY
  • 35. por James Reason RISCOS FALHAS
  • 36.
  • 37.
  • 38. Você APAGA seus testes?
  • 39. ?
  • 40.
  • 41. 100% COVERED CODE. LINE OF CODE YOU COVER
  • 42. 60@Test 61public void setPrice() { 62 Item item = new 63 BasicItem(0.0, true); 64 65 assertEquals(0.0, 66 item.getPrice()); 67 68 //set new price 69 item.setPrice(1.0); 70 assertEquals(1.0, 71 item.getPrice()); 72}
  • 43. 74@Test 75public void isImported_true(){ 76 Item item = new 77 BasicItem(0.0, true); 78 79 assertTrue(item.isImported()); 80}
  • 44. 74@Test 75public void isImported_false(){ 76 Item item = new 77 BasicItem(0.0, false); 78 79 assertFalse(item.isImported()); 80}
  • 45. 28public Double getPrice(){ 25 return price; 26} 27 28public boolean isImported(){ 29 return imported; 30}
  • 46. WHY DO WE TEST?
  • 47. 1while true do 2 print “vou parar?” 3end
  • 48.
  • 50. P AIN
  • 51.
  • 52. FLOW
  • 53. Cost of Quality Assurance (QA) Analysis Design Coding Unit Tests Acceptance Tests Production
  • 54. freqüencia de Uso Das Funcionalidades RARO 19% Sempre 7% Frequente 13% Algumas VEZES Nunca 45% 16%
  • 55.
  • 57. ?
  • 58.
  • 61.
  • 63. Test failed 21 -mes locally & 36 -mes in dev build in the last 6 months.
  • 64.
  • 65. @google If they fail we simply run flaky tests 3x (and keep statistics). Developer time is much more valuable than server time.
  • 66. 1@Test 2public void errorExerciseUploadTooBig { 3 goToExerciseIntroPage(); 4 goToNextPage(); 5 6 type(“labArchive”, path() + TOO_BIG); 7 pause(1000L); 8 assertText(“error: Upload too big!”); 9}
  • 68. How much QUALITY is ENOUGH?
  • 69. Bugs/1KLOC 5 4 3 1 0 0,004 Indústria Nasa
  • 70. Cost($/LOC) 900 675 450 225 0 5 850 Indústria Nasa
  • 71. It will only run once
  • 72. VS <- costumer facing back office ->
  • 73. @martinfowler you’re doing enough testing if the following is true: ■You rarely get bugs that escape into production ■You are rarely hesitant to change some code for fear it will cause production bugs
  • 74. @joshuakerievsky Test first/after misses the point that TDD is more about emergent design than it is about testing. Do you practice emergent design?
  • 75. @kentbeck If I don’t typically make a mistake(...), I don’t test for it. ! Wish there were more examples of “what not to test and how not to test”.
  • 76.
  • 77. 2def create_name(fname, lname): 3 if not isInstance(fname, basestring): 4 raise TypeError(“fname must be a String”) 5 if not isInstance(lname, basestring): 6 raise TypeError(“lname must be a String”) 7 name = fname + lname
  • 78. 1 require ‘spec_helper‘ 2 describe Candidate do 3 context ‘associations‘ do 4 it { should have_many(:proposals) } 5 end 6 7 context ‘validations‘ do 8 it { should validate_presence_of :name } 9 10 it { should ensure_lenght_of(:phone). 11 is_at_least(7). 12 is_at_most(14) 13 } 14 15 it { should_not 16 allow_value(‘blah‘).for(:site) } 17 18 it { should 19 allow_value(‘http://www.blah.com‘) 20 .for(:site) } 21 end 22end
  • 79. 1 require ‘valid_url‘ 2 class Candidate < ActiveRecord::Base 3 has_many :proposals 4 5 validates :name, presence: true 6 7 validates :phone, :length => 8 {:in => 8..14}, 9 :allow_blank 10 11 validates :site, :url => true, 12 :allow_nil => true 13 14end
  • 80. 1 require ‘spec_helper‘ 2 describe Candidates do 3 4 let(:candidate) {double ‘candidate‘} 5 6 before :each do 7 Candidate 8 .should_receive(:find) 9 .with(1).and_return(candidate) 10 end 11 12 it ‘should find the candidate‘ do 13 c = Candidate.find(1) 14 c.should eql candidate 15 end 16end
  • 81. 1Feature: Create proposal 2 As a candidate 3 I want to post my proposals 4 So that voters can evaluate them 5 6 Scenario: 7 Given I am logged in 8 And I am posting a proposal 9 When 10 I fill all fields of the proposal 11 Then 12 I should see a success message
  • 82. 1Scenario: Client sees tooltip for plan 2 Given 3 I select the ‘light‘ plan 4 When 5 I mouse over ‘tooltip‘ 6 Then 7 I should see ‘tooltip‘ content 8 And 9 I mouse out ‘tooltip‘ 10 Then 11 I should not see ‘tooltip‘ content
  • 83. 1require ‘spec_helper‘ 2describe ShoppingCart do 3 4 let(:user) {double ‘user‘} 5 let(:product) {double ‘product‘} 6 7 before :each do 8 Authenticator.should_receive(:auth) 9 .and_return(true) 10 end 11 12 it ‘should addProduct & getTotal‘ do 13 Authenticator.auth(user) 14 cart = ShoppingCart.new 15 cart.add_product(product) 16 cart.get_total 17 end 18end
  • 84. 50@Test 51public void changeMarks() { 52 bot.leftClickAt(view, 53 800, 508); 54 addMarkAt(‘drama’, 1); 55 56 bot.leftClickAt(view, 57 900, 508); 58 addMarkAt(‘act’, 3); 59 60 bot.verifyTooltipAt(30, 190); 61}
  • 86.
  • 87.
  • 88.
  • 89. 1 require ‘spec_helper‘ 2 describe AddressController do 3 4 it ‘should calculate shipping‘ do 5 get :shipping, :zipcode => ‘90210‘ 6 assigns(:shipping).should == ‘8.2‘ 7 end 8 9 end
  • 91. DR Y
  • 92. WET
  • 95. module('MultiSelectQuizTests',{ setup: function() { var container = document.getElementById("qunit-fixture"); var question = "Which foods are Mexican?"; var answers = [ { 'answerText': 'Tacos', 'value': true }, { 'answerText': 'Sushi', 'value': false } ]; ! this.myQuiz = new MultiSelectQuiz ( container, question, answers ); }, }); ! test( "One correct", function() { checkRadio(0, true); checkRadio(1, true); deepEqual(this.myQuiz.grade(), 1, "just 1"); });
  • 96. CSS?
  • 97. it(‘centers logo at top of page’, function() { expect(isConTenteCenteredInPage(logo)).toBe(true); expect(elementPicelsFromTopOfPage(logo)).toBe(12); expect(fontSizeOf(logo)).toBe(22); expect(textColorOf(logo)).toBe(WHITE); });
  • 98.
  • 99. análise de uma falha Students(Can’t(Access(Service( New(Produc5on( Server( And$ Ok(To(Toggle(( Test(Passes( Immune(System( Fails( No(Auto?( Rollback( No(SMS( No(Policy( And$ And$ And$ Non?Standard( Tomcat(Runner( Nginx(Points( To(Down( Service( Non?Standard( Java(Version( JRE(Crash( No(Policy(
  • 100.
  • 101.
  • 102.
  • 104. NÃO É BUG É FEATURE
  • 105.
  • 106. 80% só até amanhã! código de desconto: DEVDAY2014 JAVASCRIPT PYTHON HTTP://industriallogic.com/shop