SlideShare a Scribd company logo
Integration Testing Practice
using Perl
Masaki Nakagawa / @ikasam_a
DeNA Co., Ltd.
About Me
• Masaki Nakagawa
• @ikasam_a
• github.com/masaki
• metacpan.org/author/MASAKI
• Yokohama.pm
Ad.
http://gihyo.jp/magazine/wdpress/archive/2013/vol75
http://gihyo.jp/book/2013/978-4-7741-5864-8
http://yapcasia.org/2013/talk/show/9c756568-ea92-11e2-ba88-5f716aeab6a4
What's new in Carton & cpanm
(11:40 ~ 12:00)
http://atnd.org/events/40914
Software Engineer in Test
at DeNA
Masaki Nakagawa / @ikasam_a
DeNA Co., Ltd.
http://www.slideshare.net/masaki/software-engineer-in-test-at-dena
Testing Casual Talks #2
2013/11/xx
Works
• DeNA Co.,Ltd.
• SWET Group, Platform System Dept.
• Founder of Platform QA Team (2012/01~)
• Manager of SWET Group (2013/08~)
http://dena.com/topics/2013/07/swettechtalk33.php
with @shyouhei
YAPC::Asia Tokyo 2013 特別座談会
「Rubyの良いところ語ってください ∼そんなPerlで大丈夫か?∼」
(13:00 ~ 14:00)
http://yapcasia.org/2013/talk/show/c6b08f02-f293-11e2-ba15-895a6aeab6a4
Roles
• SWET (Software Engineer in Test)
• TE (Test Engineer)
What is SWET?
• a developer role for testing
• write test framework
• build test environments
• write test codes
http://en.wikipedia.org/wiki/SET
http://googletesting.blogspot.jp/2011/02/how-google-
tests-software-part-two.html
Several Names
• SWET @DeNA
• SET (Software Engineer in Test) @Google
• SDET (Software Development Engineer in Test) @Microsoft
Google’s “SET”
• Google Testing Blog
• http://googletesting.blogspot.com
• How Google Tests Software
• http://googletesting.blogspot.jp/2011/01/how-google-tests-software.html
Developer Productivity
• to improve productivity
• Base Technology
• Development Infrastructure
• as SWET
• support developer testing
• support development with tests
Testing Activities
SHOULD
be in Developments
SWET Group
Mission Statement
• For platform engineers
• To develop new features
• Should keep the quality of platform system
About SWET Group
• To verify the Platform System
• To write AUTOMATION tests
• To improve Platform System quality
is NOT a tester, is a TEST ENGINEER
What is SWET?
• a developer role for testing
• write test framework
• build test environments
• write test codes
How to ?
Classification of Testing
Perspective Target
How What
Perspective
•Developer Testing
•Acceptance Testing
Developer or User (Customer)
Target
•Unit Testing
•Integration Testing
One or More
How
•Black Box Testing
•White Box Testing
•Gray Box Testing
Techniques for writing tests
What
•Functional Testing
•Non-Functional Testing
• Performance / Stress / Usability / ...
the Purpose of testing
Classification of Testing
Perspective Target
How What
Target
•Unit Testing
•Integration Testing
One or More
Unit Testing
• What is “Unit” ?
• METHODs in module
• COMPONENTs in system
• ...
• Focus to input/output of unit
Integration Testing
• What is “Integration”
• MODULEs (= component)
• COMPONENTs (= system)
• ...
• Consider interaction/orchestration
Interaction
• Unit Testing
• ONLY Focus to Test Target
• Mocking/Stubbing OTHERs
• Integration Testing
• in Real Environments
Case Study
(case-1) Web API
• HTTP JSON-RPC API
• Interaction & Integration
• API Server Modules
• API Server, DB, Cache Server
API Server
module module module
API ServerAPI Server
DB
API ServerAPI Server
Cache
Test Client
Conditions
• (IN) HTTP Request to API Server
• (OUT) JSON Response from API Server
HTTP Client
•LWP::UserAgent
•Furl
JSONValidation
• JSON + Test::Deep family
• T::D::Matcher,T::D::Cond
• use JSON-Schema
• https://github.com/zigorou/perl-JSV
API Server
module module module
API ServerAPI Server
DB
API ServerAPI Server
Cache
Test Client
Gray Box Fixture
Gray Box Fixture
• DB / Cache Manipulation
• insert test-case specific data
• delete cache for continuous tests
API ServerAPI ServerAPI Server
module module module
API ServerAPI Server
DB
API ServerAPI Server
Cache
Test Client
Specific Server Request
Specific Server Request
• LWP::UserAgent::DNS::Hosts
• Furl + “inet_aton” option
• programmable local DNS (MyDNS)
Dump Messages
• LWP keeps previous request
• as HTTP::Response::request()
• Furl + “capture_request” option
(case-2) Web Application
• Interaction & Integration
• Web App Modules
• like MVC
• Web App, DB, Cache Server
Web Application
M V C
API ServerAPI Server
DB
API ServerAPI Server
Cache
Test Browser
Conditions
• (IN) HTTP Request to Web App
• (OUT) HTML Response from Web App
Browser / User Agent
•WWW::Mechanize
•Selenium::Remote::Driver
•Wight
•Brownie
use Test::More;
use Brownie::Session;
my $session = Brownie::Session->new(
driver => 'Mechanize',
app_host => 'http://app.example.com/',
);
$session->visit('/');
is $session->title => 'Title';
$session->fill_in('User Name' => 'brownie');
$session->fill_in('Email Address' => 'brownie@example.com');
$session->click_button('Login');
like $session->source => qr/Welcome (.+)/;
done_testing;
e.g.) Brownie
Test Browser Test Browser
Web Application
M V C
API ServerAPI Server
DB
API ServerAPI Server
Cache
Switch Browser
Switch Browser
• Browser can’t touch HTTP Header
• Emulator can’t parse JavaScript
• Save/Restore pseudo browser state
Other Modules
• Test::Ika (RSpec for Perl)
• Test::Requires::Env
• App::envfile
• Config::Pit
Test::Ika
use Test::Ika;
use Test::More;
describe 'nekokak API' => sub {
my $client;
before_each {
$client = NekokakClient->new(icon => 1);
};
it 'should return response with icon' => sub {
my $res = $client->request(method => 'dis');
ok $res->{icon};
};
};
runtests;
Test::Requires::Env
use Test::Requires::Env qw(
USERNAME
PASSWORD
);
Questions?

