SlideShare a Scribd company logo
1
So you "want" to maintain a
Python legacy code base
PyConUK 2016
César Cardenas Desales
2
About me
● Software Architect at Webrepublic AG
● Python user since v.2.0
● Co-organizer of the Swiss Python Summit (i.e.
PyCon Switzerland) and the Zurich Python User
Group
3
Agenda
❖ Introduction
❖ Maintenance “framework”
1. Understand (your system)
2. Safety net
3. Improve
4
Introduction
5
Why discuss maintenance?
● 50% software cost - Barry
Boehm
● 40 to 80% software costs -
Robert L. Glass
6
Computer programming
7
Software maintenance
8
9
Software maintenance?
10
11
Automotive Industry
● Warranty? 5 years or 100,000 KM
● Life-time: 100,000 to 200,000 KM
12
Rail Industry
● Short cycle maintenance: 80 years
13
Rail Industry
● Short cycle maintenance: 80 years
● Long cycle maintenance: 150 years
14
IT Industry?
● Linux kernel: 1991, 25 years
● LaTeX: 1985, 31 years
● U.S. Treasury Department - Individual Master File: 56
years
15
IT Industry?
● Linux kernel: 1991, 25 years
● LaTeX: 1985, 31 years
● U.S. Treasury Department - Individual Master File: 56
years
● Probably many Fortran or Cobol systems
COBOL programmer wanted
- 5 years experience life expectancy
16
IT Industry?
● Linux kernel: 1991, 25 years
● LaTeX: 1985, 31 years
● U.S. Treasury Department - Individual Master File: 56
years
● Probably many Fortran or Cobol systems
● Mine WAS 4 years
● Yours?
17
Maintenance: Raffle of a Tiger
18
The life of a maintainer (i.e. me)
1. “Our code is messy”
2. “Everyone’s code is messy” (3k LOC class)
3. “Somebody’s code is messy”
19
1 Understand
20
1 Understand - Context
● Code doesn’t live in a
void
● Ask users
● THE business case
● Interview power users
● Create personas
● Read use cases
● Write use cases
21
1 Understand - Architecture
● Understand the
architecture
● Create diagrams
22
1 Understand - Architecture
● Print critical code
● Read the code
● Do code walkthroughs
● Rubber duck debugging
23
1 Understand - Docs
● Read the docs
● Write the docs
● Comment the code
● Docstrings
● Doxygen
● Sphingx
24
1 Understand - Debug it
● Observe program behaviour
● For the sake of it
● pdb
● pudb
● ipdb
● Bugjar
● Winpdb
● Your IDE
25
1 Understand - Profile it
● Does 80/20 hold?
● cProfile, profile
● timeit
● heapy
● memory_profiler
● Your IDE
● top, htop
● IPython SnakeViz
26
1 Understand - Break it
● Scalability?
● What breaks?
● Why does it break?
● Does it matter?
● Recovery?
● nose, pytest
● Apache Benchmark
● Locust
● JMeter
● Adhoc scripts
27
2 Safety net
28
2 Safety net - Automated tests
● Regression tests
● Acceptance tests
● Data driven tests
● nose, pytest
● coverage
● selenium
● tox
29
2 Safety net - Fail often and early
● Neutral/Nightly build
● Continuous Integration
● Broken build =>
Not safe to release
30
2 Safety net - The build
● Github protected branches
● Jenkins
● Buildout
● Buildbot
● Travis CI
31
2 Safety net - Monitoring
● What errors are current?
● Opbeat
32
2 Safety net - Monitoring
● Visualize and filter log entries
● Logstash + Kibana
33
2 Safety net - Automate it all
● Because humans make
mistakes
● Provisioning deployment
● Ansible
● Salt
● Puppet
● Chef
34
3 Improve
35
3 Improve - The code
● Leave the code cleaner than you found it
● pep8 -> pycodestyle
● Flake8 (PyFlakes + pycodestyle)
● pylint
● radon
● Your IDE
36
3 Improve - The code
● Radon
○ LOC, SLOC
○ Cyclomatic Complexity
○ Maintainability Index
○ Halstead Metrics
37
38
3 Improve - The code
$ radon cc -o SCORE -s -a processing/tasks.py
39
3 Improve - The code
$ pylint bot.py
40
3 Improve - The people
● TDD if possible
● Do Code Reviews
41
3 Improve - The people
● Code Reviews
○ Spread knowledge
○ The Ego Factor
○ Increase quality of software
“Your reputation at stake
with every commit”
42
3 Improve - The people
● Code Reviews
○ Easily done with Github
○ Like washing your hands
after going to the toilet
43
Ask me
● Ascend a Swiss
(Python) summit
● Why can you buy
cornish pasties in
Mexico
44
Let’s make it happen.
Thank you.
@ccdesales

