SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
TDD in Python

PyDayBo
Facoltà di Ingegneria
Università di Bologna
18 marzo 2010

Roberto Bettazzoni
roberto@bettazzoni.it
Test Driven Development

Agile practice
Prerequisites
●

Code refactoring

●

Incremental design

●

Test First Programming

●

Unit Test
Code Refactoring

“In software engineering, ‘refactoring’ source code
means improving it without changing its overall
results.”
Wikipedia: refactoring
Incremental Design

“Invest in the design of the system every day.”
Kent Beck, Extreme Programming Explained 2nd Ed. 2004
Test First Programming

“Write a failing automated test before changing any
code.”
Kent Beck, Extreme Programming Explained 2 nd Ed. 2004
Unit Test

White box test at code level
Test-Driven Development

Test First Programming
+ Code Refactoring
+ Incremental design
+ very short iterations (minutes)
The T.D.D. process
Add a test
Run tests
see new failure

Refactor

Write some code

Run tests
see all pass
DEMO
The legacy

expenses.py
Python script used by the employees when they
are abroad to collect the expenses
Expenses.py examples
> expenses.py reset
> expenses.py list
> expenses.py put lunch 28.00
> expenses.py put gasoline 50
> expenses.py put lunch 23.50
> expenses.py put hotel
85
> expenses.py get lunch
51.50
> expenses.py get lunch hotel
136.50
> expenses.py get
186.50
User Story

As an employee
I want to use my expenese program via web
so I can collect the expenses with a device
that does not support Python
Idea
Tasks
●

Create a web server

●

Create the HTML page (ask Peter)

●

Read the HTTP parameters

●

Test the legacy

●

●

Refactor the legacy to connect to the HTML
commands
Build the damn thing!
Agile Manifesto
We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:
Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan
That is, while there is value in the items on
the right, we value the items on the left more.
License agreement
●

●

At least part of the material used in this presentation has been
licensed as Creative Common, non-commercial, share-alike
content (http://creativecommons.org/licenses/by-nc-sa/3.0/de/deed.en)
from Roberto Bettazzoni.
As per the license agreement you are entitled to do whatever
you like to the material as far as is not contradicting basic
principle of the license. On top of that Roberto Bettazzoni kindly
asks you to return any change you will make to this material, for
validation and sharing purposes.

Weitere ähnliche Inhalte

Was ist angesagt?

Let's Git Together! - Hacktoberfest 2020
Let's Git Together! - Hacktoberfest 2020Let's Git Together! - Hacktoberfest 2020
Let's Git Together! - Hacktoberfest 2020EqraKhattak
 
Testing stage. being ahead business with cucumber
Testing stage. being ahead business with cucumberTesting stage. being ahead business with cucumber
Testing stage. being ahead business with cucumberAlex Mikitenko
 
Introduction to GraphQL with Ruby
Introduction to GraphQL with RubyIntroduction to GraphQL with Ruby
Introduction to GraphQL with RubyYen-Nan Lin
 
Angular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsAngular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsMartin Hochel
 
It's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecIt's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecGiulio De Donato
 
Standing out as a new grad candidate
Standing out as a new grad candidateStanding out as a new grad candidate
Standing out as a new grad candidateSashko Stubailo
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)Evan Lin
 
Source Control with Git & GitHub
 Source Control with Git & GitHub Source Control with Git & GitHub
Source Control with Git & GitHubRonny Orbach
 
Flutter beers and pizza
Flutter beers and pizzaFlutter beers and pizza
Flutter beers and pizzaJon Durán
 
Polymorphic meetup - can you teach your po to push cucumber gherkins to git
Polymorphic meetup - can you teach your po to push cucumber gherkins to gitPolymorphic meetup - can you teach your po to push cucumber gherkins to git
Polymorphic meetup - can you teach your po to push cucumber gherkins to gitArnaud Georgin
 
What's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie LermanWhat's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie LermanJulie Lerman
 
ATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot FrameworkATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot FrameworkAgile Testing Alliance
 
Git workflows (Basics)
Git workflows (Basics)Git workflows (Basics)
Git workflows (Basics)Roman Kuba
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for BeginnersRick Umali
 
Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategyKan-Han (John) Lu
 
Cool .NET tools, techniques and libraries
Cool .NET tools, techniques and librariesCool .NET tools, techniques and libraries
Cool .NET tools, techniques and librariesGreg Sohl
 

