Software + Database Archeology in Moscow

Posted by on in Blogs
Yesterday, in Moscow, I presented (for the first time) our solution seminar titled "Software + Database Archeology" using Delphi 2009, our database tools, and some third party tools. Thank you to the developers in Moscow for being the first field test viewers.

To develop the seminar (with the help of others inside Embarcadero, thanks team), we started with our Software Archeology methodology application development solution and extended it to include the database parts of most applications.

As a developer at some point you face the daunting task of working on code you didn't build. Software archeology is a methodology to help you determine how to deconstruct inherited software source code. Although getting the information by hand is possible, it's tedious and time-consuming. Using a set of tools reduces the time needed to generate data to help you move forward with development.
Without going into all the demo details (I will add specifics later and even a screen cast of the demo) - here are the six steps in Software + Database Archeology and the use/fit with Embarcadero Delphi and the database tools.

Visualization: Getting a Picture of the Software & the Database

Delphi 2009 comes with LiveSource™ that will reverse and forward engineer Delphi code. This means that if you inherited a large amount of Delphi code, Delphi 2009 can reverse engineer the code and produce a series of UML diagrams. And since it uses LiveSource™, any changes made to the diagrams will result in the code being changed and vice-versa. So the code and diagrams are always in-sync. This gives your developers an advantage when trying to understand what has been inherited with a code base.

  • Delphi IDE UML view of source code

  • ER/Studio – reverse engineer the database and build logical data models

  • EA/Studio – pictures for high level business process and conceptual models

Design Violations: Understanding the health of object & data models

It is also important to get an understanding of the health of the object code. One of the fastest ways to do this is to run software metrics on the code. Metrics give you information about the code's construction and strength as well as the weak or problematic spots. Delphi 2009 includes over 80+ software metrics such as the simple Lines of Code, the more in-depth Cyclomatic Complexity, Instability and others, to help report on the health of the code. Once Delphi has generated the metrics, a Kiviat graph helps developers better visualize the health of the code.

  • Delphi IDE UML Metrics

  • Change Manager – for differences between versions

  • Schema Examiner – for warnings in data model design

  • DSAuditor – for analysis of data access and usage

Style Violations: Understanding the current state of code & database

Once developers understand the health of the code from a structural standpoint, they can move to uncovering issues that can cause errors, bugs, or misunderstandings going forward. Delphi includes over 200+ code audits that find possible performance issues, potential errors, and duplication of code.

  • Delphi IDE UML Audits

  • Schema Examiner – analyze physical design of database for normalization and consistency

  • Rapid SQL / Rapid SQL Developer – explain plan, reveal style violations/warnings

  • ER/Studio - visually trace procedure and view dependencies

Business Logic: Testing the existing source code & database

One of the most important processes with today's complex systems is good testing. Ironically, most code that goes through the process of Software Archeology has very limited testing. If you don't do simple testing on the code, it is hard to harvest patterns, change the code in any meaningful way, or integrate with other systems. It is important to be confident with the code's functionality. Delphi fully supports DUnit and many other great testing tools to help make certain your developers understand that the code functions exactly how it should.

  • Dunit – integrated into the IDE – for unit testing (if there are any unit tests, which there usually aren’t)

  • Rapid SQL / Rapid SQL Developer – use SQL statements to test Stored Procedures (if any)

  • Change Manager – audit database configurations, notification of changes

  • DB Optimizer v 1.5.1 – new stress test feature

Performance: Locating the bottlenecks in source code & database

Performance reviews are also essential. When you use Delphi 2009 + AutomatedQA’s AQTime profiler for software archeology, it helps point you to where the code is slow or does not perform well. The tools can help developers find the exact line or location of the code that is causing the performance issues. The general rule is that less than 5% of the code causes 80% of the slow down, Delphi + AQTime help you fix that 5%.

  • DB Optimizer – for profiling the Database

  • DBArtisan – Performance analysis, space analysis, capacity analysis

  • AutomatedQA’s AQTime – profiling Delphi code

  • InterBase PLANalyzer – query optimization PLANs for SQL statements, accurate read statistics

Documentation: Assessing and Generating documentation

It is important that any diagrams, tests, metrics, audits and performance data become part of the overall code documentation set. Delphi 2009 provides Documentation Generation functionality. When you generate a UML diagram it becomes part of the overall documentation. When you run a metric or audit, those become part of the documentation. This feature allows future developers to have a better understanding of the code, and the ability to share the information.

  • Delphi IDE - UML document generation (HTML / JavaScript)

  • ER/Studio – logical and physical data model doc gen

  • Change Manager – report on changes over time

  • DBArtisan – real time metrics, text and chart displays

  • DBOptimizer – SnapShots, CPU & I/O wait activity, explain plans

If you are anywhere near Brussels on Tuesday(June 9), or London on Wednesday,(June 10), I will be showcasing Software + Database Archeology at our Developer Day in each of those cities.

Gold User, Rank: 1, Points: 2466
David Intersimone (known to many as David I.) is a passionate and innovative software industry veteran-often referred to as a developer icon-who extols and educates the world on Embarcadero developer tools. He shares his visions as an active member of the industry speaking circuit and is tapped as an expert source by the media. He is a long-standing champion of architects, developers and database professionals and works to ensure that their needs are folded into Embarcadero's strategic product plans. David holds a bachelor's degree in computer science from California Polytechnic State University at San Luis Obispo, California.


  • Guest
    Jannes Thursday, 4 June 2009

    hey david,

    are you showing Archeology in hamburg tomorow as well?


  • Guest
    Jannes Thursday, 4 June 2009

    hey david,
    are you showing this in hamburg as well?


  • Guest
    Andrew jones Friday, 5 June 2009

    It's a well written article.It is really booming these days.Hence, we should check it out...

  • Guest
    max Wednesday, 29 September 2010

    thanks guys

  • Please login first in order for you to submit comments
  • Page :
  • 1

Check out more tips and tricks in this development video: