SlideShare a Scribd company logo
Using the
Power to Prove
DeNA Co., Ltd.
Kazuho Oku
Do you know prove?
Have you ever used it?
Sep 20 2013 Using the Power to Prove 2
Prove is…
command-line interface of Test::Harness
Test::Harness is the test runner
Sep 20 2013 Using the Power to Prove 3
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/00-base.t t/01-new.t t/02-use.t
t/03-use-error.t t/04-use-defaults.t
t/00-base.t .......... ok
t/01-new.t ........... ok
…
$ prove
t/00-base.t .......... ok
t/01-new.t ........... ok
…
Test Anything Protocol (TAP)
Test::Harness runs the scripts and
aggregates the results
test scripts return the data using TAP
Sep 20 2013 Using the Power to Prove 4
$ perl t/00-base.t
1..14
ok 1 - use Class::Accessor::Lite;
ok 2 - call mk_accessors
ok 3
ok 4
…
History of Test::Harness and TAP
TAP exists since Perl 1
Test::Harness is part of Perl core
and is part of Linux Standards Base
bindings exist for many programming
languages
 http://en.wikipedia.org/wiki/Test_Anything_Protocol
Sep 20 2013 Using the Power to Prove 5
Prove has many powerful options
Sep 20 2013 Using the Power to Prove 6
$ prove -j 8 --state hot,fast,save
- runs 8 tests in parallel
- run the tests that failed first
- run the fast tests first,
and then others that takes time
- update the test stats
Can we write tests in other programming
languages, and aggregate the results
using prove?
Sep 20 2013 Using the Power to Prove 7
Prove runs scripts written in any language
but how?
Sep 20 2013 Using the Power to Prove 8
$ cat bf.t
#! /usr/local/bin/yabi
-[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[--
>+++<]>+.>++++++++++.
$ yabi bf.t
1..1
ok 1
$ prove bf.t
bf.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU)
Result: PASS
PerlProve runs scripts written in any language
Perl understands the shebang
Sep 20 2013 Using the Power to Prove 9
$ cat bf.t
#! /usr/local/bin/yabi
-[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[--
>+++<]>+.>++++++++++.
$ perl bf.t
1..1
ok 1
PerlProve runs scripts written in any language
but not binary executables…
Sep 20 2013 Using the Power to Prove 10
$ cat bin.c
#include <stdio.h>
int main(int argc, char** argv)
{
printf("1..1n");
printf("ok 1n");
return 0;
}
$ perl bin
Unrecognized character xCF; marked by <-- HERE after <-- HERE near
column 1 at bin line 1.
prove --exec '' solves the problem
why?
Sep 20 2013 Using the Power to Prove 11
$ prove –h
…
-e, --exec Interpreter to run the tests ('' for compiled tests.)
…
$ prove --exec '' bin
bin .. open3: exec of bin failed at
/System/Library/Perl/5.12/TAP/Parser/Iterator/Process.pm line 163.
bin .. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
prove --exec '' solves the problem
specify the paths, or add . to $PATH
but would test scripts stop running on Windows
Sep 20 2013 Using the Power to Prove 12
$ prove --exec '' t/bin
t/bin .. ok
All tests successful.
Files=1, Tests=1, 1 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
$ PATH=".:$PATH" prove --exec '' bin
bin .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
Extensions can be other than .t
use: --ext ""
Sep 20 2013 Using the Power to Prove 13
$ prove --ext '' --exec '' .
./test.bf ... ok
./test.out .. ok
./test.sh ... ok
All tests successful.
Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
.proverc
Save the prove options for the project
Sep 20 2013 Using the Power to Prove 14
$ cat .proverc
--ext '' --exec ''
$ prove .
./test.bf ... ok
./test.out .. ok
./test.sh ... ok
All tests successful.
Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
Test scripts are searched by default from t/
Sep 20 2013 Using the Power to Prove 15
$ cat .proverc
--ext '' --exec ''
$ prove
t/test.bf ... ok
t/test.out .. ok
t/test.sh ... ok
All tests successful.
Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU)
Result: PASS
Prove is powerful! Can we run programs
other than test scripts?
Sep 20 2013 Using the Power to Prove 16
Running things other than test scripts
cron tasks
service monitoring
Sep 20 2013 Using the Power to Prove 17
$ ls t
http.t memcached.t mysql.t ping.t
smtp.t
$ prove
t/http.t ....... ok
t/memcached.t .. ok
t/mysql.t ...... ok
t/ping.t ....... ok
t/smtp.t ....... ok
All tests successful.
Conclusion
Sep 20 2013 Using the Power to Prove 18
Conclusion
Prove is a proven task runner
can run any kind of tasks and generate a report
preinstalled on most systems
uses TAP - an established protocol
Sep 20 2013 Using the Power to Prove 19

