Tim Cooke

Review: Your Code as a Crime Scene

Cover art for Your Code as a Crime Scene book

The Book

AuthorAdam Tornhill

Published24th March 2015

PublisherThe Pragmatic Bookshelf

Book Websitepragprog.com/book/atcrime

Author Websitewww.adamtornhill.com

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!

The Review

Date1st November 2015

Rating10/10

'Your Code as a Crime Scene' is aimed at intermediate to advanced Engineers who want to get more from their source repository history than simply who did what and when. As a developer who falls into that category I found it a fascinating read and left me itching to hunt out the criminals in my own applications.

Adam shows how to analyse your change history in new and interesting ways that allow you to uncover your code's dirty little secrets. Files that always change together identify unnecessary coupling. Files with large indentations uncover complex branching. Files that consistently grow on each change point to possible code dumping grounds. Plus a number of scenarios that I hadn't previously considered as problem areas.

The author has also written a powerful suite of tools called code-maat, available for free, which allow you to follow along and practice with the plentiful examples and get stuck in with analysing your own source history. This is a real strength of the book as it becomes of real practical use almost immediately. This 'learn by doing' approach is very valuable. Recommendations to improve each of the problem areas are presented and discussed in a pragmatic manner.

There are very few books that cover this topic and this is a welcome addition to my library. Having a good catalogue of scientific analysis techniques such as these for interrogating your source code takes a good deal of the 'artwork' out of finding problem hot spots. Highly recommended.


Disclosure: I received a copy of this book from the publisher in exchange for writing this review on behalf of CodeRanch.