More Related Content

What's hot

Jenkins - Beyond Basics
Jenkins - Beyond BasicsJenkins - Beyond Basics
Jenkins - Beyond Basics
Knoldus Inc.
 
Ctf cli
Ctf cliCtf cli
ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...
ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...
ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...
OW2
 
BUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open SourceBUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open Source
Linaro
 
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
PROIDEA
 
Software Delivery in 2016 - A Continuous Delivery Approach
Software Delivery in 2016 - A Continuous Delivery ApproachSoftware Delivery in 2016 - A Continuous Delivery Approach
Software Delivery in 2016 - A Continuous Delivery Approach
Giovanni Toraldo
 
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
Linaro
 
Introduction to Open Source
Introduction to Open SourceIntroduction to Open Source
Introduction to Open Source
Gluster.org
 
Intro JBug Milano - January 2012
Intro JBug Milano - January 2012Intro JBug Milano - January 2012
Intro JBug Milano - January 2012
JBug Italy
 
Responsibilities of gluster_maintainers
Responsibilities of gluster_maintainersResponsibilities of gluster_maintainers
Responsibilities of gluster_maintainers
Gluster.org
 

What's hot (10)

Jenkins - Beyond Basics
Jenkins - Beyond BasicsJenkins - Beyond Basics
Jenkins - Beyond Basics
 
Ctf cli
Ctf cliCtf cli
Ctf cli
 
ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...
ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...
ETICS supporting compliance and interoperability, Gabriele Giammatteo, Engine...
 
BUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open SourceBUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open Source
 
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
[CONFidence 2016] Sławomir Kosowski - Introduction to iOS Application Securit...
 
Software Delivery in 2016 - A Continuous Delivery Approach
Software Delivery in 2016 - A Continuous Delivery ApproachSoftware Delivery in 2016 - A Continuous Delivery Approach
Software Delivery in 2016 - A Continuous Delivery Approach
 
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
 
Introduction to Open Source
Introduction to Open SourceIntroduction to Open Source
Introduction to Open Source
 
Intro JBug Milano - January 2012
Intro JBug Milano - January 2012Intro JBug Milano - January 2012
Intro JBug Milano - January 2012
 
Responsibilities of gluster_maintainers
Responsibilities of gluster_maintainersResponsibilities of gluster_maintainers
Responsibilities of gluster_maintainers
 

Similar to Software maintenance PyConUK 2016

Software maintenance PyConPL 2016
Software maintenance PyConPL 2016Software maintenance PyConPL 2016
Software maintenance PyConPL 2016
Cesar Cardenas Desales
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
Julien Dubois
 
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
Puppet
 
Python Linters at Scale.pdf
Python Linters at Scale.pdfPython Linters at Scale.pdf
Python Linters at Scale.pdf
Jimmy Lai
 
Android best practices 2015
Android best practices 2015Android best practices 2015
Android best practices 2015
Sean Katz
 
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
Jay Bryant
 
Using protocol analyzer on mikrotik
Using protocol analyzer on mikrotikUsing protocol analyzer on mikrotik
Using protocol analyzer on mikrotik
Achmad Mardiansyah
 
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
Jay Bryant
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSes
Mender.io
 
Scaling xtext
Scaling xtextScaling xtext
Scaling xtext
Lieven Lemiengre
 
In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...
In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...
In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...
Agustin Benito Bethencourt
 
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Jay Bryant
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
OW2
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDoku
 
CHIPS Alliance_Object Automation Inc_workshop
CHIPS Alliance_Object Automation Inc_workshopCHIPS Alliance_Object Automation Inc_workshop
CHIPS Alliance_Object Automation Inc_workshop
Object Automation
 
Headless Android at AnDevCon3
Headless Android at AnDevCon3Headless Android at AnDevCon3
Headless Android at AnDevCon3
Opersys inc.
 
Building a Small Datacenter
Building a Small DatacenterBuilding a Small Datacenter
Building a Small Datacenter
ssuser4b98f0
 
Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)
Jay Bryant
 
Building a Small DC
Building a Small DCBuilding a Small DC
Building a Small DC
APNIC
 
Angular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entrepriseAngular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entreprise
LINAGORA
 

Similar to Software maintenance PyConUK 2016 (20)

