SlideShare a Scribd company logo
PyCon JP 2011 LT




        Oktest
a new style testing library for Python


                 makoto kuwata
          http://www.kuwata-lab.com/


        copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                              1
unittest
           (python)


copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                        2
Too long! Hard to read & write!
                                     !                                  !




                copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                            3
Test::More
                  (perl)


copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                        4
Easy to read & write! Kool!




      copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                              5
Oktest
           (python)


copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                        6
So Kooooooool!



                  copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                          7
Kool Python!                                         Not kool. It's Java.
     Python                                                      Java




                            copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                                                   8
ok() returns AssertionObject
                                  ok()        AssertionObject

       	    	 
                                                              	 

       	    	 
                     	                 	                   	             	 
	 	 
                                       	  	          	  	  	 
                                      Overrides '==' operator
                                       '=='




                 copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                              9
Shows unified diff when '==' is failed.
	                                 '=='                    uniifed diff             (2.6   !)




                           copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                                               10
Test Code                                 When Failed
  	          	 	 	 	 	 	 	 	 	 
        	  	  	  	 	 	 	 	 	 (no message)

  	       	 	 	 	 	 	 	 	 	 	 	 
       	  	  	 	 	 	 	 	 	 	 (no message)

  	          	 	 	 	 	 	 	 	 	 
  	     	  	  	 	 	 	 	 	 	 	  	  	  	  	 

                  Shows actual & expected values


            copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                    11
unittest
           (python)


copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                        12
You must describe in [a-zA-Z0-9_]+
                                (         )                             _
         	 

	 	      	 
	 	 	 	          	  	  	                         	        	 
	 	 	 	                                                      	 

                         Duplicated. Not DRY!
                                                          DRY




                copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                            13
Oktest
           (python)


copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                        14
Free text instead of method name!
                                                                        !




                copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                            15
Any symbol or CJK available!



                copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                        16
internal

                  	 	  	             	  	  	                           	    	 
                    	  	                           	 
	 	 	 	 	 	 	 	 	 	 	 	 	            	  	  	                           	    	 
                                                   	  	 
                 Set free text as method name,
               keeping with unittest compatibility
               unittest



               copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                                 17
Fixture Injection
            in Oktest


   copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                           18
All test methods call the same 'setUp()'. Coarse-grained.
 Want to call different initializer for each test method.
                                 setUp()


         	 

	 	      	 
	 	 	 	                      	  	 
	 	 	 	                  	 	 	  	 

	 	      	 
	 	 	 	  	                                              	       	 

	 	      	 
	 	 	 	  	                                         	       	 
              copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                      19
Calls provide_member() only
	 	      	                                         	 
	 	 	 	  	                                 	       	 
	 	      	                                    	 
	 	 	 	  	                            	       	 
                                                        Calls provide_team() only

              copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                                    20
- 'A' depends on 'B' and 'C'
                                     - 'C' depends on 'D'
                                       A B C                      C     D

	 	      	                                    	                   	 
	 	      	                              	 	 	 	                   	 
	 	      	                                	 	 	                   	 
	 	      	                              	 	 	 	                   	 

	 	       	                                                    	 
	 	 	 	 	 	    	        	       	               	            	              	 
                    Dependencies are resolved automatically
                                           Oktest


                copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                                 21
Equivarent to setUp()
                                        provide_xxx()       setUp()

	 	       	 
	 	 	 	                  	  	 
	 	 	 	        	                                     	            	     	 
	 	 	 	 	 	 
	 	 	 	             	 
                                  Equivarent to tearDown()
                                     release_xxx()        tearDown()

	 	       	                                                	 
	 	 	 	  	 
	 	 	 	 	 	 

                copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                             22
Interested?


copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                        23
Oktest Python                                       Google Search




     copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                    24
one more thing...


  copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                          25
Oktest for Node.js
      	             	    	 
	 	 	 	           	 	    	 
	 	 	 	         	 	 	    	 
	 	 	 	     	 	 	 	 	    	 

                                    	                      	 
	 	                                                	                    	 
	 	 	 	                                                    	                 	 
	 	 	 	 	 	     	 
	 	 	 	 	 	     	             	          	 
	 	 	 	 
	 	 


    	                                 	       	 
	 	 

                     copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                                                  26
thank you


copyright(c) 2011 kuwata-lab.com all rights reserved.
                                                        27

More Related Content

More from kwatch