More Related Content

What's hot (20)

Chap06
Chap06Chap06
Chap06
Dr.Ravi
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
Tony Fabeen
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
CODE BLUE
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
Simon Su
 
Penetration testing using python
Penetration testing using pythonPenetration testing using python
Penetration testing using python
Purna Chander K
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVM
sunng87
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Geeks Anonymes
 
Shell Script
Shell ScriptShell Script
Shell Script
Adam Victor Brandizzi
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Manav Prasad
 
Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed Perl
Hideaki Ohno
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
rjsmelo
 
Unix 5 en
Unix 5 enUnix 5 en
Unix 5 en
Simonas Kareiva
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
sascha_klein
 
Quize on scripting shell
Quize on scripting shellQuize on scripting shell
Quize on scripting shell
lebse123
 
Augeas
AugeasAugeas
Augeas
lutter
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In Python
Marwan Osman
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machine
julien pauli
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programming
kayalkarnan
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 
Unix shell scripts
Unix shell scriptsUnix shell scripts
Unix shell scripts
Prakash Lambha
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
Tony Fabeen
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
CODE BLUE
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
Simon Su
 
Penetration testing using python
Penetration testing using pythonPenetration testing using python
Penetration testing using python
Purna Chander K
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVM
sunng87
 
Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed Perl
Hideaki Ohno
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
rjsmelo
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
sascha_klein
 
Quize on scripting shell
Quize on scripting shellQuize on scripting shell
Quize on scripting shell
lebse123
 
Augeas
AugeasAugeas
Augeas
lutter
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In Python
Marwan Osman
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machine
julien pauli
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programming
kayalkarnan
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
 

Viewers also liked (20)

3rd Workshop onSocial Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop onSocial Information Retrieval for Technology-Enhanced Learnin...
Hendrik Drachsler
 
Microsite – Macro Idea
Microsite – Macro IdeaMicrosite – Macro Idea
Microsite – Macro Idea
Maria Podolyak
 
Daily Lecture And Discussions
Daily Lecture And DiscussionsDaily Lecture And Discussions
Daily Lecture And Discussions
bsutton
 
Que no sera ni dia ni noche
Que no sera ni dia ni nocheQue no sera ni dia ni noche
Que no sera ni dia ni noche
Paulo Arieu
 
'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecento'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecento
stefanogambari
 
Тренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонкеТренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонке
Mikhail Grafsky
 
Our school in winter
Our school in winterOur school in winter
Our school in winter
Gavranica
 
Marketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobileMarketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobile
Amit Ambastha
 
Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010
Suthep Sangvirotjanaphat
 
Writing presentation
Writing presentationWriting presentation
Writing presentation
Jennifer Orr
 
Collecting and utilizing assessment information
Collecting and utilizing assessment informationCollecting and utilizing assessment information
Collecting and utilizing assessment information
Jennifer Orr
 
D2.2.1 Evaluation Framework
D2.2.1 Evaluation FrameworkD2.2.1 Evaluation Framework
D2.2.1 Evaluation Framework
Hendrik Drachsler
 
Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5
Terri Weiss
 
