patterns tools test flow - cdn2-ecros.pl · patterns tools test flow end thoughts working example...
TRANSCRIPT
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see is what You getHow testing tools and level can change the way You see the system
Rafał Łojek
5 November 2015
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Outline
WYSIWG
The making of testsPatternsToolsTest Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Who Am I? And Who I Am not.
I’m not a professional software testerI’m far from being a project managerI’m not a business analystI am a software developer
a Java coderNot so super promasta killer programmerjust a good programmer
with a set of useful professional habits
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Who Am I? And Who I Am not.
I’m not a professional software testerI’m far from being a project managerI’m not a business analystI am a software developer
a Java coderNot so super promasta killer programmerjust a good programmer
with a set of useful professional habits
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Who Am I? And Who I Am not.
I’m not a professional software testerI’m far from being a project managerI’m not a business analystI am a software developer
a Java coderNot so super promasta killer programmerjust a good programmer
with a set of useful professional habits
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Who Am I? And Who I Am not.
I’m not a professional software testerI’m far from being a project managerI’m not a business analystI am a software developer
a Java coderNot so super promasta killer programmerjust a good programmer
with a set of useful professional habits
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Who Am I? And Who I Am not.
I’m not a professional software testerI’m far from being a project managerI’m not a business analystI am a software developer
a Java coderNot so super promasta killer programmerjust a good programmer
with a set of useful professional habits
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Who Am I? And Who I Am not.
I’m not a professional software testerI’m far from being a project managerI’m not a business analystI am a software developer
a Java coderNot so super promasta killer programmerjust a good programmer
with a set of useful professional habits
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Who Am I? And Who I Am not.
I’m not a professional software testerI’m far from being a project managerI’m not a business analystI am a software developer
a Java coderNot so super promasta killer programmerjust a good programmer
with a set of useful professional habits
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
WYSIWG
What You See
Is What You Get
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
WYSIWGNot always :/
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleSometimes it is a matter of perception...
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleSome times a point of view...
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleOften our own actions...
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Why test are written?
I To have code testedI Live documentationI Executable specificationI The ultimate source of truthI Examples of API useI Acceptance criteria
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Why test are written?
I To have code testedI Live documentationI Executable specificationI The ultimate source of truthI Examples of API useI Acceptance criteria
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Why test are written?
I To have code testedI Live documentationI Executable specificationI The ultimate source of truthI Examples of API useI Acceptance criteria
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Why test are written?
I To have code testedI Live documentationI Executable specificationI The ultimate source of truthI Examples of API useI Acceptance criteria
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Why test are written?
I To have code testedI Live documentationI Executable specificationI The ultimate source of truthI Examples of API useI Acceptance criteria
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Why test are written?
I To have code testedI Live documentationI Executable specificationI The ultimate source of truthI Examples of API useI Acceptance criteria
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Expectations
I ExpressionI Human readableI Adequate Abstraction level
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Expectations
I ExpressionI Human readableI Adequate Abstraction level
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Expectations
I ExpressionI Human readableI Adequate Abstraction level
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Feature: Convert temperature from Celsius to Fahrenheit
Coupling ConverHannoverter with Formatter should produce human friendly outputwith sign +/- at the begging and two digits precession.
Scenario: Easter egg messageTest Easter egg message when a user want to convert temperature 666 Celsius.Given Temperature is 666When is convertedThen I should see formatted output "Feels like home"
Scenario Outline: Convert characteristic pointsFor characteristic points on Fahrenheit scale conversation should guaranteecorrect function for whole valid range.Given Temperature is <Celsius>When is convertedThen I should see formatted output "<Fahrenheit>"
HannoverExamples: Check points for temperature| Celsius | Fahrenheit || 0 | +32,00 || 100 | +212,00 || -273 | -459,40 || -1000 | -459,40 |
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
@RunWith(Enclosed.class)public class TemperatureFormatterSeparatedTest {
@RunWith(Parameterized.class)public static class FormatterCharacteristicPoints {
TemperatureFormatter cut = new TemperatureFormatter();content...
@Parameterspublic static Collection<Object[]> data() {
return Arrays.asList(new Object[][]{{0, "+32,00"},{100, "+212,00"},{-273, "-459,40"},{-1000, "-459,40"}
});}
@Parameterpublic double tempInCelsius;@Parameter(value = 1)public String requiredFormattedOutput;
content...@Testpublic void shouldConvertTemperatureToRequiredFormattedOutput() throws
Exception {
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
@Testpublic void shouldConvertTemperatureToRequiredFormattedOutput() throws
Exception {double temperatureInFahcontent...renheit = new
CelsiusToFahrenheit().convert(tempInCelsius);String formattedTemperature =
cut.formatTemperature(temperatureInFahrenheit);assertThat(formattedTemperature,
is(equalTo(requiredFormattedOutput)));}
}
public static class EasterEggConversation {TemperatureFormatter cut = new TemperatureFormatter();
@Testpublic void shouldReturnFeelsLikeHomeWhenTempIs666() throws Exception {
double temperatureInFahrenheit = newCelsiusToFahrenheit().convert(666.0);
String formattedTemperature =cut.formatTemperature(temperatureInFahrenheit);
assertThat(formattedTemperature, is("Feels like home"));}
}}
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Pyramids of test levels
Unit tests
Integration
System
User
Class / Method
Module / Interfaces
System / Module
UI / System
Number of
Run frequency
Impact
Workload
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Test making patternsLet’s rise some hands
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleTDD
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleATDD
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleBDD
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleBlack Box Testing
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleSpecification by example
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleData Driven
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleTests after the code
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
No tests!
The Customer will test for us
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Mongol Hordes Methodology
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Mongol Hordes Methodology
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Tools
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Tools
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Frameworks
Unit Testing ATDD/BDD Integration/System/ATDDxUnit library Cucumber Fitnesse
TestNG Spock Robot FrameworkJBehave Selenium
Concordion SikuliGatling IO
Any kind of scripting that do the job!
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example3 Steps Of Any Test
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
1
Set up the test
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
2
Execute test action
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
3
Assert results of a test action
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Assert!
Seriously! Assert!Check mock interactions,exceptions thrown
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
Assert Not Null – Punk!
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
To sum up
I Test level can change the perspectiveI Do not limit your self to one toolI Write technical way about technical aspect switch
to higher expression level for higher aspectsI Make your tests valid and valuable
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
To sum up
I Test level can change the perspectiveI Do not limit your self to one toolI Write technical way about technical aspect switch
to higher expression level for higher aspectsI Make your tests valid and valuable
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
To sum up
I Test level can change the perspectiveI Do not limit your self to one toolI Write technical way about technical aspect switch
to higher expression level for higher aspectsI Make your tests valid and valuable
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
To sum up
I Test level can change the perspectiveI Do not limit your self to one toolI Write technical way about technical aspect switch
to higher expression level for higher aspectsI Make your tests valid and valuable
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
To sum up...
Always ask questions
Are we doing the right thing?
In the right way?
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
To sum up...
Always ask questions
Are we doing the right thing?
In the right way?
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
To sum up...
Always ask questions
Are we doing the right thing?
In the right way?
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working ExampleHave somelive demo...
What You see iswhat You get
Rafał Łojek
WYSIWG
The making oftestsPatterns
Tools
Test Flow
End Thoughts
Working Example
THE END
FINNo production code was killed or harmed in the making of this presentation