Was ist angesagt? (20)

Let's Git Together! - Hacktoberfest 2020
Let's Git Together! - Hacktoberfest 2020Let's Git Together! - Hacktoberfest 2020
Let's Git Together! - Hacktoberfest 2020
 
Php test fest
Php test festPhp test fest
Php test fest
 
Testing stage. being ahead business with cucumber
Testing stage. being ahead business with cucumberTesting stage. being ahead business with cucumber
Testing stage. being ahead business with cucumber
 
Introduction to GraphQL with Ruby
Introduction to GraphQL with RubyIntroduction to GraphQL with Ruby
Introduction to GraphQL with Ruby
 
Angular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular appsAngular Vienna - Use React tools for better Angular apps
Angular Vienna - Use React tools for better Angular apps
 
Brad wood -_whats_a_pull_request
Brad wood -_whats_a_pull_requestBrad wood -_whats_a_pull_request
Brad wood -_whats_a_pull_request
 
It's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspecIt's all about behaviour, also in php - phpspec
It's all about behaviour, also in php - phpspec
 
Standing out as a new grad candidate
Standing out as a new grad candidateStanding out as a new grad candidate
Standing out as a new grad candidate
 
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)iTHome Gopher Day 2017: What can Golang do?  (Using project 52 as examples)
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
 
Source Control with Git & GitHub
 Source Control with Git & GitHub Source Control with Git & GitHub
Source Control with Git & GitHub
 
Freelance web development
Freelance web developmentFreelance web development
Freelance web development
 
Flutter beers and pizza
Flutter beers and pizzaFlutter beers and pizza
Flutter beers and pizza
 
Polymorphic meetup - can you teach your po to push cucumber gherkins to git
Polymorphic meetup - can you teach your po to push cucumber gherkins to gitPolymorphic meetup - can you teach your po to push cucumber gherkins to git
Polymorphic meetup - can you teach your po to push cucumber gherkins to git
 
What's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie LermanWhat's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie Lerman
 
ATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot FrameworkATAGTR2017 Expanding test horizons with Robot Framework
ATAGTR2017 Expanding test horizons with Robot Framework
 
Henge
HengeHenge
Henge
 
Git workflows (Basics)
Git workflows (Basics)Git workflows (Basics)
Git workflows (Basics)
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for Beginners
 
Working process and git branch strategy
Working process and git branch strategyWorking process and git branch strategy
Working process and git branch strategy
 
Cool .NET tools, techniques and libraries
Cool .NET tools, techniques and librariesCool .NET tools, techniques and libraries
Cool .NET tools, techniques and libraries
 

Ähnlich wie Presentation TDD in Python

Bitcoin Development 2019 Starter Guide - No Skill | ProvenCrypto
Bitcoin Development 2019 Starter Guide - No Skill | ProvenCryptoBitcoin Development 2019 Starter Guide - No Skill | ProvenCrypto
Bitcoin Development 2019 Starter Guide - No Skill | ProvenCryptoOpti Network
 
An Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python DeveloperAn Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python DeveloperRishiVardhaniM
 
Github 101 An Adventurer's Guide To Open Source
Github 101   An Adventurer's Guide To Open SourceGithub 101   An Adventurer's Guide To Open Source
Github 101 An Adventurer's Guide To Open SourcePrachitibhukan
 
How to contribute to open source
How to contribute to open sourceHow to contribute to open source
How to contribute to open sourceAlbert Wong
 
Guide To Hiring Dedicated Python Developers In India.pdf
Guide To Hiring Dedicated Python Developers In India.pdfGuide To Hiring Dedicated Python Developers In India.pdf
Guide To Hiring Dedicated Python Developers In India.pdfAIS Technolabs Pvt Ltd
 
Contributing to Upstream Open Source Projects
Contributing to Upstream Open Source ProjectsContributing to Upstream Open Source Projects
Contributing to Upstream Open Source ProjectsScott Garman
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...VincitOy
 
How To Become An Excellent Software Engineer, by Lee Bob Black
How To Become An Excellent Software Engineer, by Lee Bob BlackHow To Become An Excellent Software Engineer, by Lee Bob Black
How To Become An Excellent Software Engineer, by Lee Bob BlackSkilledUp
 