Devops down-under
Devops down-underDevops down-under
Devops down-under
Robert Postill
 
Kieeds.com
Kieeds.comKieeds.com
Kieeds.com
Iman Cinderamata
 
Little Ones Learning Math Using Technology
Little Ones Learning Math Using TechnologyLittle Ones Learning Math Using Technology
Little Ones Learning Math Using Technology
Jennifer Orr
 
Examenopleiding energieconsulent mfl
Examenopleiding energieconsulent mflExamenopleiding energieconsulent mfl
Examenopleiding energieconsulent mfl
wweijmans
 
A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe  A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe
Hendrik Drachsler
 
Origen, filosofía
Origen, filosofíaOrigen, filosofía
Origen, filosofía
Leandro Villalobos
 
Integracija poslovnega sistema
Integracija poslovnega sistemaIntegracija poslovnega sistema
Integracija poslovnega sistema
Danilo Tic
 
3rd Workshop onSocial Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...3rd Workshop onSocial  Information Retrieval for Technology-Enhanced Learnin...
3rd Workshop onSocial Information Retrieval for Technology-Enhanced Learnin...
Hendrik Drachsler
 
Microsite – Macro Idea
Microsite – Macro IdeaMicrosite – Macro Idea
Microsite – Macro Idea
Maria Podolyak
 
Daily Lecture And Discussions
Daily Lecture And DiscussionsDaily Lecture And Discussions
Daily Lecture And Discussions
bsutton
 
Que no sera ni dia ni noche
Que no sera ni dia ni nocheQue no sera ni dia ni noche
Que no sera ni dia ni noche
Paulo Arieu
 
'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecento'Fotografia privata' su Web: microstorie del Novecento
'Fotografia privata' su Web: microstorie del Novecento
stefanogambari
 
Тренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонкеТренинг продаж: проход секретаря при холодном звонке
Тренинг продаж: проход секретаря при холодном звонке
Mikhail Grafsky
 
Our school in winter
Our school in winterOur school in winter
Our school in winter
Gavranica
 
Marketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobileMarketing strategies to increase the ROI on mobile
Marketing strategies to increase the ROI on mobile
Amit Ambastha
 
Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010Improve your Web Development using Visual Studio 2010
Improve your Web Development using Visual Studio 2010
Suthep Sangvirotjanaphat
 
Writing presentation
Writing presentationWriting presentation
Writing presentation
Jennifer Orr
 
Collecting and utilizing assessment information
Collecting and utilizing assessment informationCollecting and utilizing assessment information
Collecting and utilizing assessment information
Jennifer Orr
 
Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5Lyddie: Unit3 lesson5
Lyddie: Unit3 lesson5
Terri Weiss
 
Little Ones Learning Math Using Technology
Little Ones Learning Math Using TechnologyLittle Ones Learning Math Using Technology
Little Ones Learning Math Using Technology
Jennifer Orr
 
Examenopleiding energieconsulent mfl
Examenopleiding energieconsulent mflExamenopleiding energieconsulent mfl
Examenopleiding energieconsulent mfl
wweijmans
 
A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe  A ToolBox for Handover practices in Europe
A ToolBox for Handover practices in Europe
Hendrik Drachsler
 
Integracija poslovnega sistema
Integracija poslovnega sistemaIntegracija poslovnega sistema
Integracija poslovnega sistema
Danilo Tic
 

Similar to Using the Power to Prove (17)

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
webhostingguy
 
Software Testing
Software TestingSoftware Testing
Software Testing
Lambert Lum
 
Getting testy with Perl
Getting testy with PerlGetting testy with Perl
Getting testy with Perl
Workhorse Computing
 
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Alex Balhatchet
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnit
Edorian
 
Power Shell For Testers
Power Shell For TestersPower Shell For Testers
Power Shell For Testers
Mca140 software solutions
 
Why Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :PWhy Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :P
Luciano Rocha
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
Dave Cross
 
