• Like
Software Testing
Upcoming SlideShare
Loading in...5
×
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
192
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
12
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Software Testing Wallace Reis | wreis Tuesday, October 08, 2013
  • 2. Software Testing Wallace Reis | wreis Tuesday, October 08, 2013
  • 3. Tuesday, October 08, 2013
  • 4. Tuesday, October 08, 2013
  • 5. Tuesday, October 08, 2013
  • 6. Tuesday, October 08, 2013
  • 7. Tuesday, October 08, 2013
  • 8. Development processes Tuesday, October 08, 2013
  • 9. Perl Testing? Tuesday, October 08, 2013
  • 10. CPAN: *modules; *frameworks; *and toolkits; Tuesday, October 08, 2013
  • 11. Testing methods Tuesday, October 08, 2013
  • 12. Black-box Tuesday, October 08, 2013
  • 13. Input Output Tuesday, October 08, 2013
  • 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. White-box Tuesday, October 08, 2013
  • 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. 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. Testing levels Tuesday, October 08, 2013
  • 19. Unit Tuesday, October 08, 2013
  • 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. Mock objects and Method stubs Tuesday, October 08, 2013
  • 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. Integration Tuesday, October 08, 2013
  • 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. Regression Tuesday, October 08, 2013
  • 26. Acceptance Tuesday, October 08, 2013
  • 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. User acceptance Tuesday, October 08, 2013
  • 29. Platform Tuesday, October 08, 2013
  • 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. Coverage Tuesday, October 08, 2013
  • 32. Devel::Cover Tuesday, October 08, 2013
  • 33. Tuesday, October 08, 2013
  • 34. More info... Tuesday, October 08, 2013
  • 35. Tuesday, October 08, 2013
  • 36. Tuesday, October 08, 2013
  • 37. Tuesday, October 08, 2013
  • 38. Thank you! Discussion? Tuesday, October 08, 2013