SlideShare a Scribd company logo
1 of 26
Mashing up py.test, coverage.py
and ast.py to take TDD to a new
level
Tibor Arpas
tibor@infinit.sk
● freelancer
● but not “only”
● only Python since 2008
Tibor Arpáš - about me
About you
Users hate waiting
● 100 milliseconds
● 1 second
● 10 seconds
So computing adapts
● big improvement in recent years
Executing test suite
It’s easy to slip
● and one bad commit
can start a downward
spiral
● quality and effectivity
decline
Broken test suite
● error lifespan increase
● punishment of the
developers who are
diligent
But …
● how about running just affected tests?
Majority of code changes are local
• waste to run the
whole test suite each
time
Tests hand picking
• good luck
beeing correct
every time
When the dependencies look like this
Example “project” with a test suite in one file
Dependencies
subtract vs. test_add
Dependencies
Idea transformed into a tool: testmon.org
coverage.py
..
coverage.start()
code_to_track()
coverage.stop()
coverage.data
..
ast.py (standard library)
import ast
tree = ast.parse(source_code, file_name)
things that helped me to understand:
• https://github.com/mitsuhiko/pyastutil ->
codegen.py
• ast.dump
py.test plug-in
• py.test’s plugin
API is nice
• just a couple of
lines
Interesting aspect - crowdfunding
conclusion - testmon is awesome
● use
● give feedback
● share
Contacts
Contacts again
Tibor
tibor@infinit.sk
Questions?

More Related Content

What's hot

Sap inside track Munich 2017
Sap inside track Munich 2017Sap inside track Munich 2017
Sap inside track Munich 2017Rainer Winkler
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Danny Preussler
 
Importance of test automation, excuses and TDD introduction
Importance of test automation, excuses and TDD introductionImportance of test automation, excuses and TDD introduction
Importance of test automation, excuses and TDD introductionNicolas De Boose
 
TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)Danny Preussler
 
Analyzing the Evolution of Testing Library Usage in Open Source Java Projects
Analyzing the Evolution of Testing Library Usage in Open Source Java ProjectsAnalyzing the Evolution of Testing Library Usage in Open Source Java Projects
Analyzing the Evolution of Testing Library Usage in Open Source Java ProjectsAhmed Zerouali
 
Software development practices & Infrastructure as Code - how well do they wo...
Software development practices & Infrastructure as Code - how well do they wo...Software development practices & Infrastructure as Code - how well do they wo...
Software development practices & Infrastructure as Code - how well do they wo...Equal Experts
 
Common mistakes in tdd can you guess
Common mistakes in tdd   can you guessCommon mistakes in tdd   can you guess
Common mistakes in tdd can you guessChristos Matskas
 
Google, quality and you
Google, quality and youGoogle, quality and you
Google, quality and younelinger
 
Get testing bottlenecks out of your pipelines
Get testing bottlenecks out of your pipelinesGet testing bottlenecks out of your pipelines
Get testing bottlenecks out of your pipelineslisacrispin
 
End-to-end performance testing, profiling, and analysis at Redis
End-to-end performance testing, profiling, and analysis at RedisEnd-to-end performance testing, profiling, and analysis at Redis
End-to-end performance testing, profiling, and analysis at RedisFilipe Oliveira
 
The Whole Team Approach to Quality in Continuous Delivery
The Whole Team Approach to Quality in Continuous DeliveryThe Whole Team Approach to Quality in Continuous Delivery
The Whole Team Approach to Quality in Continuous Deliverylisacrispin
 
Facts about open source projects & testing
Facts about open source projects & testingFacts about open source projects & testing
Facts about open source projects & testingVu Hung Nguyen
 
Open source bridge testing antipatterns presentation
Open source bridge testing antipatterns presentationOpen source bridge testing antipatterns presentation
Open source bridge testing antipatterns presentationmmrobins
 
Java Beginners Meetup February 2017: Testing and TDD
Java Beginners Meetup February 2017: Testing and TDDJava Beginners Meetup February 2017: Testing and TDD
Java Beginners Meetup February 2017: Testing and TDDPatrick Kostjens
 

What's hot (17)

Sap inside track Munich 2017
Sap inside track Munich 2017Sap inside track Munich 2017
Sap inside track Munich 2017
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
 
