Test Essentials
 Developer Perspective
Maxim
  Zaks
   @iceX33!
zaks@itemis.de
itemis AG
    MDSD!
 OpenSource!
   Eclipse!
    Agile!
   Mobile
What‘s your
  deal?
      iOS!
    Android!
      WP7!
  WebDeveloper
Why should
  we test?
document your intentions!
 eat your own dog food!
confidence by feedback!
    safe refactoring!
       debugging
How can we test?
Test First
Red, Green, Refactor!
Goes perfect with Unit
  Testing and Pair
    Programming
Test After
       White Box Testing!
   It is better than nothing!!
And sometimes even necessary:!
         Regression Test!
        Integration Test!
 Acceptance Test (UI/UX Test)
Test because
 you have a
 test phase
           !
  Just don‘t do that!!
Code have to be written
   with Test in mind!
 Black Box Test = QA
Test to
    explore
           !
   Example driven
    development!
Update safely to newer
       versions
What do we
  need for
  testing?
  DSL to define the test!
Runner to execute the test!
   Reports to visualize
          results
Test Frameworks forms
        the DSL
xUnit Frameworks
Class is a test
case!

Each public „test“
Method is a single
test!

Test case may
hold state, setup    Kent Beck

and tear down
methods
JUnit / OCUnit
 http://www.junit.org/
What we should keep
in mind using xUnit
 Test Methods should be atomic, as we don‘t
 know the order they will be executed!

 Test methods should be simple. No
 Conditions and no loops!

 Method and class names are used for
 reporting!

 Consider to use mocking and matching
 frameworks to make tests more concise
What‘s mocking all
      about?
 Unit testing is all about isolation!

   We wan‘t to test a boss who depend on
   his assistant!

   We provide him a spy assistant and
   monitor how he interacts!

 Dependency Injection is the concept that
 let us do isolation in non dynamic
 language
Mockito
http://code.google.com/p/mockito/
And what was it
 with matching?
Matchers let us express expectations
in a very concise way!

Matchers will generate a pretty
report when expectation is not
fulfilled!

Matching framework let us define
our own matchers
Hamcrest Matcher
http://code.google.com/p/hamcrest/
What‘s wrong with
      xUnit
xUnit Frameworks are the basis for
Test Driven Development!

Perfect from technical perspective!

But hard to use for communication
(remember: „document your
intensions“)
Behavior
   Driven
Development
   It‘s all about
  Communication!
     don‘t test!
 specify your code

                     Dan North
BDD Frameworks

There are two main flavors behind
BDD Frameworks:!

 Describe what you expect it
 should do (RSpec family)!

 Given/When/Then (Cucumber
 family)
describe what you
expect it should do
 Internal DSL which let you write
 executable or pending specifications!

 Good fit for Unit testing!

 Comes with mocking and matching
 solutions inside!

 Let you define nonlinear context
 creation
Jasmine Spec
http://pivotal.github.com/jasmine/
Kiwi
https://github.com/allending/Kiwi
Given/When/Then

Breaks down into:!

  Feature!

  User story!

  Scenario!

  Steps (Given/When/Then)
External DSL

Given/When/Then frameworks
work perfectly with external DSLs!

These frameworks can evaluate
Plain Text, Wiki Pages or Excel
spread sheets and execute the steps
Scenario definition
JBehave Steps
 http://jbehave.org/
Let‘s sum up on
Testing Frameworks
 xUnit Frameworks (with handy
 helpers)!

 Describe what you expect it should do!

 Given/When/Then!

 And as always there is one more
 thing, UX/UI Testing
UI Test Framework

 Selenium!

 KIF!

 UIAutomation!

   Zucchini Framework
UX / UI Testing

Launch the application in the runtime!

Select UI element!

Perform actions!

Wait for UI component to appear!

Assert visual or structural
appearance
One small advice:
If you can record and
  replay a test case.
      Just Don‘t!
Zucchini Framework
http://www.zucchiniframework.org/
Zucchini Framework
Zucchini Report
Zucchini Report
I hope I could
convince you that
Test is important
  and exciting
Some concepts as
Military Metaphors
Leave no men
   behind
 100% code coverage
Protect your rear                  (back)




Test protects you from butterfly effect
Sniper vs. Cluster
      Bomb
  Unit vs. Integration Test
Q&A
Thank you!!!
 We are consulting :)

More Related Content

PPT
Specification by example and agile acceptance testing
PPTX
Cucumber - Maria Machlowska
PPTX
How to Deliver the Right Software (Specification by example)
PPT
Lessons Learned in a Continuously Developing Service-Oriented Architecture
PDF
Unwritten Manual for Pair Programming
PDF
BDD & Cucumber
PDF
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
PPTX
Comments are Useless
Specification by example and agile acceptance testing
Cucumber - Maria Machlowska
How to Deliver the Right Software (Specification by example)
Lessons Learned in a Continuously Developing Service-Oriented Architecture
Unwritten Manual for Pair Programming
BDD & Cucumber
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
Comments are Useless

What's hot (20)