GitHub Copilot.pptx
GitHub Copilot.pptxGitHub Copilot.pptx
GitHub Copilot.pptxLuis Beltran
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github ActionsKnoldus Inc.
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github ActionsKnoldus Inc.
 
GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!Orangescrum
 
Technical Seminar Series: GIT Pull Requests Best Practices
Technical Seminar Series:  GIT Pull Requests Best PracticesTechnical Seminar Series:  GIT Pull Requests Best Practices
Technical Seminar Series: GIT Pull Requests Best PracticesSingsys Pte Ltd
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016Søren Lund
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHubDSCVSSUT
 

Ähnlich wie Presentation TDD in Python (20)

Bitcoin Development 2019 Starter Guide - No Skill | ProvenCrypto
Bitcoin Development 2019 Starter Guide - No Skill | ProvenCryptoBitcoin Development 2019 Starter Guide - No Skill | ProvenCrypto
Bitcoin Development 2019 Starter Guide - No Skill | ProvenCrypto
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
An Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python DeveloperAn Ultimate Guide To Hire Python Developer
An Ultimate Guide To Hire Python Developer
 
Github 101 An Adventurer's Guide To Open Source
Github 101   An Adventurer's Guide To Open SourceGithub 101   An Adventurer's Guide To Open Source
Github 101 An Adventurer's Guide To Open Source
 
Git tech
Git techGit tech
Git tech
 
What is github.
What is github.What is github.
What is github.
 
How to contribute to open source
How to contribute to open sourceHow to contribute to open source
How to contribute to open source
 
DevOps Workshop Part 1
DevOps Workshop Part 1DevOps Workshop Part 1
DevOps Workshop Part 1
 
Guide To Hiring Dedicated Python Developers In India.pdf
Guide To Hiring Dedicated Python Developers In India.pdfGuide To Hiring Dedicated Python Developers In India.pdf
Guide To Hiring Dedicated Python Developers In India.pdf
 
Contributing to Upstream Open Source Projects
Contributing to Upstream Open Source ProjectsContributing to Upstream Open Source Projects
Contributing to Upstream Open Source Projects
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
 
How To Become An Excellent Software Engineer, by Lee Bob Black
How To Become An Excellent Software Engineer, by Lee Bob BlackHow To Become An Excellent Software Engineer, by Lee Bob Black
How To Become An Excellent Software Engineer, by Lee Bob Black
 
GitHub Copilot.pptx
GitHub Copilot.pptxGitHub Copilot.pptx
GitHub Copilot.pptx
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
 
Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
 
GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!
 
Get Git with It! A Developer's Workshop.pptx
Get Git with It! A Developer's Workshop.pptxGet Git with It! A Developer's Workshop.pptx
Get Git with It! A Developer's Workshop.pptx
 
Technical Seminar Series: GIT Pull Requests Best Practices
Technical Seminar Series:  GIT Pull Requests Best PracticesTechnical Seminar Series:  GIT Pull Requests Best Practices
Technical Seminar Series: GIT Pull Requests Best Practices
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
 

Mehr von Roberto Bettazzoni

Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup RemotoGiornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup RemotoRoberto Bettazzoni
 
Complexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test typesComplexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test typesRoberto Bettazzoni
 
Why you need to change your way of working
Why you need to change your way of workingWhy you need to change your way of working
Why you need to change your way of workingRoberto Bettazzoni
 
TDD Dojo - Test Driven Development Coding Dojo
TDD Dojo - Test Driven Development Coding DojoTDD Dojo - Test Driven Development Coding Dojo
TDD Dojo - Test Driven Development Coding DojoRoberto Bettazzoni
 
Presentation of agile engineering practices
Presentation of agile engineering practicesPresentation of agile engineering practices
Presentation of agile engineering practicesRoberto Bettazzoni
 
Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano) Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano) Roberto Bettazzoni
 
Pair programming and pair training
Pair programming and pair trainingPair programming and pair training
Pair programming and pair trainingRoberto Bettazzoni
 
Presentazione eXtreme Programming
Presentazione eXtreme ProgrammingPresentazione eXtreme Programming
Presentazione eXtreme ProgrammingRoberto Bettazzoni
 
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...Roberto Bettazzoni
 
Una fugace occhiata al Test Driven Development (2006)
Una fugace occhiata al Test Driven Development  (2006)Una fugace occhiata al Test Driven Development  (2006)
Una fugace occhiata al Test Driven Development (2006)Roberto Bettazzoni
 