How to write PHPT tests
How to write PHPT testsHow to write PHPT tests
How to write PHPT tests
Scott MacVicar
 
Testing Code and Assuring Quality
Testing Code and Assuring QualityTesting Code and Assuring Quality
Testing Code and Assuring Quality
Kent Cowgill
 
New and improved: Coming changes to the unittest module
 	 New and improved: Coming changes to the unittest module 	 New and improved: Coming changes to the unittest module
New and improved: Coming changes to the unittest module
PyCon Italia
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
Edorian
 
Getting Testy With Perl6
Getting Testy With Perl6Getting Testy With Perl6
Getting Testy With Perl6
Workhorse Computing
 
Test tutorial
Test tutorialTest tutorial
Test tutorial
msksaba
 
Unit Testing using PHPUnit
Unit Testing using  PHPUnitUnit Testing using  PHPUnit
Unit Testing using PHPUnit
varuntaliyan
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
Jesse Vincent
 
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.
Workhorse Computing
 
Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
webhostingguy
 
Software Testing
Software TestingSoftware Testing
Software Testing
Lambert Lum
 
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Continuous testing and deployment in Perl (London.pm Technical Meeting Octobe...
Alex Balhatchet
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnit
Edorian
 
Why Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :PWhy Perl, when you can use bash+awk+sed? :P
Why Perl, when you can use bash+awk+sed? :P
Luciano Rocha
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
Dave Cross
 
How to write PHPT tests
How to write PHPT testsHow to write PHPT tests
How to write PHPT tests
Scott MacVicar
 
Testing Code and Assuring Quality
Testing Code and Assuring QualityTesting Code and Assuring Quality
Testing Code and Assuring Quality
Kent Cowgill
 
New and improved: Coming changes to the unittest module
 	 New and improved: Coming changes to the unittest module 	 New and improved: Coming changes to the unittest module
New and improved: Coming changes to the unittest module
PyCon Italia
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
Edorian
 
Test tutorial
Test tutorialTest tutorial
Test tutorial
msksaba
 
Unit Testing using PHPUnit
Unit Testing using  PHPUnitUnit Testing using  PHPUnit
Unit Testing using PHPUnit
varuntaliyan
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
Jesse Vincent
 
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.
Workhorse Computing
 

More from Kazuho Oku (20)

HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないとき
Kazuho Oku
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7
Kazuho Oku
 
HTTP/2の課題と将来
HTTP/2の課題と将来HTTP/2の課題と将来
HTTP/2の課題と将来
Kazuho Oku
 
TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話
Kazuho Oku
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and Beyond
Kazuho Oku
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using ruby
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 server
Kazuho Oku
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95
Kazuho Oku
 
HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向
Kazuho Oku
 
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
Kazuho Oku
 
Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5
Kazuho Oku
 
HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計
Kazuho Oku
 
H2O - making the Web faster
H2O - making the Web fasterH2O - making the Web faster
H2O - making the Web faster
Kazuho Oku
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP better
Kazuho Oku
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
Kazuho Oku
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons Learned
Kazuho Oku
 
JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法
Kazuho Oku
 
JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013
Kazuho Oku
 
HTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないときHTTP/2で 速くなるとき ならないとき
HTTP/2で 速くなるとき ならないとき
Kazuho Oku
 
QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7QUIC標準化動向 〜2017/7
QUIC標準化動向 〜2017/7
Kazuho Oku
 
HTTP/2の課題と将来
HTTP/2の課題と将来HTTP/2の課題と将来
HTTP/2の課題と将来
Kazuho Oku
 
TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話TLS 1.3 と 0-RTT のこわ〜い話
TLS 1.3 と 0-RTT のこわ〜い話
Kazuho Oku
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and Beyond
Kazuho Oku
 
Recent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using rubyRecent Advances in HTTP, controlling them using ruby
Recent Advances in HTTP, controlling them using ruby
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
Developing the fastest HTTP/2 server
Developing the fastest HTTP/2 serverDeveloping the fastest HTTP/2 server
Developing the fastest HTTP/2 server
Kazuho Oku
 
TLS & LURK @ IETF 95
TLS & LURK @ IETF 95TLS & LURK @ IETF 95
TLS & LURK @ IETF 95
Kazuho Oku
 
HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向HTTPとサーバ技術の最新動向
HTTPとサーバ技術の最新動向
Kazuho Oku
 
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
ウェブを速くするためにDeNAがやっていること - HTTP/2と、さらにその先
Kazuho Oku
 
Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5Cache aware-server-push in H2O version 1.5
Cache aware-server-push in H2O version 1.5
Kazuho Oku
 
HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計HTTP/2時代のウェブサイト設計
HTTP/2時代のウェブサイト設計
Kazuho Oku
 
H2O - making the Web faster
H2O - making the Web fasterH2O - making the Web faster
H2O - making the Web faster
Kazuho Oku
 
H2O - making HTTP better
H2O - making HTTP betterH2O - making HTTP better
H2O - making HTTP better
Kazuho Oku
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
Kazuho Oku
 
JSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons LearnedJSON SQL Injection and the Lessons Learned
JSON SQL Injection and the Lessons Learned
Kazuho Oku
 
JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法JSX 速さの秘密 - 高速なJavaScriptを書く方法
JSX 速さの秘密 - 高速なJavaScriptを書く方法
Kazuho Oku
 
JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013JSX の現在と未来 - Oct 26 2013
JSX の現在と未来 - Oct 26 2013
Kazuho Oku
 

Recently uploaded (20)

Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Chris Bingham
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AIAI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docxAutomating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Ihor Hamal
 
Agentic AI, A Business Overview - May 2025
Agentic AI, A Business Overview - May 2025Agentic AI, A Business Overview - May 2025
Agentic AI, A Business Overview - May 2025
Peter Morgan
 
CloudStack + KVM: Your Local Cloud Lab
CloudStack + KVM:   Your Local Cloud LabCloudStack + KVM:   Your Local Cloud Lab
CloudStack + KVM: Your Local Cloud Lab
ShapeBlue
 
How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)
Safe Software
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
A simple Introduction to Algorithmic Fairness
A simple Introduction to Algorithmic FairnessA simple Introduction to Algorithmic Fairness
A simple Introduction to Algorithmic Fairness
Paolo Missier
 
