SlideShare a Scribd company logo
Software Testing
Wallace Reis | wreis
Tuesday, October 08, 2013
Software Testing
Wallace Reis | wreis
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Development
processes
Tuesday, October 08, 2013
Perl Testing?
Tuesday, October 08, 2013
CPAN:
*modules;
*frameworks;
*and toolkits;
Tuesday, October 08, 2013
Testing methods
Tuesday, October 08, 2013
Black-box
Tuesday, October 08, 2013
Input Output
Tuesday, October 08, 2013
use strict;
use warnings;
use Test::More;
use_ok 'Module';
ok(my $test = Module->new);
ok($test->sum(1,2) == 3);
ok($test->sum(3,2) == 5);
done_testing;
Tuesday, October 08, 2013
White-box
Tuesday, October 08, 2013
sub sum {
my ( $self, $x, $y ) = @_;
return undef
unless defined $x && defined $y;
if ( $x == 0 ) {
return $y;
}
elsif ( $y == 0 ) {
return $x;
}
else {
return $x + $y;
}
}
Tuesday, October 08, 2013
use strict;
use warnings;
use Test::More;
use_ok 'Module';
ok(my $test = Module->new);
ok($test->sum(0,2) == 2);
ok($test->sum(1,0) == 1);
ok(!$test->sum(1));
ok(!$test->sum());
done_testing;
Tuesday, October 08, 2013
Testing levels
Tuesday, October 08, 2013
Unit
Tuesday, October 08, 2013
use strict;
use warnings;
use Test::More;
my $search_comp;
BEGIN {
use_ok 'I5::123people::Website';
$search_comp = 'I5::123people::Website::Model::Search';
use_ok $search_comp;
}
foreach my $source ( qw{http://foo.bar.com https://foo.bar.com/
ftp://foo.bar.com ftps://foo.bar.com/ ftp://wreis@foo.bar.com/
ftp://wreis:passwd@foo.bar.com/}
) {
is($search_comp->extract_domain($source), 'foo.bar.com');
}
# ...
done_testing;
Tuesday, October 08, 2013
Mock objects
and
Method stubs
Tuesday, October 08, 2013
use strict;
use warnings;
use Test::More;
use MooseX::Declare;
my $class = class extends Catalyst::Model
with Catalyst::Component::InstancePerRequest
{
has balance => ( ... );
method deposit (Num $amount) {
$self->balance( $self->balance + $amount );
}
method get_session_id { return ‘maow98ua92’ }
};
ok($class->name->new);
my $role = role { ... };
#...
done_testing;
Tuesday, October 08, 2013
Integration
Tuesday, October 08, 2013
use strict;
use warnings;
use Test::More;
use Test::WWW:::Mechanize;
my $data = {
name => 'MyFoo',
description => 'MyFoo é uma...',
};
my $mech = Test::WWW::Mechanize->new;
$mech->get_ok('/foo');
$mech->submit_form_ok({
with_fields => $data,
button => 'submit',
}, 'form submit...');
$mech->content_contains($data->{$_})
for qw/name description/;
# ...
done_testing;
Tuesday, October 08, 2013
Regression
Tuesday, October 08, 2013
Acceptance
Tuesday, October 08, 2013
use strict;
use warnings;
use Test::More;
use lib 't/lib';
use PeopleTest;
my $people_test = PeopleTest->new;
$people_test->log_disable('error');
my $mech = $people_test->get_mech;
check_error_400('/a8i2k282543jwd09awdj', 404);
check_error_400('/page/a8i2k282543jwd09awdj', 404);
sub check_error_400 {
my ( $path, $code ) = @_;
my $res = $mech->get($path);
ok($res->code == $code) or diag($res->code);
is($res->header('Pragma'), 'no-cache');
is($res->header('Cache-Control'), 'no-cache');
ok(defined $res->header('X-Robots-Tag'));
like($res->content, qr{meta.*robots.*noindex}i);
}
done_testing;
Tuesday, October 08, 2013
User acceptance
Tuesday, October 08, 2013
Platform
Tuesday, October 08, 2013
$ CATALYST_SERVER=‘http://
localhost:3000/’ prove -lr t
$ CATALYST_SERVER=‘http://www.
123people.biz/’ prove -lr t
$ CATALYST_SERVER=‘http://www.
123people.com/’ prove -lr t
Tuesday, October 08, 2013
Coverage
Tuesday, October 08, 2013
Devel::Cover
Tuesday, October 08, 2013
Tuesday, October 08, 2013
More info...
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Tuesday, October 08, 2013
Thank you!
Discussion?
Tuesday, October 08, 2013

More Related Content

PDF
Testing orm based code
Viktor Turskyi
 
PDF
Unittests für Dummies
Lars Jankowfsky
 
PPT
Mocking Dependencies in PHPUnit
mfrost503
 
PPTX
Angular 2.0 Views
Eyal Vardi
 
PDF
Grails on GAE/J
Kiyotaka Oku
 
PDF
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
PDF
Seven Steps to Better PHP Code
guestacd674c
 
PDF
Php unit the-mostunknownparts
Bastian Feder
 
Testing orm based code
Viktor Turskyi
 
Unittests für Dummies
Lars Jankowfsky
 
Mocking Dependencies in PHPUnit
mfrost503
 
Angular 2.0 Views
Eyal Vardi
 
Grails on GAE/J
Kiyotaka Oku
 
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
Seven Steps to Better PHP Code
guestacd674c
 
Php unit the-mostunknownparts
Bastian Feder
 

What's hot (20)

PPTX
Closure
Xiaojun REN
 
PDF
Advanced php testing in action
Jace Ju
 
PPT
Ext oo
o52tiger
 
PDF
Lazy evaluation drupal camp moscow 2014
Evgeny Nikitin
 
PDF
What Is Security
Jason Ragsdale
 
PDF
Tulsa techfest2010 security
Jason Ragsdale
 
PPTX
PHP Traits
mattbuzz
 
KEY
Data::FormValidator Simplified
Fred Moyer
 
PDF
Command Bus To Awesome Town
Ross Tuck
 
PDF
Things I Believe Now That I'm Old
Ross Tuck
 
PDF
Event sourcing w PHP (by Piotr Kacała)
GOG.com dev team
 
KEY
Php 101: PDO
Jeremy Kendall
 
PDF
Upgrade your javascript to drupal 8
Théodore Biadala
 
PDF
PHP Data Objects
Wez Furlong
 
PDF
Django - Know Your Namespace: Middleware
howiworkdaily
 
PDF
購物車程式架構簡介
Jace Ju
 
PDF
PhpUnit - The most unknown Parts
Bastian Feder
 
PDF
Introduction to CQRS and Event Sourcing
Samuel ROZE
 
Closure
Xiaojun REN
 
Advanced php testing in action
Jace Ju
 
Ext oo
o52tiger
 
Lazy evaluation drupal camp moscow 2014
Evgeny Nikitin
 
What Is Security
Jason Ragsdale
 
Tulsa techfest2010 security
Jason Ragsdale
 
PHP Traits
mattbuzz
 
Data::FormValidator Simplified
Fred Moyer
 
Command Bus To Awesome Town
Ross Tuck
 
Things I Believe Now That I'm Old
Ross Tuck
 
Event sourcing w PHP (by Piotr Kacała)
GOG.com dev team
 
Php 101: PDO
Jeremy Kendall
 
Upgrade your javascript to drupal 8
Théodore Biadala
 
PHP Data Objects
Wez Furlong
 
Django - Know Your Namespace: Middleware
howiworkdaily
 
購物車程式架構簡介
Jace Ju
 
PhpUnit - The most unknown Parts
Bastian Feder
 
Introduction to CQRS and Event Sourcing
Samuel ROZE
 
Ad

Viewers also liked (20)

PPTX
Tic’s y enfermería
Valentina Arboleda
 
PPT
Uso etico y moral de las tecnologias de informacion
Javier Balan
 
PDF
A reviravolta do desenvolvimento web
Wallace Reis
 
PDF
Alertamerica2012
Gustavo Marcelo Medina Narbona
 
PPTX
Challenges of Monetary Policy Communication
Kelvin Kizito Kiyingi
 
DOC
Cônicas e parábolas phdnet
Jeremias Barreto
 
PDF
L5 assignment: How to integrate the modern 70 year-old into a connected society.
Agustín Schelstraete
 
PDF
European union: a quick explaination
Stefan van der Weide
 
PPT
My Presentation
redgreen321
 
PDF
IDEO U - Final project
Agustín Schelstraete
 
PPTX
week4-measuring data
ispkosova
 
PPTX
Windows 8 Presentation for Mobile 101 - Thinslices
Bujdea Bogdan
 
PPT
Money Museums As Tools For Economic Education
Kelvin Kizito Kiyingi
 
PPTX
Actividad 14
Alejandra Giral
 
PPTX
Proposal rehearsal sze_chuliu 1021216(ver. 2.1)
思竹 劉
 
PPTX
áLbum fotográfico EAD
josenagel_34
 
PPTX
Miguel s anchez
Ja'r R'oz
 
PPTX
Week3 intro to computer (history of comps, comps in everyday life)
ispkosova
 
PPT
Ya soy grande
camimorelli
 
PPTX
Presentation(ii)劉思竹v2.1
思竹 劉
 
Tic’s y enfermería
Valentina Arboleda
 
Uso etico y moral de las tecnologias de informacion
Javier Balan
 
A reviravolta do desenvolvimento web
Wallace Reis
 
Challenges of Monetary Policy Communication
Kelvin Kizito Kiyingi
 
Cônicas e parábolas phdnet
Jeremias Barreto
 
L5 assignment: How to integrate the modern 70 year-old into a connected society.
Agustín Schelstraete
 
European union: a quick explaination
Stefan van der Weide
 
My Presentation
redgreen321
 
IDEO U - Final project
Agustín Schelstraete
 
week4-measuring data
ispkosova
 
Windows 8 Presentation for Mobile 101 - Thinslices
Bujdea Bogdan
 
Money Museums As Tools For Economic Education
Kelvin Kizito Kiyingi
 
Actividad 14
Alejandra Giral
 
Proposal rehearsal sze_chuliu 1021216(ver. 2.1)
思竹 劉
 
áLbum fotográfico EAD
josenagel_34
 
Miguel s anchez
Ja'r R'oz
 
Week3 intro to computer (history of comps, comps in everyday life)
ispkosova
 
Ya soy grande
camimorelli
 
Presentation(ii)劉思竹v2.1
思竹 劉
 
Ad

Similar to Software Testing (20)

PDF
Test-Tutorial
tutorialsruby
 
PDF
Test-Tutorial
tutorialsruby
 
PDF
Test tutorial
msksaba
 
PDF
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
Rodolfo Carvalho
 
PDF
Testing Code and Assuring Quality
Kent Cowgill
 
PDF
The $path to knowledge: What little it take to unit-test Perl.
Workhorse Computing
 
KEY
Workshop quality assurance for php projects tek12
Michelangelo van Dam
 
PDF
Intro to PHP Testing
Ran Mizrahi
 
PDF
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 
PDF
Unit Testing Lots of Perl
Workhorse Computing
 
PDF
Keeping objects healthy with Object::Exercise.
Workhorse Computing
 
PDF
Php unit the-mostunknownparts
Bastian Feder
 
ODP
Advanced Perl Techniques
Dave Cross
 
PDF
Php tests tips
Damian Sromek
 
PDF
Testing-Tools-Magnitia-Content.pdf
AnanthReddy38
 
PDF
Workshop quality assurance for php projects - phpbelfast
Michelangelo van Dam
 
PDF
Automated Testing with Ruby
Keith Pitty
 
KEY
How To Test Everything
noelrap
 
PDF
A Whirlwind Tour of Test::Class
Curtis Poe
 
PPTX
Prowess presentation
Thenraja Vettivelraj
 
Test-Tutorial
tutorialsruby
 
Test-Tutorial
tutorialsruby
 
Test tutorial
msksaba
 
O CPAN tem as ferramentas que você precisa para fazer TDD em Perl, o Coding D...
Rodolfo Carvalho
 
Testing Code and Assuring Quality
Kent Cowgill
 
The $path to knowledge: What little it take to unit-test Perl.
Workhorse Computing
 
Workshop quality assurance for php projects tek12
Michelangelo van Dam
 
Intro to PHP Testing
Ran Mizrahi
 
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 
Unit Testing Lots of Perl
Workhorse Computing
 
Keeping objects healthy with Object::Exercise.
Workhorse Computing
 
Php unit the-mostunknownparts
Bastian Feder
 
Advanced Perl Techniques
Dave Cross
 
Php tests tips
Damian Sromek
 
Testing-Tools-Magnitia-Content.pdf
AnanthReddy38
 
Workshop quality assurance for php projects - phpbelfast
Michelangelo van Dam
 
Automated Testing with Ruby
Keith Pitty
 
How To Test Everything
noelrap
 
A Whirlwind Tour of Test::Class
Curtis Poe
 
Prowess presentation
Thenraja Vettivelraj
 

Recently uploaded (20)

PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Software Development Methodologies in 2025
KodekX
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Doc9.....................................
SofiaCollazos
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 

Software Testing