Your Code as a Crime Scene: Use Forensic Techniques to Arrest Defects, Bottlenecks, and Bad Design in Your Programs (The Pragmatic Programmers)
Format: PDF / Kindle (mobi) / ePub
Jack the Ripper and legacy codebases have more in common than you'd think. Inspired by forensic psychology methods, you'll learn strategies to predict the future of your codebase, assess refactoring direction, and understand how your team influences the design. With its unique blend of forensic psychology and code analysis, this book arms you with the strategies you need, no matter what programming language you use.
Software is a living entity that's constantly changing. To understand software systems, we need to know where they came from and how they evolved. By mining commit data and analyzing the history of your code, you can start fixes ahead of time to eliminate broken designs, maintenance issues, and team productivity bottlenecks.
In this book, you'll learn forensic psychology techniques to successfully maintain your software. You'll create a geographic profile from your commit data to find hotspots, and apply temporal coupling concepts to uncover hidden relationships between unrelated areas in your code. You'll also measure the effectiveness of your code improvements. You'll learn how to apply these techniques on projects both large and small. For small projects, you'll get new insights into your design and how well the code fits your ideas. For large projects, you'll identify the good and the fragile parts.
Large-scale development is also a social activity, and the team's dynamics influence code quality. That's why this book shows you how to uncover social biases when analyzing the evolution of your system. You'll use commit messages as eyewitness accounts to what is really happening in your code. Finally, you'll put it all together by tracking organizational problems in the code and finding out how to fix them. Come join the hunt for better code!
What You Need:
You need Java 6 and Python 2.7 to run the accompanying analysis tools. You also need Git to follow along with the examples.
is, its health from both a technical perspective and from the development practices that led to the code you see today. You’ll also be able to track the improvements made to the code and gather objective data on them. About This Book There are plenty of good books on software design for programmers. So why read another one? Well, unlike other books, Your Code as a Crime Scene focuses on your codebase. This book will help you identify potential problems in your code, find ways to improve it, and
increased the opacity of the building’s color every time it changed. As the hotspot cooled down, I decreased the opacity. Looking long enough at this animation could drive you crazy, but you would spot some patterns. In the following figure, I highlight two patterns showing how modules are changing. report erratum • discuss Use Temporal Coupling to Reduce Bias • 75 • Explicit coupling: git.clj and git_test.clj tend to change together. This is hardly surprising since the latter is a unit test
investigate why. Check Out the Evolution Radar In a large codebase, a temporal coupling analysis sparks an explosion of data. Code Maat resolves that by allowing us to specify optional thresholds. The research tool Evolution Radar1 takes a different approach and lets us zoom in and out to the level of detail we’re interested in. So check out the tool and take inspiration. Investigate Temporal Couples Once we make such a finding, we need to drill down into the code. Because all changes are
system. One typical action is to rearrange the teams according to communication needs. Because those needs will change over the course of a longer project, you probably need to revisit these topics at regular intervals. Done right, such a rebalancing of project teams has been found to minimize communication overhead. (See The Effect of Communication Overhead on Software Maintenance Project Staffing [DHAQ07].) This is what happened on the project I told you about at the beginning of the chapter.
--after flag, 26 Agile, maintenance and understanding, 3 Alexander, Christopher, 116 aliases, developer, 144 “An Empirical Study on the Impact of Duplicate Code”, 22 “Animated Visualization of Software History Using Evolution Storyboards”, 89 anonymity and group size, 134 Applications of Geographical Offender Profiling, 82 architecture, see also design analyzing by beauty, 105–118, 176 analyzing layers, 111–116 automated tests, 91–103 avoiding surprises, 108– 111 consistency, 98 defining