Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows with Prime
Try Prime
and start saving today with fast, free delivery
Amazon Prime includes:
Fast, FREE Delivery is available to Prime members. To join, select "Try Amazon Prime and start saving today with Fast, FREE Delivery" below the Add to Cart button.
Amazon Prime members enjoy:- Cardmembers earn 5% Back at Amazon.com with a Prime Credit Card.
- Unlimited Free Two-Day Delivery
- Instant streaming of thousands of movies and TV episodes with Prime Video
- A Kindle book to borrow for free each month - with no due dates
- Listen to over 2 million songs and hundreds of playlists
- Unlimited photo storage with anywhere access
Important: Your credit card will NOT be charged when you start your free trial or if you cancel during the trial period. If you're happy with Amazon Prime, do nothing. At the end of the free trial, your membership will automatically upgrade to a monthly membership.
Buy new:
$31.49$31.49
FREE delivery: Friday, Dec 15 on orders over $35.00 shipped by Amazon.
Ships from
Amazon.com
Sold by
Amazon.com
Returns
Returnable until Jan 31, 2024
Payment
Secure transaction
Buy used: $19.19
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Your Code as a Crime Scene: Use Forensic Techniques to Arrest Defects, Bottlenecks, and Bad Design in Your Programs (The Pragmatic Programmers) 1st Edition
| Price | New from | Used from |
- Kindle
$23.49 Read with our free app - Paperback
$19.19 - $31.4912 Used from $18.98 25 New from $25.95
Purchase options and add-ons
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.
- ISBN-101680500384
- ISBN-13978-1680500387
- Edition1st
- PublisherPragmatic Bookshelf
- Publication date
2015
May 5
- Language
EN
English
- Dimensions
7.5 x 0.5 x 9.3
inches
- Length
220
Pages
Frequently bought together