Wondershare Filmora 14.3.2 Crack + License Key Free for Windows PC
Wondershare Filmora 14.3.2 Crack + License Key Free for Windows PCWondershare Filmora 14.3.2 Crack + License Key Free for Windows PC
Wondershare Filmora 14.3.2 Crack + License Key Free for Windows PC
Mudasir
 
AI Unboxed - How to Approach AI for Maximum Return
AI Unboxed - How to Approach AI for Maximum ReturnAI Unboxed - How to Approach AI for Maximum Return
AI Unboxed - How to Approach AI for Maximum Return
Merelda
 
Stretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacentersStretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacenters
ShapeBlue
 
Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...
Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...
Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...
Precisely
 
SQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptxSQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptx
Scott Keck-Warren
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCPMCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
Sambhav Kothari
 
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc
 
Breaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP DevelopersBreaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP Developers
pmeth1
 
Four Principles for Physically Interpretable World Models
Four Principles for Physically Interpretable World ModelsFour Principles for Physically Interpretable World Models
Four Principles for Physically Interpretable World Models
Ivan Ruchkin
 
Introducing High Availability: Business Continuity for Every NAS User
Introducing High Availability: Business Continuity for Every NAS UserIntroducing High Availability: Business Continuity for Every NAS User
Introducing High Availability: Business Continuity for Every NAS User
QNAP Marketing
 
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Managing Geospatial Open Data Serverlessly [AWS Community Day CH 2025]
Chris Bingham
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AIAI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docxAutomating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Automating Call Centers with AI Agents_ Achieving Sub-700ms Latency.docx
Ihor Hamal
 