PPTX
Code Review Best Practices
PPTX
Spec by-example
PDF
Clean Software Design - DevNot Summit Istanbul 2017
PDF
Tdd 왜 배우기 어려운가
PPTX
Code Review
ODP
Documenting Code - Patterns and Anti-patterns - NLPW 2016
ODP
Beyond Unit Testing
PDF
Coderetreat - Practice to Master Your Crafts
PDF
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
PDF
TDD — Are you sure you properly test code?
PPTX
11th Salesforce Developer Group meeting in Bilbao
PPTX
Designing with tests
PDF
Acceptance Test Driven Development
PDF
Tdd2018 state of the software quality in Germany
PPT
Effective specifications for agile teams
ODP
Documenting code yapceu2016
PDF
Boquet manager
PDF
It's all about behaviour, also in php - phpspec
PDF
Test Driven Development in AEM/CQ5
PDF
Global Day of Coderetreat'14 - Istanbul Event
Code Review Best Practices
Spec by-example
Clean Software Design - DevNot Summit Istanbul 2017
Tdd 왜 배우기 어려운가
Code Review
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Beyond Unit Testing
Coderetreat - Practice to Master Your Crafts
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
TDD — Are you sure you properly test code?
11th Salesforce Developer Group meeting in Bilbao
Designing with tests
Acceptance Test Driven Development
Tdd2018 state of the software quality in Germany
Effective specifications for agile teams
Documenting code yapceu2016
Boquet manager
It's all about behaviour, also in php - phpspec
Test Driven Development in AEM/CQ5
Global Day of Coderetreat'14 - Istanbul Event
Ad

Viewers also liked (7)

PDF
Currying in Swift
PPTX
Latest enzyme (2)
PDF
Chemistry of Essential Fatty Acids
PPTX
Lipids methodology
PPSX
Glucose tolerance test
PPT
Dr ravi lipid profile
PPT
Effect of Temperature and pH on enzyme activity
Currying in Swift
Latest enzyme (2)
Chemistry of Essential Fatty Acids
Lipids methodology
Glucose tolerance test
Dr ravi lipid profile
Effect of Temperature and pH on enzyme activity
Ad

Similar to Test Essentials @mdevcon 2012 (20)

PPTX
CucumberSeleniumWD
PDF
Test Driven Development - Workshop
PDF
Frontend automation and stability
PDF
Developer Efficiency
PDF
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
ODP
xUnit and TDD: Why and How in Enterprise Software, August 2012
PDF
Developer Job in Practice
PDF
Cucumber tutorial
PPT
Behavior Driven Development by Example
PDF
Paris Web - Javascript as a programming language
PPTX
DDT Testing Library for Android
PDF
Continuous Delivery for Agile Teams
PPTX
Growing Trends of Open Source UI Frameworks
PPTX
Coding Naked
PPTX
Test-Driven Development In Action
PDF
Web Test Automation Framework - IndicThreads Conference
PDF
10 Ways To Improve Your Code( Neal Ford)
PPT
Test-Driven Development
PPT
Test Driven Development
PPT
Test-Driven Development
CucumberSeleniumWD
Test Driven Development - Workshop
Frontend automation and stability
Developer Efficiency
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
xUnit and TDD: Why and How in Enterprise Software, August 2012
Developer Job in Practice
Cucumber tutorial
Behavior Driven Development by Example
Paris Web - Javascript as a programming language
DDT Testing Library for Android
Continuous Delivery for Agile Teams
Growing Trends of Open Source UI Frameworks
Coding Naked
Test-Driven Development In Action
Web Test Automation Framework - IndicThreads Conference
10 Ways To Improve Your Code( Neal Ford)
Test-Driven Development
Test Driven Development
Test-Driven Development

More from Maxim Zaks (20)

PDF
Entity Component System - a different approach to game and app development
PDF
Nitty Gritty of Data Serialisation
PDF
Wind of change
PDF
Data model mal anders
PDF
Talk Binary to Me
PDF
Entity Component System - for App developers
PDF
Beyond JSON - An Introduction to FlatBuffers
PDF
Beyond JSON @ Mobile.Warsaw
PDF
Beyond JSON @ dot swift 2016
PDF
Beyond JSON with FlatBuffers
PDF
Basics of Computer Science
PDF
Entity system architecture with Unity @Unite Europe 2015
PDF
UIKonf App & Data Driven Design @swift.berlin
PDF
Swift the implicit parts
PDF
Promise of an API
PDF
96% macoun 2013
PDF
Diagnose of Agile @ Wooga 04.2013
PDF
Start playing @ mobile.cologne 2013
PDF
Under Cocos2D Tree @mdvecon 2013
PDF
Don’t do Agile, be Agile @NSConf 2013
Entity Component System - a different approach to game and app development
Nitty Gritty of Data Serialisation
Wind of change
Data model mal anders
Talk Binary to Me
Entity Component System - for App developers
Beyond JSON - An Introduction to FlatBuffers
Beyond JSON @ Mobile.Warsaw
Beyond JSON @ dot swift 2016
Beyond JSON with FlatBuffers
Basics of Computer Science
Entity system architecture with Unity @Unite Europe 2015
UIKonf App & Data Driven Design @swift.berlin
Swift the implicit parts
Promise of an API
96% macoun 2013
Diagnose of Agile @ Wooga 04.2013
Start playing @ mobile.cologne 2013
Under Cocos2D Tree @mdvecon 2013
Don’t do Agile, be Agile @NSConf 2013

Test Essentials @mdevcon 2012