Importance of test automation, excuses and TDD introduction
Importance of test automation, excuses and TDD introductionImportance of test automation, excuses and TDD introduction
Importance of test automation, excuses and TDD introduction
 
TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)TDD on android. Why and How? (Coding Serbia 2019)
TDD on android. Why and How? (Coding Serbia 2019)
 
Analyzing the Evolution of Testing Library Usage in Open Source Java Projects
Analyzing the Evolution of Testing Library Usage in Open Source Java ProjectsAnalyzing the Evolution of Testing Library Usage in Open Source Java Projects
Analyzing the Evolution of Testing Library Usage in Open Source Java Projects
 
Software development practices & Infrastructure as Code - how well do they wo...
Software development practices & Infrastructure as Code - how well do they wo...Software development practices & Infrastructure as Code - how well do they wo...
Software development practices & Infrastructure as Code - how well do they wo...
 
Common mistakes in tdd can you guess
Common mistakes in tdd   can you guessCommon mistakes in tdd   can you guess
Common mistakes in tdd can you guess
 
Google, quality and you
Google, quality and youGoogle, quality and you
Google, quality and you
 
Get testing bottlenecks out of your pipelines
Get testing bottlenecks out of your pipelinesGet testing bottlenecks out of your pipelines
Get testing bottlenecks out of your pipelines
 
End-to-end performance testing, profiling, and analysis at Redis
End-to-end performance testing, profiling, and analysis at RedisEnd-to-end performance testing, profiling, and analysis at Redis
End-to-end performance testing, profiling, and analysis at Redis
 
The Whole Team Approach to Quality in Continuous Delivery
The Whole Team Approach to Quality in Continuous DeliveryThe Whole Team Approach to Quality in Continuous Delivery
The Whole Team Approach to Quality in Continuous Delivery
 
Facts about open source projects & testing
Facts about open source projects & testingFacts about open source projects & testing
Facts about open source projects & testing
 
Experience Report
Experience ReportExperience Report
Experience Report
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Open source bridge testing antipatterns presentation
Open source bridge testing antipatterns presentationOpen source bridge testing antipatterns presentation
Open source bridge testing antipatterns presentation
 
Unit testing for project managers
Unit testing for project managersUnit testing for project managers
Unit testing for project managers
 
Java Beginners Meetup February 2017: Testing and TDD
Java Beginners Meetup February 2017: Testing and TDDJava Beginners Meetup February 2017: Testing and TDD
Java Beginners Meetup February 2017: Testing and TDD
 

Viewers also liked

Helsinki, finland (1952)
Helsinki, finland (1952)Helsinki, finland (1952)
Helsinki, finland (1952)school
 
La buena
La buenaLa buena
La buenaschool
 
Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...
Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...
Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...guestd0e4e0
 
testmon for Python
testmon for Pythontestmon for Python
testmon for Pythontib0r
 
C:\Fakepath\Black British English Presentation
C:\Fakepath\Black British English PresentationC:\Fakepath\Black British English Presentation
C:\Fakepath\Black British English Presentationçukurova
 
hojas de registro atletismo y olimpismo
hojas de registro atletismo y olimpismohojas de registro atletismo y olimpismo
hojas de registro atletismo y olimpismoschool
 
David Britland The Mind And Magic Of David Berglas
David Britland   The Mind And Magic Of David BerglasDavid Britland   The Mind And Magic Of David Berglas
David Britland The Mind And Magic Of David Berglasguest42bff84
 
TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!Kjetil Klaussen
 
TDD Performance Kata
TDD Performance KataTDD Performance Kata
TDD Performance KataAndrei Savu
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1Blue Elephant Consulting
 
TDD python ne-april-2014
TDD python ne-april-2014TDD python ne-april-2014
TDD python ne-april-2014Alex Kavanagh
 
PyCon APAC - Django Test Driven Development
PyCon APAC - Django Test Driven DevelopmentPyCon APAC - Django Test Driven Development
PyCon APAC - Django Test Driven DevelopmentTudor Munteanu
 
unittest in 5 minutes
unittest in 5 minutesunittest in 5 minutes
unittest in 5 minutesRay Toal
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven DevelopmentMichael Denomy
 

Viewers also liked (20)

Adverts
AdvertsAdverts
Adverts
 
Helsinki, finland (1952)
Helsinki, finland (1952)Helsinki, finland (1952)
Helsinki, finland (1952)
 