Agentic AI, A Business Overview - May 2025
Agentic AI, A Business Overview - May 2025Agentic AI, A Business Overview - May 2025
Agentic AI, A Business Overview - May 2025
Peter Morgan
 
CloudStack + KVM: Your Local Cloud Lab
CloudStack + KVM:   Your Local Cloud LabCloudStack + KVM:   Your Local Cloud Lab
CloudStack + KVM: Your Local Cloud Lab
ShapeBlue
 
How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)How to Integrate FME with Databricks (and Why You’ll Want To)
How to Integrate FME with Databricks (and Why You’ll Want To)
Safe Software
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
A simple Introduction to Algorithmic Fairness
A simple Introduction to Algorithmic FairnessA simple Introduction to Algorithmic Fairness
A simple Introduction to Algorithmic Fairness
Paolo Missier
 
Wondershare Filmora 14.3.2 Crack + License Key Free for Windows PC
Wondershare Filmora 14.3.2 Crack + License Key Free for Windows PCWondershare Filmora 14.3.2 Crack + License Key Free for Windows PC
Wondershare Filmora 14.3.2 Crack + License Key Free for Windows PC
Mudasir
 
AI Unboxed - How to Approach AI for Maximum Return
AI Unboxed - How to Approach AI for Maximum ReturnAI Unboxed - How to Approach AI for Maximum Return
AI Unboxed - How to Approach AI for Maximum Return
Merelda
 
Stretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacentersStretching CloudStack over multiple datacenters
Stretching CloudStack over multiple datacenters
ShapeBlue
 
Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...
Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...
Outdated Tech, Invisible Expenses – How Data Silos Undermine Operational Effi...
Precisely
 
SQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptxSQL Database Design For Developers at PhpTek 2025.pptx
SQL Database Design For Developers at PhpTek 2025.pptx
Scott Keck-Warren
 
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
Multi-Agent AI Systems: Architectures & Communication (MCP and A2A)
HusseinMalikMammadli
 
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCPMCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
MCP Dev Summit - Pragmatic Scaling of Enterprise GenAI with MCP
Sambhav Kothari
 
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc Webinar: Cross-Border Data Transfers in 2025
TrustArc
 
Breaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP DevelopersBreaking it Down: Microservices Architecture for PHP Developers
Breaking it Down: Microservices Architecture for PHP Developers
pmeth1
 
Four Principles for Physically Interpretable World Models
Four Principles for Physically Interpretable World ModelsFour Principles for Physically Interpretable World Models
Four Principles for Physically Interpretable World Models
Ivan Ruchkin
 
Introducing High Availability: Business Continuity for Every NAS User
Introducing High Availability: Business Continuity for Every NAS UserIntroducing High Availability: Business Continuity for Every NAS User
Introducing High Availability: Business Continuity for Every NAS User
QNAP Marketing
 