Software maintenance PyConPL 2016
Software maintenance PyConPL 2016Software maintenance PyConPL 2016
Software maintenance PyConPL 2016
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
PuppetConf 2016: Why Network Automation Matters, and What You Can Do About It...
 
Python Linters at Scale.pdf
Python Linters at Scale.pdfPython Linters at Scale.pdf
Python Linters at Scale.pdf
 
Android best practices 2015
Android best practices 2015Android best practices 2015
Android best practices 2015
 
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
 
Using protocol analyzer on mikrotik
Using protocol analyzer on mikrotikUsing protocol analyzer on mikrotik
Using protocol analyzer on mikrotik
 
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSes
 
Scaling xtext
Scaling xtextScaling xtext
Scaling xtext
 
In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...
In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...
In Need For A Linux Kernel Maintained For A Very Long Time? CIP Linux Kernel ...
 
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
 
CHIPS Alliance_Object Automation Inc_workshop
CHIPS Alliance_Object Automation Inc_workshopCHIPS Alliance_Object Automation Inc_workshop
CHIPS Alliance_Object Automation Inc_workshop
 
Headless Android at AnDevCon3
Headless Android at AnDevCon3Headless Android at AnDevCon3
Headless Android at AnDevCon3
 
Building a Small Datacenter
Building a Small DatacenterBuilding a Small Datacenter
Building a Small Datacenter
 
Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)
 
Building a Small DC
Building a Small DCBuilding a Small DC
Building a Small DC
 
Angular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entrepriseAngular v2 et plus : le futur du développement d'applications en entreprise
Angular v2 et plus : le futur du développement d'applications en entreprise
 

More from Cesar Cardenas Desales

PyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsPyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
Migrate to Python 3 using the six library
Migrate to Python 3 using the six libraryMigrate to Python 3 using the six library
Migrate to Python 3 using the six library
Cesar Cardenas Desales
 
PyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsPyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applications
Cesar Cardenas Desales
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applications
Cesar Cardenas Desales
 
Scalable Web applications with Elastic Beanstalk as your PAAS: a primer
Scalable Web applications with Elastic Beanstalk as your PAAS: a primerScalable Web applications with Elastic Beanstalk as your PAAS: a primer
Scalable Web applications with Elastic Beanstalk as your PAAS: a primer
Cesar Cardenas Desales
 
Unit Testing with Nose
Unit Testing with NoseUnit Testing with Nose
Unit Testing with Nose
Cesar Cardenas Desales
 
Distributed Task Processing with Celery - PyZH
Distributed Task Processing with Celery - PyZHDistributed Task Processing with Celery - PyZH
Distributed Task Processing with Celery - PyZH
Cesar Cardenas Desales
 
Code Reviews in Python - PyZh
Code Reviews in Python - PyZhCode Reviews in Python - PyZh
Code Reviews in Python - PyZh
Cesar Cardenas Desales
 

More from Cesar Cardenas Desales (8)

PyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsPyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applications
 
Migrate to Python 3 using the six library
Migrate to Python 3 using the six libraryMigrate to Python 3 using the six library
Migrate to Python 3 using the six library
 
PyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsPyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applications
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applications
 
Scalable Web applications with Elastic Beanstalk as your PAAS: a primer
Scalable Web applications with Elastic Beanstalk as your PAAS: a primerScalable Web applications with Elastic Beanstalk as your PAAS: a primer
Scalable Web applications with Elastic Beanstalk as your PAAS: a primer
 
Unit Testing with Nose
Unit Testing with NoseUnit Testing with Nose
Unit Testing with Nose
 
Distributed Task Processing with Celery - PyZH
Distributed Task Processing with Celery - PyZHDistributed Task Processing with Celery - PyZH
Distributed Task Processing with Celery - PyZH
 
Code Reviews in Python - PyZh
Code Reviews in Python - PyZhCode Reviews in Python - PyZh
Code Reviews in Python - PyZh
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