Programmazione android per esseri umani
Programmazione android per esseri umaniProgrammazione android per esseri umani
Programmazione android per esseri umaniRoberto Bettazzoni
 
Useful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and KanbanUseful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and KanbanRoberto Bettazzoni
 

Mehr von Roberto Bettazzoni (17)

Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup RemotoGiornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
 
Complexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test typesComplexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test types
 
Why you need to change your way of working
Why you need to change your way of workingWhy you need to change your way of working
Why you need to change your way of working
 
TDD Dojo - Test Driven Development Coding Dojo
TDD Dojo - Test Driven Development Coding DojoTDD Dojo - Test Driven Development Coding Dojo
TDD Dojo - Test Driven Development Coding Dojo
 
Presentation of agile engineering practices
Presentation of agile engineering practicesPresentation of agile engineering practices
Presentation of agile engineering practices
 
Unit test in a nutshell
Unit test in a nutshellUnit test in a nutshell
Unit test in a nutshell
 
Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano) Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano)
 
Pair programming and pair training
Pair programming and pair trainingPair programming and pair training
Pair programming and pair training
 
Presentazione eXtreme Programming
Presentazione eXtreme ProgrammingPresentazione eXtreme Programming
Presentazione eXtreme Programming
 
Agile e Open Source
Agile e Open SourceAgile e Open Source
Agile e Open Source
 
Esempio di code kata
Esempio di code kataEsempio di code kata
Esempio di code kata
 
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
 
Una fugace occhiata al Test Driven Development (2006)
Una fugace occhiata al Test Driven Development  (2006)Una fugace occhiata al Test Driven Development  (2006)
Una fugace occhiata al Test Driven Development (2006)
 
Scrum in a nutshell
Scrum in a nutshellScrum in a nutshell
Scrum in a nutshell
 
The BDD live show (ITA)
The BDD live show (ITA)The BDD live show (ITA)
The BDD live show (ITA)
 
Programmazione android per esseri umani
Programmazione android per esseri umaniProgrammazione android per esseri umani
Programmazione android per esseri umani
 
Useful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and KanbanUseful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and Kanban
 

Kürzlich hochgeladen

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Presentation TDD in Python

  • 1. TDD in Python PyDayBo Facoltà di Ingegneria Università di Bologna 18 marzo 2010 Roberto Bettazzoni roberto@bettazzoni.it
  • 4. Code Refactoring “In software engineering, ‘refactoring’ source code means improving it without changing its overall results.” Wikipedia: refactoring
  • 5. Incremental Design “Invest in the design of the system every day.” Kent Beck, Extreme Programming Explained 2nd Ed. 2004
  • 6. Test First Programming “Write a failing automated test before changing any code.” Kent Beck, Extreme Programming Explained 2 nd Ed. 2004
  • 7. Unit Test White box test at code level
  • 8. Test-Driven Development Test First Programming + Code Refactoring + Incremental design + very short iterations (minutes)
  • 9. The T.D.D. process Add a test Run tests see new failure Refactor Write some code Run tests see all pass
  • 10. DEMO
  • 11. The legacy expenses.py Python script used by the employees when they are abroad to collect the expenses
  • 12. Expenses.py examples > expenses.py reset > expenses.py list > expenses.py put lunch 28.00 > expenses.py put gasoline 50 > expenses.py put lunch 23.50 > expenses.py put hotel 85 > expenses.py get lunch 51.50 > expenses.py get lunch hotel 136.50 > expenses.py get 186.50
  • 13. User Story As an employee I want to use my expenese program via web so I can collect the expenses with a device that does not support Python
  • 14. Idea
  • 15. Tasks ● Create a web server ● Create the HTML page (ask Peter) ● Read the HTTP parameters ● Test the legacy ● ● Refactor the legacy to connect to the HTML commands Build the damn thing!
  • 16. Agile Manifesto We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value: Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan That is, while there is value in the items on the right, we value the items on the left more.
  • 17. License agreement ● ● At least part of the material used in this presentation has been licensed as Creative Common, non-commercial, share-alike content (http://creativecommons.org/licenses/by-nc-sa/3.0/de/deed.en) from Roberto Bettazzoni. As per the license agreement you are entitled to do whatever you like to the material as far as is not contradicting basic principle of the license. On top of that Roberto Bettazzoni kindly asks you to return any change you will make to this material, for validation and sharing purposes.