Using the Power to Prove

  • 1. Using the Power to Prove DeNA Co., Ltd. Kazuho Oku
  • 2. Do you know prove? Have you ever used it? Sep 20 2013 Using the Power to Prove 2
  • 3. Prove is… command-line interface of Test::Harness Test::Harness is the test runner Sep 20 2013 Using the Power to Prove 3 $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/00-base.t t/01-new.t t/02-use.t t/03-use-error.t t/04-use-defaults.t t/00-base.t .......... ok t/01-new.t ........... ok … $ prove t/00-base.t .......... ok t/01-new.t ........... ok …
  • 4. Test Anything Protocol (TAP) Test::Harness runs the scripts and aggregates the results test scripts return the data using TAP Sep 20 2013 Using the Power to Prove 4 $ perl t/00-base.t 1..14 ok 1 - use Class::Accessor::Lite; ok 2 - call mk_accessors ok 3 ok 4 …
  • 5. History of Test::Harness and TAP TAP exists since Perl 1 Test::Harness is part of Perl core and is part of Linux Standards Base bindings exist for many programming languages  http://en.wikipedia.org/wiki/Test_Anything_Protocol Sep 20 2013 Using the Power to Prove 5
  • 6. Prove has many powerful options Sep 20 2013 Using the Power to Prove 6 $ prove -j 8 --state hot,fast,save - runs 8 tests in parallel - run the tests that failed first - run the fast tests first, and then others that takes time - update the test stats
  • 7. Can we write tests in other programming languages, and aggregate the results using prove? Sep 20 2013 Using the Power to Prove 7
  • 8. Prove runs scripts written in any language but how? Sep 20 2013 Using the Power to Prove 8 $ cat bf.t #! /usr/local/bin/yabi -[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[-- >+++<]>+.>++++++++++. $ yabi bf.t 1..1 ok 1 $ prove bf.t bf.t .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) Result: PASS
  • 9. PerlProve runs scripts written in any language Perl understands the shebang Sep 20 2013 Using the Power to Prove 9 $ cat bf.t #! /usr/local/bin/yabi -[----->+<]>--.---..+++.>++++++++++.-[------->+<]>.----.-[++>---<]>+.[-- >+++<]>+.>++++++++++. $ perl bf.t 1..1 ok 1
  • 10. PerlProve runs scripts written in any language but not binary executables… Sep 20 2013 Using the Power to Prove 10 $ cat bin.c #include <stdio.h> int main(int argc, char** argv) { printf("1..1n"); printf("ok 1n"); return 0; } $ perl bin Unrecognized character xCF; marked by <-- HERE after <-- HERE near column 1 at bin line 1.
  • 11. prove --exec '' solves the problem why? Sep 20 2013 Using the Power to Prove 11 $ prove –h … -e, --exec Interpreter to run the tests ('' for compiled tests.) … $ prove --exec '' bin bin .. open3: exec of bin failed at /System/Library/Perl/5.12/TAP/Parser/Iterator/Process.pm line 163. bin .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run
  • 12. prove --exec '' solves the problem specify the paths, or add . to $PATH but would test scripts stop running on Windows Sep 20 2013 Using the Power to Prove 12 $ prove --exec '' t/bin t/bin .. ok All tests successful. Files=1, Tests=1, 1 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS $ PATH=".:$PATH" prove --exec '' bin bin .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 13. Extensions can be other than .t use: --ext "" Sep 20 2013 Using the Power to Prove 13 $ prove --ext '' --exec '' . ./test.bf ... ok ./test.out .. ok ./test.sh ... ok All tests successful. Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 14. .proverc Save the prove options for the project Sep 20 2013 Using the Power to Prove 14 $ cat .proverc --ext '' --exec '' $ prove . ./test.bf ... ok ./test.out .. ok ./test.sh ... ok All tests successful. Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 15. Test scripts are searched by default from t/ Sep 20 2013 Using the Power to Prove 15 $ cat .proverc --ext '' --exec '' $ prove t/test.bf ... ok t/test.out .. ok t/test.sh ... ok All tests successful. Files=3, Tests=3, 0 wallclock secs ( 0.02 usr + 0.01 sys = 0.03 CPU) Result: PASS
  • 16. Prove is powerful! Can we run programs other than test scripts? Sep 20 2013 Using the Power to Prove 16
  • 17. Running things other than test scripts cron tasks service monitoring Sep 20 2013 Using the Power to Prove 17 $ ls t http.t memcached.t mysql.t ping.t smtp.t $ prove t/http.t ....... ok t/memcached.t .. ok t/mysql.t ...... ok t/ping.t ....... ok t/smtp.t ....... ok All tests successful.
  • 18. Conclusion Sep 20 2013 Using the Power to Prove 18
  • 19. Conclusion Prove is a proven task runner can run any kind of tasks and generate a report preinstalled on most systems uses TAP - an established protocol Sep 20 2013 Using the Power to Prove 19