How to make the fastest Router in Python
How to make the fastest Router in PythonHow to make the fastest Router in Python
How to make the fastest Router in Python
kwatch
 
Migr8.rb チュートリアル
Migr8.rb チュートリアルMigr8.rb チュートリアル
Migr8.rb チュートリアル
kwatch
 
なんでもID
なんでもIDなんでもID
なんでもID
kwatch
 
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
kwatch
 
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
kwatch
 
O/Rマッパーによるトラブルを未然に防ぐ
O/Rマッパーによるトラブルを未然に防ぐO/Rマッパーによるトラブルを未然に防ぐ
O/Rマッパーによるトラブルを未然に防ぐ
kwatch
 
正規表現リテラルは本当に必要なのか?
正規表現リテラルは本当に必要なのか?正規表現リテラルは本当に必要なのか?
正規表現リテラルは本当に必要なのか?
kwatch
 
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
kwatch
 
DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!
kwatch
 
PHPとJavaScriptにおけるオブジェクト指向を比較する
PHPとJavaScriptにおけるオブジェクト指向を比較するPHPとJavaScriptにおけるオブジェクト指向を比較する
PHPとJavaScriptにおけるオブジェクト指向を比較する
kwatch
 
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
kwatch
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Python
kwatch
 
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
kwatch
 
PHP5.5新機能「ジェネレータ」初心者入門
PHP5.5新機能「ジェネレータ」初心者入門PHP5.5新機能「ジェネレータ」初心者入門
PHP5.5新機能「ジェネレータ」初心者入門
kwatch
 
Pretty Good Branch Strategy for Git/Mercurial
Pretty Good Branch Strategy for Git/MercurialPretty Good Branch Strategy for Git/Mercurial
Pretty Good Branch Strategy for Git/Mercurial
kwatch
 
文字列結合のベンチマークをいろんな処理系でやってみた
文字列結合のベンチマークをいろんな処理系でやってみた文字列結合のベンチマークをいろんな処理系でやってみた
文字列結合のベンチマークをいろんな処理系でやってみた
kwatch
 
I have something to say about the buzz word "From Java to Ruby"
I have something to say about the buzz word "From Java to Ruby"I have something to say about the buzz word "From Java to Ruby"
I have something to say about the buzz word "From Java to Ruby"kwatch
 
Cより速いRubyプログラム
Cより速いRubyプログラムCより速いRubyプログラム
Cより速いRubyプログラム
kwatch
 
Javaより速いLL用テンプレートエンジン
Javaより速いLL用テンプレートエンジンJavaより速いLL用テンプレートエンジン
Javaより速いLL用テンプレートエンジン
kwatch
 
Underlaying Technology of Modern O/R Mapper
Underlaying Technology of Modern O/R MapperUnderlaying Technology of Modern O/R Mapper
Underlaying Technology of Modern O/R Mapper
kwatch
 

More from kwatch (20)

How to make the fastest Router in Python
How to make the fastest Router in PythonHow to make the fastest Router in Python
How to make the fastest Router in Python
 
Migr8.rb チュートリアル
Migr8.rb チュートリアルMigr8.rb チュートリアル
Migr8.rb チュートリアル
 
なんでもID
なんでもIDなんでもID
なんでもID
 
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
 
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
 
O/Rマッパーによるトラブルを未然に防ぐ
O/Rマッパーによるトラブルを未然に防ぐO/Rマッパーによるトラブルを未然に防ぐ
O/Rマッパーによるトラブルを未然に防ぐ
 
正規表現リテラルは本当に必要なのか?
正規表現リテラルは本当に必要なのか?正規表現リテラルは本当に必要なのか?
正規表現リテラルは本当に必要なのか?
 
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
 
DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!
 
PHPとJavaScriptにおけるオブジェクト指向を比較する
PHPとJavaScriptにおけるオブジェクト指向を比較するPHPとJavaScriptにおけるオブジェクト指向を比較する
PHPとJavaScriptにおけるオブジェクト指向を比較する
 
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Python
 
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
 
PHP5.5新機能「ジェネレータ」初心者入門
PHP5.5新機能「ジェネレータ」初心者入門PHP5.5新機能「ジェネレータ」初心者入門
PHP5.5新機能「ジェネレータ」初心者入門
 
Pretty Good Branch Strategy for Git/Mercurial
Pretty Good Branch Strategy for Git/MercurialPretty Good Branch Strategy for Git/Mercurial
Pretty Good Branch Strategy for Git/Mercurial
 
