SmokeTests
Why you should try to burn down
your production environment
Sebastian Thoß
Chapter Lead Backend
SmokeTests
Disclaimer
Agenda
• Project Architecture
• Types Of Tests
• SmokeTests
• Server Architecture
• Questions & Answers
Project

Architecture
"one hundred fifty-seven quinvigintillion, seven hundred eighty-six
quattuorvigintillion, six hundred fifty-seven trevigintillion, seven hundred
forty-seven duovigintillion, three hundred forty unvigintillion, one hundred
eighty-six vigintillion, (…) nine hundred forty-five quintillion, eight hundred
twenty-eight quadrillion, two hundred seventy trillion, eighty billion, …"
SmokeTests
SmokeTests
Webserver
Key-Value
Store
Search
FURY Frontend FURY Backend
FURY Components
Webserver
Key-Value
Store
Search
FURY Frontend FURY Backend
Legacy RDBMSLegacy System
Session
Storage
Collect & Export
K-V

Store
Webserver
Key-Value
Store
Search
FURY Frontend FURY Backend
Legacy RDBMSLegacy System
FURY Requests
200OK
Session
Storage
K-V

Store
Webserver
Key-Value
Store
Search
FURY Frontend FURY Backend
Legacy RDBMSLegacy System
Requests to Legacy System
404NOTFOUND
Session
Storage
K-V

Store
Webserver
Key-Value
Store
Search
FURY Frontend FURY Backend
Legacy RDBMSLegacy System
Requests to Legacy System
404NOTFOUND
200 OK
Session
Storage
K-V

Store
More information on
www.sebastianthoss.de
Types Of Tests
Test Pyramid
UNITTESTS
Class 2
Class 3
Mock
Mock
Unit Tests
Class 1
Class 4
SmokeTests
Test Pyramid
INTEGRATION TESTS
UNITTESTS
Class 4Class 3
Integration Tests
Class 1 Class 2
Mock Mock
Test Pyramid
INTEGRATION TESTS
UNITTESTS
100%CODECOVERAGE
Test Pyramid
ACCEPTANCE TESTS
INTEGRATION TESTS
UNITTESTS
Acceptance Tests
Class 1 Class 2
Class 3 Class 4
Test Pyramid
ACCEPTANCE TESTS
INTEGRATION TESTS
UNITTESTS
?
SmokeTests
What are SmokeTests?
In computer programming and
software testing, smoke testing is
preliminary testing to reveal simple
failures severe enough to reject a
prospective software release.

Source: https://en.wikipedia.org/wiki/Smoke_testing
What are SmokeTests?
SmokeTests should…
• … be simple
• … be fast
• … test pages with optional parameters too
• … cover at least all URLs in google index
• … use a manual maintained list of URLs
How do SmokeTests work?
https://www.my-application.com/foo
<html><body>…</body></html>
TTFB: 65ms
HTTP 1.1/200 OK
SmokeTest

Client
CI Server
Application 

to test
Production Server
How do SmokeTests work?
https://www.my-application.com/foo
<html><body>…</body></html>
TTFB: 320ms
HTTP 1.1/200 OK
SmokeTest

Client
CI Server Production Server
Application 

to test
What should SmokeTests validate?
• Status code
• Time to first byte
• If body is provided
• Correct server
SmokeTests are NOT Acceptance Tests
SmokeTest

Client
HTTP 1.1/200 OK
<html>
<head>
<title>Foo</title>
<body>
<div id="bar"><span>foobar</span></div>
</body>
</html>
namespace KartenmachereiTesting;
use PHPUnit_Framework_TestCase;
class SmokeTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider furyUrlProvider
*
* @param Url $url
*/
public function testFuryUrl(Url $url)
{
$result = $this->sendGetRequest($url);
$this->assertSame(200, $result->getStatusCode());
$this->assertNotEmpty($result->getBody());
$this->assertLessThanOrEqual(100, $result->getTimeToFirstByteInMilliseconds());
}
public function furyUrlProvider()
{
$urls = ['http://www.kartenmacherei.de', …];
$urlCollection = UrlCollection::fromStrings($urls);
return $urlCollection->asDataProviderArray($urlCollection);
}
How to speed up SmokeTests?
Concurrent SmokeTests
SmokeTest