Manual Pengguna
Manual PenggunaManual Pengguna
Manual Pengguna
 
La buena
La buenaLa buena
La buena
 
Social Media in Practice
Social Media in PracticeSocial Media in Practice
Social Media in Practice
 
Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...
Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...
Cataract,Lasik,Retina,Glaucoma Surgeries at Rushabh Eye Hospital and Laser Ce...
 
testmon for Python
testmon for Pythontestmon for Python
testmon for Python
 
C:\Fakepath\Black British English Presentation
C:\Fakepath\Black British English PresentationC:\Fakepath\Black British English Presentation
C:\Fakepath\Black British English Presentation
 
hojas de registro atletismo y olimpismo
hojas de registro atletismo y olimpismohojas de registro atletismo y olimpismo
hojas de registro atletismo y olimpismo
 
David Britland The Mind And Magic Of David Berglas
David Britland   The Mind And Magic Of David BerglasDavid Britland   The Mind And Magic Of David Berglas
David Britland The Mind And Magic Of David Berglas
 
TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!TDD er død. Lenge leve TDD!
TDD er død. Lenge leve TDD!
 
TDD Performance Kata
TDD Performance KataTDD Performance Kata
TDD Performance Kata
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
 
Tdd da teoria a pratica
Tdd da teoria a praticaTdd da teoria a pratica
Tdd da teoria a pratica
 
TDD python ne-april-2014
TDD python ne-april-2014TDD python ne-april-2014
TDD python ne-april-2014
 
gae
gaegae
gae
 
Presentation TDD in Python
Presentation TDD in PythonPresentation TDD in Python
Presentation TDD in Python
 
PyCon APAC - Django Test Driven Development
PyCon APAC - Django Test Driven DevelopmentPyCon APAC - Django Test Driven Development
PyCon APAC - Django Test Driven Development
 
unittest in 5 minutes
unittest in 5 minutesunittest in 5 minutes
unittest in 5 minutes
 
Introduction to Test Driven Development
Introduction to Test Driven DevelopmentIntroduction to Test Driven Development
Introduction to Test Driven Development
 

Similar to Europython 2015 Testmon

Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerPyData
 
Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.Malinda Kapuruge
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code cleanBrett Child
 
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.comAdvanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.comDevOpsDays Tel Aviv
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)Thierry Gayet
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionPyxis Technologies
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Bruno Capuano
 
Test-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate WorkplaceTest-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate WorkplaceAhmed Owian
 
GDG Helwan Introduction to python
GDG Helwan Introduction to pythonGDG Helwan Introduction to python
GDG Helwan Introduction to pythonMohamed Hegazy
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentAll Things Open
 
ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"
ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"
ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"Aberla
 
2015 msu-code-review
2015 msu-code-review2015 msu-code-review
2015 msu-code-reviewc.titus.brown
 
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...PyData
 
Unit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUGUnit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUGegoodwintx
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDDAhmed Misbah
 
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!Lorenzo Barbieri
 

Similar to Europython 2015 Testmon (20)

Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
 
Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.Understanding TDD - theory, practice, techniques and tips.
Understanding TDD - theory, practice, techniques and tips.
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code clean
 
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.comAdvanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
 
Raising the Bar
Raising the BarRaising the Bar
Raising the Bar
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
Reduce Reuse Refactor
Reduce Reuse RefactorReduce Reuse Refactor
Reduce Reuse Refactor
 
Test-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate WorkplaceTest-Driven Development in the Corporate Workplace
Test-Driven Development in the Corporate Workplace
 
GDG Helwan Introduction to python
GDG Helwan Introduction to pythonGDG Helwan Introduction to python
GDG Helwan Introduction to python
 
Cleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven DevelopmentCleaner Code Through Test-Driven Development
Cleaner Code Through Test-Driven Development
 
ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"
ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"
ESEconf2011 - Guckenheimer Sam: "Agile in the Very Large"
 
2015 msu-code-review
2015 msu-code-review2015 msu-code-review
2015 msu-code-review
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
Do Your Homework! Writing tests for Data Science and Stochastic Code - David ...
 
Unit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUGUnit Testing in R with Testthat - HRUG
Unit Testing in R with Testthat - HRUG
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Introduction to TDD
Introduction to TDDIntroduction to TDD
Introduction to TDD
 
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
 

Europython 2015 Testmon