> For the complete documentation index, see [llms.txt](https://hanfak.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hanfak.gitbook.io/workspace/testing-reading-maintaining/reading-legacy-code.md).

# Reading and working with legacy code

When working in a new team or looking at code that has not been touched by the dev before, then being able to navigate, read, add new functionality or refactor needs to be done.

Following tips on how to do this:

* Look for acceptance tests, and debug
  * Change some stuff in the acceptance test and debug
* If no tests, find the documentation and requirements and write some.
  * Do this first before even changing the code
* Find the main method and follow the code from there
* Find the endpoints and follow the paths through there
* Use the domain language from the story and search for it in the code base (source and test)
*

## Links

* <https://www.quora.com/How-do-I-read-object-oriented-source-code-efficiently-Especially-when-reading-a-large-project-source>
* <https://www.fastcompany.com/3029446/eight-strategies-for-tackling-legacy-code-you-didnt-write>
* <https://www.red-gate.com/blog/software-development/legacy-code>
* <https://selftaughtcoders.com/how-to-quickly-and-effectively-read-other-peoples-code/>
* <https://medium.com/humans-create-software/5-tips-to-quickly-understand-a-new-code-base-a578b08f3593>
* <https://www.quora.com/How-do-I-learn-to-understand-a-code-written-by-others>
* <https://www.quora.com/What-is-the-best-strategy-to-understand-the-code-flow-and-design-of-production-code>
* <https://spin.atomicobject.com/2017/06/01/how-to-read-code/>
* <https://www.quora.com/How-can-I-get-faster-better-at-reading-other-people%E2%80%99s-code>
* <https://www.quora.com/What-are-some-%E2%80%98good%E2%80%99-open-source-Java-projects>

## Books

* [working with legacy code - feathers](/workspace/testing-reading-maintaining/reading-legacy-code.md)