Client
CI Server
Application

to test
Production Server
https://www.my-application.com/baz
https://www.my-application.com/bar
https://www.my-application.com/foo
Concurrent SmokeTests
https://www.my-application.com/baz
https://www.my-application.com/bar
https://www.my-application.com/foo
TTFB: 34ms
SmokeTest

Client
CI Server
Application

to test
Production Server
Concurrent SmokeTests
https://www.my-application.com/foobaz
https://www.my-application.com/bar
https://www.my-application.com/foo
SmokeTest

Client
CI Server
Application

to test
Production Server
Concurrent SmokeTests
TTFB: 65ms
https://www.my-application.com/foobaz
https://www.my-application.com/bar
https://www.my-application.com/foo
SmokeTest

Client
CI Server
Application

to test
Production Server
Concurrent SmokeTests
https://www.my-application.com/123
https://www.my-application.com/foobaz
https://www.my-application.com/bar
SmokeTest

Client
CI Server
Application

to test
Production Server
Concurrent SmokeTests
TTFB: 620ms
https://www.my-application.com/123
https://www.my-application.com/foobaz
https://www.my-application.com/bar
SmokeTest

Client
CI Server
Application

to test
Production Server
Source: http://www.ve7kfm.com/fcc-server.jpg
Let’s try to burn it down!
There is a package for SmokeTests
DjThossi/Smoke-Testing-PHP
DataProvider
Test
Application
HTTP Requests
HTTP Responses
PHPUnit
Call
Result[]
Result
class SmokeTest extends PHPUnit_Framework_TestCase
{
use SmokeTestTrait;
/**
* @dataProvider myDataProvider
*/
public function testExample(Result $result)
{
$this->assertSuccess($result);
$this->assertTimeToFirstByte(new TimeToFirstByte(100), $result);
$this->assertBodyNotEmpty($result);
$this->assertHeaderExists(Header::fromPrimitives(‘App-Server', ‘Fury’), $result);
}
public function myDataProvider()
{
$urls = ['http://www.kartenmacherei.de', …];
$options = new SmokeTestOptions(
UrlCollection::fromStrings($urls),
new RequestTimeout(2),
new FollowRedirects(true),
new Concurrency(3),
new BodyLength(500)
);
return $this->runSmokeTests($options);
}
class SmokeTest extends PHPUnit_Framework_TestCase
{
use SmokeTestTrait;
/**
* @dataProvider myDataProvider
*/
public function testExample(Result $result)
{
$this->assertSuccess($result);
$this->assertTimeToFirstByte(new TimeToFirstByte(100), $result);
$this->assertBodyNotEmpty($result);
$this->assertHeaderExists(Header::fromPrimitives(‘App-Server', ‘Fury’), $result);
}
public function myDataProvider()
{
$urls = ['http://www.kartenmacherei.de', …];
$options = new SmokeTestOptions(
UrlCollection::fromStrings($urls),
new RequestTimeout(2),
new FollowRedirects(true),
new Concurrency(3),
new BodyLength(500)
);
return $this->runSmokeTests($options);
}
class SmokeTest extends PHPUnit_Framework_TestCase
{
use SmokeTestTrait;
/**
* @dataProvider myDataProvider
*/
public function testExample(Result $result)
{
$this->assertSuccess($result);
$this->assertTimeToFirstByte(new TimeToFirstByte(100), $result);
$this->assertBodyNotEmpty($result);
$this->assertHeaderExists(Header::fromPrimitives(‘App-Server', ‘Fury’), $result);
}
public function myDataProvider()
{
$urls = ['http://www.kartenmacherei.de', …];
$options = new SmokeTestOptions(
UrlCollection::fromStrings($urls),
new RequestTimeout(2),
new FollowRedirects(true),
new Concurrency(3),
new BodyLength(500)
);
return $this->runSmokeTests($options);
}
class SmokeTest extends PHPUnit_Framework_TestCase
{
use SmokeTestTrait;
/**
* @dataProvider myDataProvider
*/
public function testExample(Result $result)
{
$this->assertSuccess($result);
$this->assertTimeToFirstByte(new TimeToFirstByte(100), $result);
$this->assertBodyNotEmpty($result);
$this->assertHeaderExists(Header::fromPrimitives(‘App-Server', ‘Fury’), $result);
}
public function myDataProvider()
{
$urls = ['http://www.kartenmacherei.de', …];
$options = new SmokeTestOptions(
UrlCollection::fromStrings($urls),
new RequestTimeout(2),
new FollowRedirects(true),
new Concurrency(3),
new BodyLength(500)
);
return $this->runSmokeTests($options);
}
class SmokeTest extends PHPUnit_Framework_TestCase
{
use SmokeTestTrait;
/**
* @dataProvider myDataProvider
*/
public function testExample(Result $result)
{
$this->assertSuccess($result);
$this->assertTimeToFirstByte(new TimeToFirstByte(100), $result);
$this->assertBodyNotEmpty($result);
$this->assertHeaderExists(Header::fromPrimitives(‘App-Server', ‘Fury’), $result);
}
public function myDataProvider()
{
$urls = ['http://www.kartenmacherei.de', …];
$options = new SmokeTestOptions(
UrlCollection::fromStrings($urls),
new RequestTimeout(2),
new FollowRedirects(true),
new Concurrency(3),
new BodyLength(500)
);
return $this->runSmokeTests($options);
}
class SmokeTest extends PHPUnit_Framework_TestCase
{
use SmokeTestTrait;
/**
* @dataProvider myDataProvider
*/
public function testExample(Result $result)
{
$this->assertSuccess($result);
$this->assertTimeToFirstByte(new TimeToFirstByte(100), $result);
$this->assertBodyNotEmpty($result);
$this->assertHeaderExists(Header::fromPrimitives(‘App-Server', ‘Fury’), $result);
}
public function myDataProvider()
{
$urls = ['http://www.kartenmacherei.de', …];
$options = new SmokeTestOptions(
UrlCollection::fromStrings($urls),
new RequestTimeout(2),
new FollowRedirects(true),
new Concurrency(3),
new BodyLength(500)
);
return $this->runSmokeTests($options);
}
Output
Features to come next
• Improve ErrorResult object
• Introduce assertions for Redirects
• Improve quality of error message
• 2nd version based on PHPUnit 6
Server Architecture
Webserver (Router)
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver
FURY Frontend
Server B
K/V StoreSearch
FURY Backend
Webserver (Router)
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver
FURY Frontend
Server B
K/V StoreSearch
FURY Backend
active = A
Webserver (Router)
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver
FURY Frontend
Server B
K/V StoreSearch
FURY Backend
active = B
Webserver (Router)
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
active = B
RDBMS 

Read Slave
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver (Router)
Build Server
Deploy Code
active = B
RDBMS 

Read Slave
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver (Router)
Build Server
Deploy Code
Collect & Export
active = B
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver (Router)
Build Server
Deploy Code
Collect & Export
Smoke Tests
active = B
RDBMS 

Read Slave
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver (Router)
Build Server
Deploy Code
Collect & Export
Smoke Tests
active = B
RDBMS 

Read Slave
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver (Router)
Build Server
Deploy Code
Collect & Export
Smoke Tests
active = B
RDBMS 

Read Slave
Webserver
FURY Frontend
Server A
K/V StoreSearch
FURY Backend
Webserver (Router)
Build Server
Deploy Code
Collect & Export
Smoke Tests
Switch to A
active = Bactive = A
RDBMS 

Read Slave
Conclusion
• Write tests
• Get 100% coverage
• SmokeTest your Website
• Only activate server if it didn’t start smoking
https://www.facebook.com/kartenmacherei/
jobs@kartenmacherei.de
http://inside.kartenmacherei.de/job.html
https://tech.kartenmacherei.de
@techdotkam
Contact & Feedback
Q&A

More Related Content

PDF
PyCon HK 2015 - Monitoring the performance of python web applications
PDF
PyCon AU 2015 - Using benchmarks to understand how wsgi servers work
PDF
Flask With Server-Sent Event
PDF
Annotation processing and code gen
PPTX
Internal Hive
PDF
Terraform Introduction
PDF
Terraform at Scale - All Day DevOps 2017
PDF
A Hands-on Introduction on Terraform Best Concepts and Best Practices
PyCon HK 2015 - Monitoring the performance of python web applications
PyCon AU 2015 - Using benchmarks to understand how wsgi servers work
Flask With Server-Sent Event
Annotation processing and code gen
Internal Hive
Terraform Introduction
Terraform at Scale - All Day DevOps 2017
A Hands-on Introduction on Terraform Best Concepts and Best Practices

What's hot (20)

PPTX
Tutorial Stream Reasoning SPARQLstream and Morph-streams
ODP
Otimizando seu projeto Rails
PDF
Intro to Terraform
PDF
Refactoring Infrastructure Code
KEY
PyCon AU 2012 - Debugging Live Python Web Applications
PPTX
How to perform debounce in react
PDF
Learning Dtrace
PDF
Refactoring terraform
PPTX
Node.js/io.js Native C++ Addons
PDF
Unit Testing Express Middleware
PDF
Node.js API 서버 성능 개선기
PDF
PPTX
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
PDF
node.js practical guide to serverside javascript
TXT
An a z index of windows power shell commandss
PPT
Ggug spock
PDF
Unit testing with mocha
PDF
Who wants to be a Developer?
PDF
Scaling FastAGI Applications with Go
PPTX
"Continuously delivering infrastructure using Terraform and Packer" training ...
Tutorial Stream Reasoning SPARQLstream and Morph-streams
Otimizando seu projeto Rails
Intro to Terraform
Refactoring Infrastructure Code
PyCon AU 2012 - Debugging Live Python Web Applications
How to perform debounce in react
Learning Dtrace
Refactoring terraform
Node.js/io.js Native C++ Addons
Unit Testing Express Middleware
Node.js API 서버 성능 개선기
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
node.js practical guide to serverside javascript
An a z index of windows power shell commandss
Ggug spock
Unit testing with mocha
Who wants to be a Developer?
Scaling FastAGI Applications with Go
"Continuously delivering infrastructure using Terraform and Packer" training ...
Ad

Viewers also liked (20)

PDF
Ajax And JSON
PPTX
Summer training seminar
PPTX
PPTX
Basic Website 101
PPTX
Turning Marketing Words into a Branded People Experience
PPT
Web Security Introduction Webserver hacking refers to ...
PDF
PHPNW14 - Getting Started With AWS
PDF
Why Node.js
PPT
Web Fendamentals
ODP
Joomla REST API
PPT
Pentesting web applications
PPT
Tüp ve overlerin benign hastalıkları
PPTX
Intraartiküler salin
PPTX
Capítulo iii
PDF
Podemos - Programa Propuestas Empleo
PDF
Media kit es_1462288954-4
DOCX
Slidehar
PPTX
South Bay Real Estate Market Update - September 2016
PPTX
Ayuda visual c.espe-ganadera
PDF
Black Friday, The Aftermath
Ajax And JSON
Summer training seminar
Basic Website 101
Turning Marketing Words into a Branded People Experience
Web Security Introduction Webserver hacking refers to ...
PHPNW14 - Getting Started With AWS
Why Node.js
Web Fendamentals
Joomla REST API
Pentesting web applications
Tüp ve overlerin benign hastalıkları
Intraartiküler salin
Capítulo iii
Podemos - Programa Propuestas Empleo
Media kit es_1462288954-4
Slidehar
South Bay Real Estate Market Update - September 2016
Ayuda visual c.espe-ganadera
Black Friday, The Aftermath
Ad

Similar to SmokeTests (20)

PPT
Performance and Scalability Testing with Python and Multi-Mechanize
KEY
Workshop quality assurance for php projects tek12
PDF
SmokeTests - What, Why & How - ConFoo 2019
PPTX
How to ensure Presto scalability 
in multi use case
PDF
Quality Assurance for PHP projects - ZendCon 2012
PDF
Solr @ Etsy - Apache Lucene Eurocon
PDF
Create, test, secure, repeat
PPTX
QSpiders - Installation and Brief Dose of Load Runner
PDF
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PPTX
Altitude San Francisco 2018: Testing with Fastly Workshop
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud
PPTX
Maximizer 2018 API training
PDF
Scrapy workshop
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
PDF
Vagrant + Rouster at salesforce.com - PuppetConf 2013
PDF
Smoke tests - what why how - PHP Srbija
KEY
JAX-RS 2.0 New Features
PPTX
Run Node Run
PDF
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
PDF
Let's read code: the python-requests library
Performance and Scalability Testing with Python and Multi-Mechanize
Workshop quality assurance for php projects tek12
SmokeTests - What, Why & How - ConFoo 2019
How to ensure Presto scalability 
in multi use case
Quality Assurance for PHP projects - ZendCon 2012
Solr @ Etsy - Apache Lucene Eurocon
Create, test, secure, repeat
QSpiders - Installation and Brief Dose of Load Runner
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
Altitude San Francisco 2018: Testing with Fastly Workshop
fog or: How I Learned to Stop Worrying and Love the Cloud
Maximizer 2018 API training
Scrapy workshop
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Smoke tests - what why how - PHP Srbija
JAX-RS 2.0 New Features
Run Node Run
Software as a Service workshop / Unlocked: the Hybrid Cloud 12th May 2014
Let's read code: the python-requests library

More from tech.kartenmacherei (8)

PDF
PHPUnit in 4 parts - ConFoo 2019
PDF
An Ode To Boring Technology
PDF
Learning to Drive - A story about app development
PDF
Api Versioning with Docker and Nginx
PDF
Smoke Tests @ DevOps-Hamburg 06.02.2017
PDF
Don't fear the Walking Dead @ IPC 2016
PDF
99% is not enough
PDF
Don't Fear the Walking Dead @ PHPUGHH
PHPUnit in 4 parts - ConFoo 2019
An Ode To Boring Technology
Learning to Drive - A story about app development
Api Versioning with Docker and Nginx
Smoke Tests @ DevOps-Hamburg 06.02.2017
Don't fear the Walking Dead @ IPC 2016
99% is not enough
Don't Fear the Walking Dead @ PHPUGHH

Recently uploaded (20)

PDF
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
PDF
The Evolution of Traditional to New Media .pdf
PDF
Alethe Consulting Corporate Profile and Solution Aproach
PDF
Containerization lab dddddddddddddddmanual.pdf
PDF
Paper The World Game (s) Great Redesign.pdf
PDF
Slides: PDF The World Game (s) Eco Economic Epochs.pdf
PPTX
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
PPTX
Basic understanding of cloud computing one need
PDF
Uptota Investor Deck - Where Africa Meets Blockchain
PPTX
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
PDF
Exploring The Internet Of Things(IOT).ppt
PPTX
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes
DOCX
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
PPTX
Partner to Customer - Sales Presentation_V23.01.pptx
PDF
simpleintnettestmetiaerl for the simple testint
PPTX
Reading as a good Form of Recreation
PDF
Buy Cash App Verified Accounts Instantly – Secure Crypto Deal.pdf
PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
PPTX
Artificial_Intelligence_Basics use in our daily life
PPTX
Viva Digitally Software-Defined Wide Area Network.pptx
Virtual Guard Technology Provider_ Remote Security Service Solutions.pdf
The Evolution of Traditional to New Media .pdf
Alethe Consulting Corporate Profile and Solution Aproach
Containerization lab dddddddddddddddmanual.pdf
Paper The World Game (s) Great Redesign.pdf
Slides: PDF The World Game (s) Eco Economic Epochs.pdf
ECO SAFE AI - SUSTAINABLE SAFE AND HOME HUB
Basic understanding of cloud computing one need
Uptota Investor Deck - Where Africa Meets Blockchain
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
Exploring The Internet Of Things(IOT).ppt
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes
Memecoinist Update: Best Meme Coins 2025, Trump Meme Coin Predictions, and th...
Partner to Customer - Sales Presentation_V23.01.pptx
simpleintnettestmetiaerl for the simple testint
Reading as a good Form of Recreation
Buy Cash App Verified Accounts Instantly – Secure Crypto Deal.pdf
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
Artificial_Intelligence_Basics use in our daily life
Viva Digitally Software-Defined Wide Area Network.pptx

SmokeTests