Code understanding, reverse engineering, best concepts and tools. Java

前端 未结 6 1804
心在旅途
心在旅途 2020-12-13 22:58

One of most demanding tasks for any programmer, architect is understanding other\'s code.

For example, I am contractor, hired to rescue some project very quickly. F

6条回答
  •  庸人自扰
    2020-12-13 23:57

    The book Object-Oriented Reengineering Patterns deals with this in detail. Unfortunately there is no silver bullet attached :-)

    However, it lists a lot of useful techniques for taking over legacy code. In brief

    • interview at least some of the original developers (if they are still around) about
      • development history: phases, releases
      • current state of affairs
      • team social structure, politics, dynamics: when and why did people join and leave
      • bugs: typical, easiest, hardest
      • code quality: cleanest / ugliest parts
      • configuration data: form, content and usage
      • unit / integration / manual / ... test cases and data
      • SCM branch structure and usage
      • documentation: what is documented where, is it up to date
      • contact persons for external interfaces
    • Watch developers / users during demo to find
      • main features
      • typical use cases
      • usage anecdotes
      • good / bad, missing / superfluous functionality
    • "read all the code in one hour"
      • get high level view of class hierarchies, interfaces
      • take multiple sessions if needed
      • identify large structures (these often contain important functionality)
      • look for design patterns
      • check comments (they can reveal a lot, but may be also misleading)
    • skim documentation (if there is any)
      • just record the availability of specific types of docs e.g. specification, UML diagram, Wiki, Javadoc etc.
      • is it useful and why (not)
      • is it up to date

提交回复
热议问题