Software Design X-Rays
Fix Technical Debt with Behavioral Code Analysis
by Adam Tornhill
Version: P1.0 (March 2018)
Copyright 2018 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/frequently-asked-questions/ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/atevol, the book's homepage.
Thanks for your continued support,
Andy Hunt
The Pragmatic Programmers
The team that produced this book includes: Andy Hunt (Publisher) Janet Furlow (VP of Operations) Brian MacDonald (Managing Editor) Jacquelyn Carter (Supervising Editor) Adaobi Obi Tulton (Development Editor) Candace Cunningham (Copy Editor) Potomac Indexing, LLC (Indexing) Gilson Graphics (Layout)
For customer support, please contact .
For international rights, please contact .
Table of Contents
Copyright 2018, The Pragmatic Bookshelf.
Early praise for Software Design X-Rays
Adam has made one of the most significant contributions to software engineering over the past years. Listen and ye shall learn.
John Lewis |
Consultant and Troubleshooter |
Adam successfully teaches me why things are the way I have learned that they are during my 30 years in the software-development world. As if that wasnt enough, he also teaches me a whole slew of things I didnt know about! This is a must-read!
Jimmy Nilsson |
Author of Applying Domain-Driven Design and Patterns |
I felt my brain was exploding with ideas and aha s all the way through my reading.
Giovanni Asproni |
Principal Consultant |
Adam encapsulates the challenges of a technical lead for a product in a large shared codebase. His social code-analysis techniques turn a dry static codebase into a living, breathing ecosystem and chart its interactions over its lifetime, helping you to identify those areas worth refactoring.
Ivan Houston |
Principal Software Engineer |
Adam takes you behind the scenes of pragmatic software analysis. Hes bridging the gap between algorithms for mining software repositories and performing refactorings based on the gained insights. Definitely the right way to go in our industry!
Markus Harrer |
Software Development Analyst |
Software systems age and erode like any other human-made structure. Software Design X-Rays provides immediately useable tools and approaches to spot the parts in most dire need of improvement and helps you manage your technical debt. Adam does a great job at explaining that this seemingly complex analysis is actually not that hard and that you can do it right now.
Michael Hunger |
Head of Developer Relations Engineering, Neo4j |
This book offers plenty of valuable psychological insights that are likely to surprise developers and managers alike. Tornhills ability to apply heuristics like the concept of surprise to complex code systems reinforces the human element of software development and connects code to emotion.
Lauri Apple |
Open Source Evangelist and Agile Coach, Zalando |
An invaluable set of techniques to get a better understanding of your code, your team and your company.
Vicen Garca Alts |
IT Consultant, Craft Foster Ltd. |
Acknowledgments
Writing a book is a lot like programming in the sense that its an iterative process where most of the work is rework. Since Software Design X-Rays is my fourth book I sort of knew the effort and time it would take. Or at least I thought I did, as it turned out to be so much harder than I initially expected. (Again a bit like programming, isnt it?) At the end it was worth every minute and Im really proud of the book youre reading right now. That wouldnt have been possible without all the wonderful people who helped me make this book much better than what I could have done on my own.
Id like to thank The Pragmatic Bookshelf for this opportunity. I also want to thank my editor, Adaobi Obi Tulton, for all her support, motivation, and great work in shaping the book.
Several people volunteered their time and expertise by reading early drafts of the book: Jimmy Nilsson, Giovanni Asproni, Ivan Houston, Markus Harrer, Michael Hunger, Lauri Apple, Per Rovegrd, Joseph Fahey, Louis Hansen, Vicen Garca Alts, Nascif Abousalh-Neto, Clare Macrae, Michael Keeling, Alberto Fernandez Reyes, Javier Collado, and Ian Sleigh. Thanks for all your helpful advice and constructive criticism.