How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by...

17
How Specification by Example and Test-Driven-Development Help to Avoid Technical Debt Wolfgang Trumler, Frances Paulisch Corporate Technology, Germany Siemens Corporate Technology Restricted © Siemens AG 2016

Transcript of How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by...

Page 1: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

How Specification by Exampleand Test-Driven-DevelopmentHelp to Avoid Technical Debt

Wolfgang Trumler,Frances Paulisch

Corporate Technology,Germany

Siemens Corporate TechnologyRestricted © Siemens AG 2016

Page 2: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 2 Corporate Technology

Can we avoid Technical Debt?

Page 3: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 3 Corporate Technology

NO!

Page 4: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 4 Corporate Technology

Do we want to avoid Technical Debt?

Page 5: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 5 Corporate Technology

It depends!

Page 6: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 6 Corporate Technology

Quadrants of Technical Debt by Martin Fowler

“We don't have time todiscuss the requirementsin such a detail.”

"What's that featureall about?"

Page 7: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 7 Corporate Technology

How technical debt is introduced

Page 8: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 8 Corporate Technology

How to address these issues

Specification by Example

Acceptance Tests

Unit Tests

Page 9: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 9 Corporate Technology

Specification by Example

Page 10: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 10 Corporate Technology

Specification by Example

Page 11: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 11 Corporate Technology

Acceptance Testing with Cucumber

Page 12: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 12 Corporate Technology

Unit Testing

Page 13: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 13 Corporate Technology

Addressing the Quadrants of Technical Debt

Specificationby Example

Acceptance &Unit Tests

Page 14: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 14 Corporate Technology

Defect Rate

Defects / 1k Lines of Code

http://www.mayerdan.com/ruby/2012/11/11/bugs-per-line-of-code-ratio

In-house testing (not completed yet)

• All reported: 7.42

• Related to our component: 4.64

In-house Testing Released Product

Industry Average 15 - 50

MicrosoftApplications 10 – 20 0.5

Cleanroomdevelopment 3 0.1

Page 15: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 18 Corporate Technology

The Role of the Architect

RefactorDesignUp-frontDesign

Page 16: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Restricted © Siemens AG 2016October 2016Page 19 Corporate Technology

Summary

We applied• Specification by Example• Acceptance and extensive Unit Testingto avoid technical debt in late phases of the project

Used Defect Rate as performance indicator

Methodology mix worked well for us (very low Defect Rate)

Planning to roll-out on broader scale

Page 17: How 'Specification by Example' and Test-Driven Development …€¦ · How "Specification by Example" and Test-Driven Development Help to Avoid Technical Debt Author: Wolfgang Trumler

Thank you!

Wolfgang TrumlerFrances Paulish

Corporate TechnologyGermany

Thank you