Java 04: Legacy Code Java
Working with Java Legacy Code: Know-How & Best Practice

You need to understand a complex Java code base without a test suite and implement further requirements based on it? You don't dare to change the existing code because of side-effects that might affect other modules and cause errors in other places? In other words, you have to work with Java legacy code and you want to learn the best strategies and techniques to build a safety net first, so that you can understand the existing code step by step and refactor it into clean code? Then this is the course for you! Having to understand and work with an old complex code base without a test suite is by far the most unpleasant thing software developers have to deal with on a daily basis. But not if you know the techniques for working with legacy code. With the appropriate know-how and practical best practices, this challenging task becomes one of the most interesting tasks. Learn more about this exciting training on working with Java Legacy Code...


  • Learn best practices for working with Java legacy code
  • Effectively understand existing complex Java code base
  • Create safety nets for legacy code in the form of test suites
  • Gradually transform legacy code into higher quality clean code
  • Safely evolve and adapt existing legacy projects
  • Create test suites instead of a completely new development or a big redesign
  • Significantly reduce training and development time when legacy code becomes clean code

This Working with Java Legacy Code course is one of the most popular at the Munich Coding Academy. Because almost every company has to deal with legacy code. The benefits of this course are very high, because the techniques learned can be immediately integrated into everyday work and applied directly, so that software developers become faster and more confident when they have to work with legacy code.

Course formats



Live oder online large

Teaching material



Video clips


Live oder online large

Teaching material



Snacks large


Online large

Teaching material



Video clips

All courses also include unlimited access to our member area with many more videos, tutorials and information about coding.


The course covers a selection of the following topics:

  • Introduction to Java Unit Testing
  • Introduction to Clean Code
  • Introduction to Refactoring Patterns
  • Golden Master
  • Seams
  • Test Coverage
  • Mutation Testing
  • Adding a Feature
  • Get a Class into a Test Harness
  • Run a Method in a Test Harness
  • Breaking Monster Class
  • Changing Monster Method
  • Dependency Breaking Techniques

For more details, please see the agenda below.


This Working with Java Legacy Code course is designed for software developers and programmers with solid and good Java knowledge, comparable to our Java course for beginners.

It would be advantageous if you are already familiar with unit testing and clean code to the extent of our unit testing and clean code courses. However, this is not a prerequisite, as we will also give a small introduction to these topics at the beginning of the course

  • Individual: we specifically address your needs and take into account your previous knowledge, desired topics and focal points

  • Structured and easy to understand

  • Take your career, studies or training to the next level: with certificate

  • Safely and independently develop programmes (whether private, professional or for your start-up)

  • Lots and lots of practice: immediately applicable results

  • Small groups: max. 8 participants in the 3-day course max. 12 participants in online coaching

  • Developed by experts according to the Raed Method® & geared to the requirements of tech companies in 2020

  • E-mail support even after the end of the course


The Working with Legacy Code Seminar of the Coding Akademie Munich is ideal for developers with basic Java knowledge who are working with legacy code in an ongoing project. Or for anyone who is maintaining an existing project without a test suite or unit test. During the three-day seminar, we will shed light on legacy code, which is generally more difficult to test. After all, the reasons for this are usually hidden. Either there is no unit test for this code. Or the existing unit test is not sufficient. Or it does not cover all relevant cases. This makes one or the other programmer think about reprogramming the whole project. But this is only necessary in very few cases. Because often the projects are very large, complex and the resulting software is already marketed. This makes it impossible to set up the code completely new and clean.

This is exactly where our Legacy Code Seminar comes in. During the three days you write step by step specific tests for the corresponding modules. This secures you and your project and lets you change and adapt the code in peace and bring it into a much better state with Clean Code rules. Your software gets better from day to day. Your code quality increases. Changes and adaptations become easier. And you keep the original code, which guarantees a smooth and secure operation of the application.

Of course, you write the Java test and codes under the guidance of proven experts and renowned Java trainers who lecture at the best universities in the country. This safeguards you and lets you playfully understand the tricks of legacy code. Also responsible for this good feeling is the pleasant environment in our modern training center. Whether online or offline. It is located in the center of Munich and is easily accessible by car or public transport. Once you are there, you can look forward to state-of-the-art computers - as well as delicious snacks and drinks waiting for you during your Legacy Code seminar.

