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-...
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 ( $...
use strict;
use warnings;
use Test::More;
use_ok 'Module';
ok(my $test = Module->new);
ok($test->sum(0,2) == 2);
ok($test-...
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::12...
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::Co...
Integration
Tuesday, October 08, 2013
use strict;
use warnings;
use Test::More;
use Test::WWW:::Mechanize;
my $data = {
name => 'MyFoo',
description => 'MyFoo é...
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...
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
$ CATAL...
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
Upcoming SlideShare
Loading in...5
×

Software Testing

279

Published on

Talk given at Yelster Digital workshop in 2011.

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
279
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Software Testing

  1. 1. Software Testing Wallace Reis | wreis Tuesday, October 08, 2013
  2. 2. Software Testing Wallace Reis | wreis Tuesday, October 08, 2013
  3. 3. Tuesday, October 08, 2013
  4. 4. Tuesday, October 08, 2013
  5. 5. Tuesday, October 08, 2013
  6. 6. Tuesday, October 08, 2013
  7. 7. Tuesday, October 08, 2013
  8. 8. Development processes Tuesday, October 08, 2013
  9. 9. Perl Testing? Tuesday, October 08, 2013
  10. 10. CPAN: *modules; *frameworks; *and toolkits; Tuesday, October 08, 2013
  11. 11. Testing methods Tuesday, October 08, 2013
  12. 12. Black-box Tuesday, October 08, 2013
  13. 13. Input Output Tuesday, October 08, 2013
  14. 14. 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
  15. 15. White-box Tuesday, October 08, 2013
  16. 16. 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
  17. 17. 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
  18. 18. Testing levels Tuesday, October 08, 2013
  19. 19. Unit Tuesday, October 08, 2013
  20. 20. 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
  21. 21. Mock objects and Method stubs Tuesday, October 08, 2013
  22. 22. 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
  23. 23. Integration Tuesday, October 08, 2013
  24. 24. 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
  25. 25. Regression Tuesday, October 08, 2013
  26. 26. Acceptance Tuesday, October 08, 2013
  27. 27. 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
  28. 28. User acceptance Tuesday, October 08, 2013
  29. 29. Platform Tuesday, October 08, 2013
  30. 30. $ 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
  31. 31. Coverage Tuesday, October 08, 2013
  32. 32. Devel::Cover Tuesday, October 08, 2013
  33. 33. Tuesday, October 08, 2013
  34. 34. More info... Tuesday, October 08, 2013
  35. 35. Tuesday, October 08, 2013
  36. 36. Tuesday, October 08, 2013
  37. 37. Tuesday, October 08, 2013
  38. 38. Thank you! Discussion? Tuesday, October 08, 2013
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×