More Related Content

PDF
Perl Testing Consideration (seen from other languages)
PDF
Test Engineering on Mobage
PDF
Perl Continous Integration
PPTX
Story Testing Approach for Enterprise Applications using Selenium Framework
PDF
Rspec and Capybara Intro Tutorial at RailsConf 2013
PDF
KYSUC - Keep Your Schema Under Control
PDF
Maven - Taming the Beast
PDF
Android Continuous Integration and Automation - Enrique Lopez Manas, Sixt
Perl Testing Consideration (seen from other languages)
Test Engineering on Mobage
Perl Continous Integration
Story Testing Approach for Enterprise Applications using Selenium Framework
Rspec and Capybara Intro Tutorial at RailsConf 2013
KYSUC - Keep Your Schema Under Control
Maven - Taming the Beast
Android Continuous Integration and Automation - Enrique Lopez Manas, Sixt

What's hot (20)

PDF
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
PDF
Unit testing - A&BP CC
PPTX
Automated Acceptance Tests & Tool choice
PDF
Integration testing - A&BP CC
PPTX
Releasing High Quality Packages - Longhorn PHP 2021
PDF
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous ...
PDF
So You Just Inherited a $Legacy Application… NomadPHP July 2016
PDF
Karate, the black belt of HTTP API testing?
PPTX
Robot Framework
ODP
Integration Testing in Python
PDF
Automate your build on Android with Jenkins
PDF
Karim Fanadka
PDF
Drupalcamp Simpletest
PDF
Testing Alfresco extensions
PPTX
What I Learned From Writing a Test Framework (And Why I May Never Write One A...
PDF
Continuous Integration for your Android projects
PPTX
Build Automation in Android
PDF
Perl Development Environment Tooling
PPTX
Python in Test automation
PDF
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
Unit testing - A&BP CC
Automated Acceptance Tests & Tool choice
Integration testing - A&BP CC
Releasing High Quality Packages - Longhorn PHP 2021
6º Encontro do Grupo de Testes Carioca - Testes em um contexto de Continuous ...
So You Just Inherited a $Legacy Application… NomadPHP July 2016
Karate, the black belt of HTTP API testing?
Robot Framework
Integration Testing in Python
Automate your build on Android with Jenkins
Karim Fanadka
Drupalcamp Simpletest
Testing Alfresco extensions
What I Learned From Writing a Test Framework (And Why I May Never Write One A...
Continuous Integration for your Android projects
Build Automation in Android
Perl Development Environment Tooling
Python in Test automation
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Ad

Viewers also liked (20)

PPTX
10年モノ熟成Perlとの付き合い方
ODP
Best Practice Testing with Lime 2
PPTX
Model-Based Testing: Theory and Practice. Keynote @ MoTiP (ISSRE) 2012.
PPTX
Automating Perl deployments with Hudson
PDF
Acceptance & Integration Testing With Behat (PHPNw2011)
PDF
Testing & Integration (The Remix)
PPT
Exploratory Testing As A Quest
PDF
Continuous Integration Testing in Django
PPT
Testing Practice: Lera Technologies
PDF
Software Engineer in Test at DeNA
PDF
A Taste of Exploratory Testing
PPT
Wacate2013 s bpp_session
PPTX
What is this exploratory testing thing
PPTX
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
PDF
はじめてのリーンスタートアップ
PPT
Testing capability ppt
PPT
2016年のPerl (Long version)
PPTX
WebサービスのソフトウェアQAと自動テスト戦略
PDF
Unit and integration Testing
PDF
10分でわかったつもりになるlean start up ~リーンスタートアップって何ですか?~
10年モノ熟成Perlとの付き合い方
Best Practice Testing with Lime 2
Model-Based Testing: Theory and Practice. Keynote @ MoTiP (ISSRE) 2012.
Automating Perl deployments with Hudson
Acceptance & Integration Testing With Behat (PHPNw2011)
Testing & Integration (The Remix)
Exploratory Testing As A Quest
Continuous Integration Testing in Django
Testing Practice: Lera Technologies
Software Engineer in Test at DeNA
A Taste of Exploratory Testing
Wacate2013 s bpp_session
What is this exploratory testing thing
Tips for Writing Better Charters for Exploratory Testing Sessions by Michael...
はじめてのリーンスタートアップ
Testing capability ppt
2016年のPerl (Long version)
WebサービスのソフトウェアQAと自動テスト戦略
Unit and integration Testing
10分でわかったつもりになるlean start up ~リーンスタートアップって何ですか?~
Ad

Similar to Integration Testing Practice using Perl (20)

PPTX
Testing for Logic App Solutions | Integration Monday
PPTX
Testing API's: Tools & Tips & Tricks (Oh My!)
PDF
There's more to Ratpack than non-blocking
PPTX
Functional Testing of RESTful Applications
PPTX
Introduction to cypress in Angular (Chinese)
PDF
KrishnaToolComparisionPPT.pdf
PPT
Introduction to Play Framework
PDF
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
PDF
How to use selenium successfully
PPTX
Solving micro-services and one site problem
PDF
From legacy to DDD (slides for the screencast)
PPTX
Level Up Your Salesforce Unit Testing
PDF
Google App Engine
PPTX
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
PPTX
Developing for the Atlassian Ecosystem
PDF
Developers Testing - Girl Code at bloomon
PDF
Stackato v4
PDF
Escaping Test Hell - ACCU 2014
PDF
How To Use Selenium Successfully
PDF
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
Testing for Logic App Solutions | Integration Monday
Testing API's: Tools & Tips & Tricks (Oh My!)
There's more to Ratpack than non-blocking
Functional Testing of RESTful Applications
Introduction to cypress in Angular (Chinese)
KrishnaToolComparisionPPT.pdf
Introduction to Play Framework
Java-Jersey 到 Python-Flask 服務不中斷重構之旅
How to use selenium successfully
Solving micro-services and one site problem
From legacy to DDD (slides for the screencast)
Level Up Your Salesforce Unit Testing
Google App Engine
CMG imPACt2016 - Mobile performance testing - Vendor training - Federico Tole...
Developing for the Atlassian Ecosystem
Developers Testing - Girl Code at bloomon
Stackato v4
Escaping Test Hell - ACCU 2014
How To Use Selenium Successfully
JIRA Performance Testing in Pictures - Edward Bukoski Michael March

More from Masaki Nakagawa (8)

PDF
YAPCと俺 (吉祥寺.pm #17)
PPTX
レシピブログのサービス設計と今後の展望
PPTX
DeNAが取り組む Software Engineer in Test
PPTX
5minQues - SWET近況報告
PDF
2014-04-22 Ques #4 Automation Testing of Mobage Platform
PDF
Carton について何か話す
PDF
As an Test Engineer
PDF
YAPCと俺 (吉祥寺.pm #17)
レシピブログのサービス設計と今後の展望
DeNAが取り組む Software Engineer in Test
5minQues - SWET近況報告
2014-04-22 Ques #4 Automation Testing of Mobage Platform
Carton について何か話す
As an Test Engineer

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation theory and applications.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectral efficient network and resource selection model in 5G networks
Encapsulation theory and applications.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
Electronic commerce courselecture one. Pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
Network Security Unit 5.pdf for BCA BBA.

Integration Testing Practice using Perl