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

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
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
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
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
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
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
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
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
 

Recently uploaded (20)

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
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...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
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
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
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
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
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
 

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