SlideShare une entreprise Scribd logo
1  sur  10
Specs  _ what it is ,[object Object],See the  associated code  for a working example - HelloWorldSpec.scala import  org.specs._ object  HelloWorldSpec  extends   Specification  { "'hello world' has 11 characters"   in  {  "hello world" .size must_== 11 } "'hello world' matches 'h.* w.*'"   in  {  "hello world"  must beMatching( "h.* w.*" ) } } [info] Running specs tests... [info]  [info] Testing scalamelb.specs.HelloWorldSpec ... [info]  specifies  [info]  + 'hello world' has 11 characters [info]  + 'hello world' matches 'h.* w.*' [info]  [info] All tests PASSED.
Specs  _ structure ,[object Object]
The Specs structure:  Specify  system  (with context)   and  examples ,[object Object],NigerianPrinceSpec.scala "A Nigerian prince with access to an email account"   should  { "contact you in relation to his most generous offer"   in  { // exercise the logic and make assertions ... } }
Specs  _ structure ,[object Object]
Systems can't
Specifications can, sort of SnowflakeSpec.scala "A snowflake"   should  {  [info]  A snowflake should "be cold"   in  {  [info]  + be cold "and icy"   in  { … }  [info]  + and icy "and unique"   in  { … }  [info]  + and unique "A snowflake"   should  { "in the desert"   should  { "melt"   in  { … } object  SnowflakeSpec  extends   Specification  { "A snowflake"   isSpecifiedBy   SnowflakeInTheDesertSpec ,  SnowflakeInTheFrideSpec , SnowflakeOnTheTongueSpec }
Specs  _ matchers ,[object Object]
100+ are documented at time of writing  (v1.4.4)
Can write custom matchers. Can be combinatorial. PhoneBillSpec.scala "A phone bill"   should  { "keep a count of calls made"   in  { bill.numberOfCallsMade  must_==  3 "A phone bill"   should  { "include a call to my mother"   in  { bill.callsMade  must contain ("9898 4477") "A phone bill"   should  { "export calls to file"   in  { bill.exportFile  must (beReadable and not(beHidden))
Specs  _ scalacheck ,[object Object]

Contenu connexe

Tendances

Zen: Building Maintainable Catalyst Applications
Zen: Building Maintainable Catalyst ApplicationsZen: Building Maintainable Catalyst Applications
Zen: Building Maintainable Catalyst ApplicationsJay Shirley
 
Python Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & GeneratorsPython Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & GeneratorsP3 InfoTech Solutions Pvt. Ltd.
 
Desenvolvendo em php cli
Desenvolvendo em php cliDesenvolvendo em php cli
Desenvolvendo em php cliThiago Paes
 
Four Ways to add Features to Ext JS
Four Ways to add Features to Ext JSFour Ways to add Features to Ext JS
Four Ways to add Features to Ext JSShea Frederick
 
Bee Smalltalk RunTime: anchor's aweigh
Bee Smalltalk RunTime: anchor's aweighBee Smalltalk RunTime: anchor's aweigh
Bee Smalltalk RunTime: anchor's aweighESUG
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentExploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentAjin Abraham
 
Symfony 4 Workshop - Limenius
Symfony 4 Workshop - LimeniusSymfony 4 Workshop - Limenius
Symfony 4 Workshop - LimeniusIgnacio Martín
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
 
Ansible Callback Plugins
Ansible Callback PluginsAnsible Callback Plugins
Ansible Callback Pluginsjtyr
 
Testing Ruby with Rspec (a beginner's guide)
Testing Ruby with Rspec (a beginner's guide)Testing Ruby with Rspec (a beginner's guide)
Testing Ruby with Rspec (a beginner's guide)Vysakh Sreenivasan
 
Java Boilerplate Busters
Java Boilerplate BustersJava Boilerplate Busters
Java Boilerplate BustersHamletDRC
 
AOP in Python API design
AOP in Python API designAOP in Python API design
AOP in Python API designmeij200
 

Tendances (19)

Elegant APIs
Elegant APIsElegant APIs
Elegant APIs
 
Zen: Building Maintainable Catalyst Applications
Zen: Building Maintainable Catalyst ApplicationsZen: Building Maintainable Catalyst Applications
Zen: Building Maintainable Catalyst Applications
 
C to perl binding
C to perl bindingC to perl binding
C to perl binding
 
Python Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging modulePython Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging module
 
Python Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & GeneratorsPython Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & Generators
 
Desenvolvendo em php cli
Desenvolvendo em php cliDesenvolvendo em php cli
Desenvolvendo em php cli
 
Four Ways to add Features to Ext JS
Four Ways to add Features to Ext JSFour Ways to add Features to Ext JS
Four Ways to add Features to Ext JS
 
Bee Smalltalk RunTime: anchor's aweigh
Bee Smalltalk RunTime: anchor's aweighBee Smalltalk RunTime: anchor's aweigh
Bee Smalltalk RunTime: anchor's aweigh
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit DevelopmentExploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
 
Test::Base
Test::BaseTest::Base
Test::Base
 
Symfony 4 Workshop - Limenius
Symfony 4 Workshop - LimeniusSymfony 4 Workshop - Limenius
Symfony 4 Workshop - Limenius
 
Oop object oriented programing topics
Oop object oriented programing topicsOop object oriented programing topics
Oop object oriented programing topics
 
Sencha Touch Intro
Sencha Touch IntroSencha Touch Intro
Sencha Touch Intro
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
Ansible Callback Plugins
Ansible Callback PluginsAnsible Callback Plugins
Ansible Callback Plugins
 
Testing Ruby with Rspec (a beginner's guide)
Testing Ruby with Rspec (a beginner's guide)Testing Ruby with Rspec (a beginner's guide)
Testing Ruby with Rspec (a beginner's guide)
 
MUST CS101 Lab11
MUST CS101 Lab11 MUST CS101 Lab11
MUST CS101 Lab11
 
Java Boilerplate Busters
Java Boilerplate BustersJava Boilerplate Busters
Java Boilerplate Busters
 
AOP in Python API design
AOP in Python API designAOP in Python API design
AOP in Python API design
 

En vedette

What is Residual solvent and its identification
What is Residual solvent and its identificationWhat is Residual solvent and its identification
What is Residual solvent and its identificationHasan Al Banna
 
Impurities in DS & DP
Impurities in DS & DPImpurities in DS & DP
Impurities in DS & DPKiran Kota
 
Dissolution-method Development-PPT
Dissolution-method Development-PPTDissolution-method Development-PPT
Dissolution-method Development-PPTBhanu Prakash N
 
Out of specification shravan
Out of specification shravanOut of specification shravan
Out of specification shravanshravan dubey
 
Recent advancement in impurity profiling
Recent advancement in impurity profilingRecent advancement in impurity profiling
Recent advancement in impurity profilingPiramal Healthcare
 
Impurities in drug substance (ich q3 a)
Impurities in drug substance (ich q3 a)Impurities in drug substance (ich q3 a)
Impurities in drug substance (ich q3 a)Bhanu Chava
 
ABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crasto
ABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crastoABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crasto
ABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crastoAnthony Melvin Crasto Ph.D
 
Method Development and Method Validation for the estimation of Valganciclovir...
Method Development and Method Validation for the estimation of Valganciclovir...Method Development and Method Validation for the estimation of Valganciclovir...
Method Development and Method Validation for the estimation of Valganciclovir...google
 
Analytical method validation by manoj ingale(best ppts)
Analytical method validation by manoj ingale(best ppts)Analytical method validation by manoj ingale(best ppts)
Analytical method validation by manoj ingale(best ppts)Indus Biotech Pvt.Ltd.
 
analytical method validation
analytical method validationanalytical method validation
analytical method validationDr. Raja Abhilash
 
analytical method validation and validation of hplc
analytical method validation and validation of hplcanalytical method validation and validation of hplc
analytical method validation and validation of hplcvenkatesh thota
 
Analytical method validation
Analytical method validationAnalytical method validation
Analytical method validationGaurav Kr
 

En vedette (20)

What is Residual solvent and its identification
What is Residual solvent and its identificationWhat is Residual solvent and its identification
What is Residual solvent and its identification
 
Impurities in DS & DP
Impurities in DS & DPImpurities in DS & DP
Impurities in DS & DP
 
NDA ANDA IND by Anthony Crasto
NDA ANDA IND by Anthony CrastoNDA ANDA IND by Anthony Crasto
NDA ANDA IND by Anthony Crasto
 
Residual Solvent Limit Calculation
Residual Solvent Limit CalculationResidual Solvent Limit Calculation
Residual Solvent Limit Calculation
 
Handling of Out of Specification Results
Handling of Out of Specification ResultsHandling of Out of Specification Results
Handling of Out of Specification Results
 
Dissolution-method Development-PPT
Dissolution-method Development-PPTDissolution-method Development-PPT
Dissolution-method Development-PPT
 
Out of specification shravan
Out of specification shravanOut of specification shravan
Out of specification shravan
 
Impurities
ImpuritiesImpurities
Impurities
 
Recent advancement in impurity profiling
Recent advancement in impurity profilingRecent advancement in impurity profiling
Recent advancement in impurity profiling
 
Dissolution Method Development & Validation
Dissolution Method Development & ValidationDissolution Method Development & Validation
Dissolution Method Development & Validation
 
NDA & ANDA approval
NDA & ANDA approval NDA & ANDA approval
NDA & ANDA approval
 
Impurities in drug substance (ich q3 a)
Impurities in drug substance (ich q3 a)Impurities in drug substance (ich q3 a)
Impurities in drug substance (ich q3 a)
 
Out of specification (oos)1
Out of specification (oos)1Out of specification (oos)1
Out of specification (oos)1
 
ABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crasto
ABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crastoABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crasto
ABBREVIATED NEW DRUG APPLICATION (ANDA) by Anthony crasto
 
Method Development and Method Validation for the estimation of Valganciclovir...
Method Development and Method Validation for the estimation of Valganciclovir...Method Development and Method Validation for the estimation of Valganciclovir...
Method Development and Method Validation for the estimation of Valganciclovir...
 
Analytical method validation by manoj ingale(best ppts)
Analytical method validation by manoj ingale(best ppts)Analytical method validation by manoj ingale(best ppts)
Analytical method validation by manoj ingale(best ppts)
 
analytical method validation
analytical method validationanalytical method validation
analytical method validation
 
analytical method validation and validation of hplc
analytical method validation and validation of hplcanalytical method validation and validation of hplc
analytical method validation and validation of hplc
 
Analytical method validation
Analytical method validationAnalytical method validation
Analytical method validation
 
ANDA filing
ANDA filingANDA filing
ANDA filing
 

Similaire à Specs Presentation

Scala 3camp 2011
Scala   3camp 2011Scala   3camp 2011
Scala 3camp 2011Scalac
 
JavaScript, Beyond the Curly Braces
JavaScript, Beyond the Curly BracesJavaScript, Beyond the Curly Braces
JavaScript, Beyond the Curly BracesChicago ALT.NET
 
Testing Javascript with Jasmine
Testing Javascript with JasmineTesting Javascript with Jasmine
Testing Javascript with JasmineTim Tyrrell
 
JavaScript Sprachraum
JavaScript SprachraumJavaScript Sprachraum
JavaScript Sprachraumpatricklee
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With PhpJeremy Coates
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web ModuleMorgan Cheng
 
Falcon初印象
Falcon初印象Falcon初印象
Falcon初印象勇浩 赖
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database ConnectivityRanjan Kumar
 
Domain Specific Languages In Scala Duse3
Domain Specific Languages In Scala Duse3Domain Specific Languages In Scala Duse3
Domain Specific Languages In Scala Duse3Peter Maas
 
Python - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave ParkPython - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave Parkpointstechgeeks
 
Maker All - Executive Presentation
Maker All - Executive PresentationMaker All - Executive Presentation
Maker All - Executive PresentationDiogoFalcao
 
Xenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practicesXenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practicesLucas Jellema
 
On Scala Slides - OSDC 2009
On Scala Slides - OSDC 2009On Scala Slides - OSDC 2009
On Scala Slides - OSDC 2009Michael Neale
 

Similaire à Specs Presentation (20)

Scala 3camp 2011
Scala   3camp 2011Scala   3camp 2011
Scala 3camp 2011
 
JavaScript, Beyond the Curly Braces
JavaScript, Beyond the Curly BracesJavaScript, Beyond the Curly Braces
JavaScript, Beyond the Curly Braces
 
Testing Javascript with Jasmine
Testing Javascript with JasmineTesting Javascript with Jasmine
Testing Javascript with Jasmine
 
JavaScript Sprachraum
JavaScript SprachraumJavaScript Sprachraum
JavaScript Sprachraum
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With Php
 
Jsp And Jdbc
Jsp And JdbcJsp And Jdbc
Jsp And Jdbc
 
Build Lightweight Web Module
Build Lightweight Web ModuleBuild Lightweight Web Module
Build Lightweight Web Module
 
Falcon初印象
Falcon初印象Falcon初印象
Falcon初印象
 
JDBC Java Database Connectivity
JDBC Java Database ConnectivityJDBC Java Database Connectivity
JDBC Java Database Connectivity
 
Drools BeJUG 2010
Drools BeJUG 2010Drools BeJUG 2010
Drools BeJUG 2010
 
Domain Specific Languages In Scala Duse3
Domain Specific Languages In Scala Duse3Domain Specific Languages In Scala Duse3
Domain Specific Languages In Scala Duse3
 
C++ programming
C++ programmingC++ programming
C++ programming
 
Python - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave ParkPython - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave Park
 
Maker All - Executive Presentation
Maker All - Executive PresentationMaker All - Executive Presentation
Maker All - Executive Presentation
 
Spring Capitulo 05
Spring Capitulo 05Spring Capitulo 05
Spring Capitulo 05
 
Jquery 1
Jquery 1Jquery 1
Jquery 1
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Xenogenetics
XenogeneticsXenogenetics
Xenogenetics
 
Xenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practicesXenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practices
 
On Scala Slides - OSDC 2009
On Scala Slides - OSDC 2009On Scala Slides - OSDC 2009
On Scala Slides - OSDC 2009
 

Dernier

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

Dernier (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Specs Presentation

  • 1.
  • 2.
  • 3.
  • 4.
  • 6. Specifications can, sort of SnowflakeSpec.scala "A snowflake" should { [info] A snowflake should "be cold" in { [info] + be cold "and icy" in { … } [info] + and icy "and unique" in { … } [info] + and unique "A snowflake" should { "in the desert" should { "melt" in { … } object SnowflakeSpec extends Specification { "A snowflake" isSpecifiedBy SnowflakeInTheDesertSpec , SnowflakeInTheFrideSpec , SnowflakeOnTheTongueSpec }
  • 7.
  • 8. 100+ are documented at time of writing (v1.4.4)
  • 9. Can write custom matchers. Can be combinatorial. PhoneBillSpec.scala "A phone bill" should { "keep a count of calls made" in { bill.numberOfCallsMade must_== 3 "A phone bill" should { "include a call to my mother" in { bill.callsMade must contain ("9898 4477") "A phone bill" should { "export calls to file" in { bill.exportFile must (beReadable and not(beHidden))
  • 10.
  • 11. Default of 100 arbitrary test input values per statement
  • 12. For all n (where n >=0) √n² must equal n SquareRooter.scala object SquareRooterSpec extends Specification with ScalaCheck { "A Square Rooter" should { "find the originally squared value (as long as it wasn't negative)" in { // forAll { (n: Int) => scala.Math.sqrt(n*n) == n } must pass // fails on -1 forAll { n: Int => n >= 0 ==> (scala.Math.sqrt(n*n) == n) } must pass
  • 13.
  • 15. each Example SetupAndTeardown.scala object SetupAndTeardown extends Specification { doBeforeSpec{ println( "Specification setup" ) } doFirst{ println( "System setup" ) } doBefore{ println( "Example setup" ) } … doAfter{ println( "example teardown" ) } doLast{ println( "System teardown" ) } doAfterSpec{ println( "Specification teardown" ) } }
  • 16.
  • 17. They come with a warning – expect the unexpected if shared and mutated in different Systems within the Specification. And don't feed after midnight. ThreadedLists.scala var listOfStrings:List[ String ] = Nil val withThreeValues = beforeContext { listOfStrings = "bob" :: "harry" :: "dorothy" :: Nil } "A list of three Strings" ->-(withThreeValues) should { "be of three strings long" in { listOfStrings.length must_== 3 } }
  • 18.
  • 19.
  • 20. External (a case class extending SystemContext) MonkeyKing.scala object MonkeyKingSpec extends Specification with SystemContexts { /* Demonstrates explicit, internal system context. See example for more. */ "The monkey king under attack" should { val monkeyKingUnderAttack = systemContext { new MonkeyKing ( true ) } "summon warriors from his ear hairs" .withA(monkeyKingUnderAttack) { monkeyKing => monkeyKing.summonsWarriorsFromEarHair must beTrue
  • 21.
  • 22.
  • 23. Instinct class StackSpec extends Spec with ShouldMatchers { describe( "A newly created Stack" ) { val stack = new Stack[Any] it( "should be empty" ) { stack should be ('empty) } } } class ANewlyCreatedStack { val stack = new Stack[Any] @Specification def shouldBeEmpty = { expect that stack.depth isEqualTo 0 } }