What do you learn on the first day?

As motivation for this exciting and important topic, we first look at the four symptoms of bad code and bad architecture (rigidity, fragility, inseparability and opacity) and put ourselves in the role of a manager whose project is progressing very slowly and constantly produces errors. Deadlines are not met, teams are annoyed and customers are outraged and dissatisfied.

We find out what he should do now and for what reasons. We then turn our attention to the term "clean code": what is it, how can you recognise good code and how can you quickly learn stylish clean code? To produce clean code, we have to apply certain rules and techniques at various points in our Java programme. Java programmes usually consist of several classes and interfaces. We now break down a Java class into its basic components: Identifiers (class names, variable names, package names, method names), comments, methods, and possibly exception handling.

This raises many interesting questions: What should my identifiers be called? How long should they be? How many lines should my method have? How many parameters should it ideally have? When should it be void and when should it return a value from a certain data type and why? When should I resort to exception handling, first or last? What is the level of abstraction in my methods and code? We will deal with all these questions in the Clean Code rules for identifiers, comments, methods and exception handling, using numerous interactive code examples (before/after or bad code/good code) and small programming tasks.

What do you learn on the second day?

After the first day, you already know all the important rules for creating clean code, but only within a class. On the second day, we devote ourselves to the questions: How should our classes interact with each other, how should we design classes in such a way that new requirements are ideally only possible through extensions and not through modifying and changing existing code? How and when do I break my class into multiple classes and why? How can I assign modules to Team A and Team B so that both teams develop independently? What is the meaning of the rule: "Program to an interface not implementation", which we read in every textbook on Clean Architecture and Code? How do we implement it correctly? We will answer all these questions with so-called SOLID and GRASP principles, using exciting code examples and programming tasks. SOLID is an abbreviation for 5 techniques (Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion Principle).

In our experience, SOLID is characterised by the fact that it is not easy to plan or implement. But if a programmer has mastered SOLID, he can immediately see whether his programme violates SOLID or not. If his programme violates SOLID, then he can ask himself why: Are there good reasons for this? If the answer is no, then he can now very easily change his code so that it no longer violates the SOLID rules. However, we find the name "Principle" a bit exaggerated: SOLID are very good clean code and architecture rules, the application of which usually leads to a well-structured and clearly defined code. Nevertheless, one should not and must not always use SOLID blindly. There are also good reasons against SOLID from time to time.

The SOLID rules make the code flexible, but also bring more complexity. You almost always have to make compromises: If you need the flexibility, then you also have to accept the complexity. Therefore, every programmer should always ask himself the question: Why did I violate SOLID? Are there good reasons for it? In any case, every good programmer should master the SOLID rules, add them to his know-how and toolbox and apply them with common sense. In order not to treat all this too abstractly, you will implement all SOLID rules by means of small programming tasks and see for yourself if and when this is worthwhile for you.

What do you learn on the third day?

We want to produce clean code, code that is not only easy to understand, but that also works properly. Therefore, the topics of unit testing and test-driven development (TDD) are undoubtedly part of this. We will take a quick excursion into JUnit 5 and also into TDD, which consists of 3 phases (RED-GREEN-REFACTORING). Through simple examples and programming tasks you will get to know these 3 phases in action and quickly get a feel for them. If you are more interested in Unit Testing and TDD, you can also attend our separate course Java Unit Testing at the Munich Coding Academy.

Now you already know all the important clean code rules for one and several classes and even unit testing. What's missing now: In large projects, you usually have to work with code that you didn't write yourself. You should write new code based on existing code and therefore you have to understand it and modify and extend it if necessary. How can you tell if the existing code quality is good enough or not? The answer is relatively simple: If the existing code violates the Clean Code and SOLID rules and has no or only poor tests, then the probability is quite high that it is code with poor quality. This is exactly why there is a catalogue for the so-called code smells.

Code smells are code that smells of errors and complexity. This is even put very diplomatically. Code smells is code that simply stinks because it is so badly written. Such bad code slows down development and reduces productivity and joy in programming. The first step in eliminating such bad code is to recognise it immediately; this is initially a matter of practice and experience. Nevertheless, there is a catalogue for Code Smells (Names, Functions, Comments and Test Smells) with over 20 patterns. We look at the most important patterns that can be used to turn bad code into good code, using many code examples and best practice techniques. This task - turning bad code into good code - is extremely important and very challenging, because it requires knowledge of refactoring patterns and can only be learned through intensive practice and many programming tasks. For this reason, we offer an additional course "Improve Your Java Code" for this purpose, which is the ideal companion for working with legacy code.