Software maintenance PyConUK 2016

  • 1. 1 So you "want" to maintain a Python legacy code base PyConUK 2016 César Cardenas Desales
  • 2. 2 About me ● Software Architect at Webrepublic AG ● Python user since v.2.0 ● Co-organizer of the Swiss Python Summit (i.e. PyCon Switzerland) and the Zurich Python User Group
  • 3. 3 Agenda ❖ Introduction ❖ Maintenance “framework” 1. Understand (your system) 2. Safety net 3. Improve
  • 5. 5 Why discuss maintenance? ● 50% software cost - Barry Boehm ● 40 to 80% software costs - Robert L. Glass
  • 8. 8
  • 10. 10
  • 11. 11 Automotive Industry ● Warranty? 5 years or 100,000 KM ● Life-time: 100,000 to 200,000 KM
  • 12. 12 Rail Industry ● Short cycle maintenance: 80 years
  • 13. 13 Rail Industry ● Short cycle maintenance: 80 years ● Long cycle maintenance: 150 years
  • 14. 14 IT Industry? ● Linux kernel: 1991, 25 years ● LaTeX: 1985, 31 years ● U.S. Treasury Department - Individual Master File: 56 years
  • 15. 15 IT Industry? ● Linux kernel: 1991, 25 years ● LaTeX: 1985, 31 years ● U.S. Treasury Department - Individual Master File: 56 years ● Probably many Fortran or Cobol systems COBOL programmer wanted - 5 years experience life expectancy
  • 16. 16 IT Industry? ● Linux kernel: 1991, 25 years ● LaTeX: 1985, 31 years ● U.S. Treasury Department - Individual Master File: 56 years ● Probably many Fortran or Cobol systems ● Mine WAS 4 years ● Yours?
  • 18. 18 The life of a maintainer (i.e. me) 1. “Our code is messy” 2. “Everyone’s code is messy” (3k LOC class) 3. “Somebody’s code is messy”
  • 20. 20 1 Understand - Context ● Code doesn’t live in a void ● Ask users ● THE business case ● Interview power users ● Create personas ● Read use cases ● Write use cases
  • 21. 21 1 Understand - Architecture ● Understand the architecture ● Create diagrams
  • 22. 22 1 Understand - Architecture ● Print critical code ● Read the code ● Do code walkthroughs ● Rubber duck debugging
  • 23. 23 1 Understand - Docs ● Read the docs ● Write the docs ● Comment the code ● Docstrings ● Doxygen ● Sphingx
  • 24. 24 1 Understand - Debug it ● Observe program behaviour ● For the sake of it ● pdb ● pudb ● ipdb ● Bugjar ● Winpdb ● Your IDE
  • 25. 25 1 Understand - Profile it ● Does 80/20 hold? ● cProfile, profile ● timeit ● heapy ● memory_profiler ● Your IDE ● top, htop ● IPython SnakeViz
  • 26. 26 1 Understand - Break it ● Scalability? ● What breaks? ● Why does it break? ● Does it matter? ● Recovery? ● nose, pytest ● Apache Benchmark ● Locust ● JMeter ● Adhoc scripts
  • 28. 28 2 Safety net - Automated tests ● Regression tests ● Acceptance tests ● Data driven tests ● nose, pytest ● coverage ● selenium ● tox
  • 29. 29 2 Safety net - Fail often and early ● Neutral/Nightly build ● Continuous Integration ● Broken build => Not safe to release
  • 30. 30 2 Safety net - The build ● Github protected branches ● Jenkins ● Buildout ● Buildbot ● Travis CI
  • 31. 31 2 Safety net - Monitoring ● What errors are current? ● Opbeat
  • 32. 32 2 Safety net - Monitoring ● Visualize and filter log entries ● Logstash + Kibana
  • 33. 33 2 Safety net - Automate it all ● Because humans make mistakes ● Provisioning deployment ● Ansible ● Salt ● Puppet ● Chef
  • 35. 35 3 Improve - The code ● Leave the code cleaner than you found it ● pep8 -> pycodestyle ● Flake8 (PyFlakes + pycodestyle) ● pylint ● radon ● Your IDE
  • 36. 36 3 Improve - The code ● Radon ○ LOC, SLOC ○ Cyclomatic Complexity ○ Maintainability Index ○ Halstead Metrics
  • 37. 37
  • 38. 38 3 Improve - The code $ radon cc -o SCORE -s -a processing/tasks.py
  • 39. 39 3 Improve - The code $ pylint bot.py
  • 40. 40 3 Improve - The people ● TDD if possible ● Do Code Reviews
  • 41. 41 3 Improve - The people ● Code Reviews ○ Spread knowledge ○ The Ego Factor ○ Increase quality of software “Your reputation at stake with every commit”
  • 42. 42 3 Improve - The people ● Code Reviews ○ Easily done with Github ○ Like washing your hands after going to the toilet
  • 43. 43 Ask me ● Ascend a Swiss (Python) summit ● Why can you buy cornish pasties in Mexico
  • 44. 44 Let’s make it happen. Thank you. @ccdesales