文字列結合のベンチマークをいろんな処理系でやってみた
文字列結合のベンチマークをいろんな処理系でやってみた文字列結合のベンチマークをいろんな処理系でやってみた
文字列結合のベンチマークをいろんな処理系でやってみた
 
I have something to say about the buzz word "From Java to Ruby"
I have something to say about the buzz word "From Java to Ruby"I have something to say about the buzz word "From Java to Ruby"
I have something to say about the buzz word "From Java to Ruby"
 
Cより速いRubyプログラム
Cより速いRubyプログラムCより速いRubyプログラム
Cより速いRubyプログラム
 
Javaより速いLL用テンプレートエンジン
Javaより速いLL用テンプレートエンジンJavaより速いLL用テンプレートエンジン
Javaより速いLL用テンプレートエンジン
 
Underlaying Technology of Modern O/R Mapper
Underlaying Technology of Modern O/R MapperUnderlaying Technology of Modern O/R Mapper
Underlaying Technology of Modern O/R Mapper
 

Recently uploaded

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

Oktest - a new style testing library for Python -

  • 1. PyCon JP 2011 LT Oktest a new style testing library for Python makoto kuwata http://www.kuwata-lab.com/ copyright(c) 2011 kuwata-lab.com all rights reserved. 1
  • 2. unittest (python) copyright(c) 2011 kuwata-lab.com all rights reserved. 2
  • 3. Too long! Hard to read & write! ! ! copyright(c) 2011 kuwata-lab.com all rights reserved. 3
  • 4. Test::More (perl) copyright(c) 2011 kuwata-lab.com all rights reserved. 4
  • 5. Easy to read & write! Kool! copyright(c) 2011 kuwata-lab.com all rights reserved. 5
  • 6. Oktest (python) copyright(c) 2011 kuwata-lab.com all rights reserved. 6
  • 7. So Kooooooool! copyright(c) 2011 kuwata-lab.com all rights reserved. 7
  • 8. Kool Python! Not kool. It's Java. Python Java copyright(c) 2011 kuwata-lab.com all rights reserved. 8
  • 9. ok() returns AssertionObject ok() AssertionObject Overrides '==' operator '==' copyright(c) 2011 kuwata-lab.com all rights reserved. 9
  • 10. Shows unified diff when '==' is failed. '==' uniifed diff (2.6 !) copyright(c) 2011 kuwata-lab.com all rights reserved. 10
  • 11. Test Code When Failed (no message) (no message) Shows actual & expected values copyright(c) 2011 kuwata-lab.com all rights reserved. 11
  • 12. unittest (python) copyright(c) 2011 kuwata-lab.com all rights reserved. 12
  • 13. You must describe in [a-zA-Z0-9_]+ ( ) _ Duplicated. Not DRY! DRY copyright(c) 2011 kuwata-lab.com all rights reserved. 13
  • 14. Oktest (python) copyright(c) 2011 kuwata-lab.com all rights reserved. 14
  • 15. Free text instead of method name! ! copyright(c) 2011 kuwata-lab.com all rights reserved. 15
  • 16. Any symbol or CJK available! copyright(c) 2011 kuwata-lab.com all rights reserved. 16
  • 17. internal Set free text as method name, keeping with unittest compatibility unittest copyright(c) 2011 kuwata-lab.com all rights reserved. 17
  • 18. Fixture Injection in Oktest copyright(c) 2011 kuwata-lab.com all rights reserved. 18
  • 19. All test methods call the same 'setUp()'. Coarse-grained. Want to call different initializer for each test method. setUp() copyright(c) 2011 kuwata-lab.com all rights reserved. 19
  • 20. Calls provide_member() only Calls provide_team() only copyright(c) 2011 kuwata-lab.com all rights reserved. 20
  • 21. - 'A' depends on 'B' and 'C' - 'C' depends on 'D' A B C C D Dependencies are resolved automatically Oktest copyright(c) 2011 kuwata-lab.com all rights reserved. 21
  • 22. Equivarent to setUp() provide_xxx() setUp() Equivarent to tearDown() release_xxx() tearDown() copyright(c) 2011 kuwata-lab.com all rights reserved. 22
  • 24. Oktest Python Google Search copyright(c) 2011 kuwata-lab.com all rights reserved. 24
  • 25. one more thing... copyright(c) 2011 kuwata-lab.com all rights reserved. 25
  • 26. Oktest for Node.js copyright(c) 2011 kuwata-lab.com all rights reserved. 26
  • 27. thank you copyright(c) 2011 kuwata-lab.com all rights reserved. 27