The Java Legacy Code course will be taught by one of the following instructors:


Of course, as a participant in the Techniques for Working with Java Legacy Code course, you will receive a certificate. Prerequisite for this is the complete participation in all course units and programming tasks and the successful programming of a small final project. This, however, will be more fun than stressful for you after this intensive Java Legacy Code training.


Of course, as a participant in the Techniques for Working with Java Legacy Code course, you will receive a certificate. Prerequisite for this is the complete participation in all course units and programming tasks and the successful programming of a small final project. This, however, will be more fun than stressful for you after this intensive Java Legacy Code training.

Working with Java Legacy Code Day 1

Code Rote

  • Bad Code
  • Productivity Problem
  • Manager Reaction
  • Code Rote
  • Rigidity
  • Fragility
  • Inseparability
  • Opacity

Clean Code

  • Definition: Boosch
  • Definition: Stroustrup
  • Definition: Cunningham
  • Definition: Feathers

Names Rules

  • Good Name
  • Bad Name
  • Ottinger's Rules
  • Intention-Revealing
  • Pronounceable
  • Searchable
  • Describe the Problem
  • Avoid Desinformation
  • Meaningful Distinctions
  • Avoid Hungarian notation
  • Parts of Speech
  • Scrope Length Rules


  • Function Grammar
  • Big Function
  • Extract Rule
  • Step-Down Rule
  • Command-Query
  • Parameter List Rules
  • Maximal three Arguments
  • No Boolean Argument
  • No output Argument
  • No null Argument
  • Statement Rules
  • Do One Thing Rule
  • Small Function Rule
  • Hidden Classes Rule
  • Minimize Side-Effect
  • Avoid Switch

Error Handling Rules

  • Error Handling First
  • Prefer Exception over Values
  • Exception Classes

Comments Rules

  • Good Comments
  • Legal Comments
  • Informative Comments
  • Explanation of Intent
  • Clarification
  • TODO Comments
  • Javadocs in APIs
  • Bad Comments
  • Mumbling Comments
  • Redundant Comments
  • Misleading Comments
  • Mandated Comments
  • Journal Comments
  • Noise Comments
  • Scary Noise Comments

Working with Java Legacy Code Day 2


  • What is object-oriented
  • Dependency Management
  • Dependency Inversion
  • Switch Statements
  • Fan-Out Problem

SOLID Principles

  • Single Responsibility
  • Open Close
  • Liskov Substitution
  • Interface Segregation
  • Dependency Inversion

Working with Java Legacy Code Day 3

Unit Test

  • Life Cycle and AAA Rules
  • JUnit 5 Annotations
  • JUnit 5 Asserstions
  • Parameterized Tests

Test Driven Development

  • What is TDD?
  • RED Phase
  • GREEN Phase

Code Smells: Names

  • Bad names
  • Unambiguous Names
  • Encodings Names
  • ...

Code Smells: Function

  • Too Many Arguments
  • Output Arguments
  • Flag Arguments
  • Dead Function

Code Smells: Comments

  • Inappropriate Information
  • Obsolete Comment
  • Redundant Comment
  • Commented-Out Code

Code Smells: Test

  • Insufficient Tests
  • Test Ambiguity
  • Exhaustively Test
  • Slow Tests

Course formats / dates

1 Day Crash Course

In München oder Online

3 Days Course

In München oder Online


Participation possible at any time

4-Wochen-Training copy

Participation possible at any time

For teams

Are you interested in a course for your team? Get in touch - we will find a perfect solution. Our professionals are also happy to come to you. Among other things, we offer:

  • In-house training
  • Technical coaching
  • Consulting
Request Request

Questions & Service

Our service team will be happy to advise you personally. Mon-Fri from 9.00 to 18.00 under:
+49 89 17958-820


BMW Apple Draeger VW Sky Siemens 2000px TÜ V Süd Logo Agfa Kopie Samsung Fraunhofer Valtech Deutsche Bank
Course Catalogue Overview of rocket courses: