2. digital
agency
┘ Lot of different projects throughout the years
┘ Project handovers
┘ Code audits
3. issues
┘ Tons of things to check
┘ Lot of different approaches
┘ Require a lot of time (it’s never enough)
┘ Huge projects - Potentially overlooked problems
4. goals
┘ Find the most crucial issues in the shortest time
┘ Be more efficient in gaining insights
┘ Efficiently identify the changes to the code which provide the most value
5. useful
when
┘ You have to do a project audit
┘ You join a new project
┘ You just want to get new insights into your current project
┘ You want to refactor or rewrite
∷ You can show these findings to your client/boss/lead
6. process
┘ Checking git reports
∷ Interesting details about the project
∷ Gitlab / Github - GitStats(SourceForge)
10. process
┘ Checking git reports
∷ Interesting details about the project
∷ Gitlab / Github - GitStats
┘ Checking project size
∷ Cloc
┘ Open the project and build it
∷ High-level overview
12. process
┘ Checking git reports
∷ Interesting details about the project
∷ Gitlab / Github - GitStats
┘ Checking project size
∷ Cloc
┘ Open the project and build it
∷ Highlevel overview
┘ Visualize class dependencies
21. quick
process
summary
┘ We have a lot of information about the project already
∷ High-level overview
∷ Data about the project size and age
∷ List of complexities
∷ List of duplication
∷ Duplication rate
∷ List of unused codes
∷ Nice visualization of the class dependencies
┘ It only took a few hours
23. problems
┘ We spend so much time looking at the current state of the code
that we forget its history
┘ Its hard to understand large-scale complex systems by looking
at a snapshot of the code
┘ We miss a lot of information
25. version
control
systems
┘ We use it to keep track of the project history
┘ Rarely think about the insights we can get by mining data from it
┘ We can learn about the environment
┘ We can learn about how we work
┘ Predict which parts of the code have the most defects
┘ Find the code that matters most for maintenance
┘ Information is real power
27. code
maat
┘ Command line tool
┘ To mine and analyze data from version control systems
┘ It supports different version control systems
∷ git, svn, perforce, tfs, mercurial
┘ We can use it to detect hotspots
┘ We can use it to detect architectural problems
┘ And so much more
30. Hotspots
┘ Hotspots are your guide to improvements and
refactorings
┘ Research has shown that frequent changes to complex
code generally indicate declining quality
┘ Over time our development focus shifts so the hotspots
will also shift
┘ Hotspots can predict defects very well
┘ We can find them at the intersection of complexity and
effort
37. Coupling
┘ We can detect which files are changing together most
of the time
┘ Detect architectural / design issues
┘ Explicit coupling
∷ What tend to change together (screen + vm)
┘ Temporal coupling
∷ This is what we are looking for
∷ Can be false positives (service + test)
∷ Can be serious design problem
∷ Can be copy-paste
45. other
features
┘ Complexity trends
∷ Evaluate growth patterns
∷ Analyze complexity trends
┘ Discover organizational metrics
∷ Social problems
∷ Evaluate communication costs
∷ Build knowledge map
∷ Visualize knowledge loss
┘ Code chur
∷ Predict defects
∷ Discover process loss from code
46. process
summary
┘ High-level overview of the codebase
┘ List of complexities
┘ List of duplications
┘ List of unused codes
┘ List of hotspots
┘ List of problematic dependencies
47. goals
┘ ✅ Find the most crucial issues in the shortest time
┘ ✅ Be more efficient in gaining insights
┘ ✅ Efficiently identify the changes to the code which provide the most
value
48. suggesti
ons
┘ Run these analyses every few months
┘ Can be part of CI/CD release process
┘ Talk the findings through with your team
┘ Read Adam Tornhill’s book to learn more:
Your Code as a Crime Scene
49. sum up
┘ With the right tools you can quickly and efficiently spot
problems
┘ You can use your version control systems to have more
information about your project
┘ By mining data from it, you can get a deeper
understanding of your design / architectural problems
┘ With the right data you can back your refactoring/
rewrite proposals
┘ Focusing on the right things early you can save a lot of
maintenance cost