Similar items that may ship from close to you
From the brand
-
The Pragmatic Programmers publishes hands-on, practical books on classic and cutting-edge software development and engineering management topics. We help professionals solve real-world problems, hone their skills, and advance their careers.
-
From the Publisher
Q&A with Adam Tornhill, author of Your Code As a Crime Scene
How did you come up with the metaphor of the source code being a crime scene?
Well, I was in the middle of my psychology studies when I joined a course in forensics. At the same time, I was working full-time as a software developer fighting some scary large-scale legacy systems on a regular basis. The main challenge there is always to know which parts of the codebase really matter.
Which parts of the code become productivity bottlenecks? Which parts are hard to maintain? Where will the bugs be?
As I got into forensics, I realized that crime investigators face similar open-ended, large-scale problems that we do. And modern forensic psychologists attack these problems with methods useful to us software developers too. I decided to explore this connection and find out how we can apply it to code.
What are some of the forensics concepts we will learn about in this book?
The eye-opener to me, and the technique we'll use as a metaphor to reason about code, is geographical offender profiling. A geographical offender profile uses the spatial movement of criminals to identify their home bases. It works by calculating a probability surface and projecting it onto a real-word geography. So, I thought, what if we could do the same for software?
In our case the offender is code. So we learn techniques to identify patterns in the evolution of your code, how you've worked with it so far. That gives you the power to predict its future, to find the code that's hard to evolve and prone to defects - our offenders.
It's not only about complex code - complexity only matters if we need to deal with it. That's why it's important to identify the overlap between complicated code that we also have to work with often. It's a simple technique that works surprisingly well in practice. Of course we'll also support it with findings from empirical software research - what you learn is not just opinions but based on practices that have been shown to work on real-world projects.
Large-scale software development is also a social activity. That means it's prone to the same social biases that we fall for in everyday life. So here we'll look into some forensic cases gone wrong, learn from their mistakes, and apply our new knowledge to reason about teamwork, organizations, and software architectures.
I don't have a background in psychology. Will I be able to follow along?
I've made sure to explain the concepts we meet. Psychology matters to us since our primary tool as developers isn't the computer - it's our brain - and psychology is about how we function. It's about how we learn, solve problems, reason, and work with others. All these areas relate to our everyday development activities.
Tell me more about Code Maat.
The analysis techniques are based on version-control data. As such, you'll learn to mine data from your source code repositories and find interesting patterns in the evolution of your code. Code Maat is just a tool to automate the boring parts of that process.
In fact, I open-sourced Code Maat as a quick-start to put the techniques you learn about in the book into practice. We'll also use the source code of Code Maat for some case studies. The only reason for that is because it feels better to rip my own design decisions into shreds rather than criticizing the work of others where I don't share the original context.
That said, we'll investigate several other codebases as well so that we get a feel for how the different techniques complement each other. Out of all that, the tool itself is the least important part.
Can I use other tools instead of Code Maat to work with this book?
I'm pretty sure that these techniques will become mainstream in a few years - the information we can mine from our source code repositories is just too useful to be ignored. When that happens, you'll have several tools to chose from (both commercial and free).
But until that happens, I'd recommend that you tailor the tools to your specific needs. The algorithms aren't that hard to implement and we cover them all in the book. In addition, it's easy to build more elaborate tools on top of Code Maat. Code Maat generates CSV output that's straightforward to post-process and visualize in any way you chose.
Finally, there are other good options. I know that Michael Feathers, who wrote the foreword to the book, has open-sourced the tool he uses to analyze Ruby code repositories. There's also the Moose project, which provides an open platform to build your own custom analyses.
|
|
|---|---|
| Software Design X-Rays | |
| Also by Adam Tornhill | Fix Technical Debt with Behavioral Code Analysis |
Editorial Reviews
About the Author
Product details
- Publisher : Pragmatic Bookshelf; 1st edition (May 5, 2015)
- Language : English
- Paperback : 220 pages
- ISBN-10 : 1680500384
- ISBN-13 : 978-1680500387
- Item Weight : 14.5 ounces
- Dimensions : 7.5 x 0.46 x 9.25 inches
- Best Sellers Rank: #591,146 in Books (See Top 100 in Books)
- #168 in Software Testing
- #193 in Computer Systems Analysis & Design (Books)
- #622 in Software Development (Books)
- Customer Reviews:
Important information
To report an issue with this product, click here.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The book's beauty stems from the fact that software engineers can always do better, and that it is crucial to utilize the metadata surrounding the software development process, both statically, as well as temporally. Once you internalize this mindset, and start to look at the systems at a high level, you realize that there's still a lot of work to be done to enhance the practice of software development.
One of the good aspects of the book is that the analyses described by the author are mostly independent of programming languages and paradigms: the code repositories analyzed range from C# projects to the ones in Java, Scala, and Clojure. Therefore, you can make use of the book if you work with object oriented technologies, or are a functional programming aficionado. Another good point: the examined source code repositories are high profile open source projects such as Hibernate, and Scala. This means you can easily perform similar analyses yourself on the most recent version of those projects, and since they are popular ones, you either know about them, or used them heavily in your projects.
If I had to summarize the book, I'd say the gist of it is: find the hotspots in your project, check if they are problematic, and focus on temporal coupling for proactive handling of complexity that is to reveal itself soon. The author starts from these simple premises, and proceed to show how they can be applied in detail to many different code bases, using the tools he developed and applied to the revision control system data such as Git logs. The set of analyses that can be done, and the insights that straightforward visualizations can lead to are impressive!
You might have noticed that I didn't touch on the author's use of concepts from criminal psychology: that's because I think contrary to what the title might imply, this book is much more about the scientific analysis of software product and process artifacts in the service of higher quality engineering, rather than analyzing sofware from the perspective of criminal psychology. Of course, the author's background in psychology and cognitive science, in addition to his engineering experience, is the reason this book is probably in a category of its own, but still, most of the anecdotes, even though interesting in themselves, can be considered tangential to the main topics of the book.
The book finishes by noting this is not the end of the story, showing we need more tools to utilize the metadata such as building code recommenders by doing statistical analysis on your code base (and I'd add even other code bases!), integrating dynamic information about the code, utilizing even more detailed data such as in-commit changes that your development tools can record, and other advanced features to be implemented as concrete technologies. Some of them, such as code recommenders already started to appear in the last few years [...] but we need more of them, as well as cross-platform ones.
I can recommend this book experienced software engineers working on long-term, complex software projects and products, as well as engineering-oriented managers who seriously consider to enhance their processes.
The author attempts to draw various vague analogies between forensics analysis and software development. While I think his considerations of the social aspect of development are sane and valid, I found his comparisons to be mostly contrived simplifications. His psycology-based insights, which he claims to be a selling point, often involve large gaps in logic (for a technical book at least). For example, he tries to compare serial killers and bugs...hopeful you can think for yourself why this might be a silly analogy. One might argue that I am being too rigid, but I would say for a profession like software engineering, which is rooted in logic, the author's lack of clear hueristic reasoning is very uncomforting. He often cites some research paper in social/cognitive psychology, and then proceeds to use those principals as a foundation for his methods, without any evidence or data to back his claims. I believe he could benefit from interrogating his assumption much more rigoursly.
Further more, I found most of his "analysis" techniques to be disgustingly primitive. Almost all of them involve extracting some immediately available value from a VCS, and then literally just looking at minimums and maximums. Another troubling observation: his approach to dealing with time series data (i.e. commit history) seems to be "hey it's too complicated, let's just subset the it to some fixed interval". While I will admit this seems to be a somewhat decent approach, it effectively throws away all information outside of the interval. That may be what you want, but sometimes it is not and the author appears to make no consideration of this information loss. Another red flag: he doesn't normalize his data when appropriate (revisions frequency for example). Comon dude, seriously!! That's elementary statistics!! I myself am by no means an expert statistician, so it's troubling that even someone with my limited knowledge can spot these errors.
Not saying it's a terrible book, as it is a decent read. But certainly take what he says with a grain of salt.
Top reviews from other countries
I have one massive problem against this book thought which is that the author uses this book to basically sell you his software, which is a bit of a sleazy move "Oh you've bought and read my book!? now go buy my software to put these ideas into action"
Witty and well-written, though not all the examples in the book worked as expected.








