Course in Clean Code

Course in how you systematically cleanse existing source code

Have you ever worked in a disastorous project? A development project where the development has completely stopped and the group is paralyzed by fear that the slitest change of the code should release a large amount of new bugs. A such a project constitutes the end point for a long journey that started with that one's did not have the time to clean up that very source code mudule, because this actual week there was so very much to do in the project. Does it feel familiar?

The existence of bad code in software system is to be compared with the existence of mould in houses. It will just get wore and worse. This course focus on that there is a lot to do for prevention and how to systematically make bad code less bad and eventually make it good.

This is what you will learn
  • How you do a systematically refactoring to improve the code quality
  • How you increase the readability of the code, to make it more maintenance friendly
  • How you create meaningful unit tests
Course Contents

Software Design

  • Principles of software design
  • Cost of fixing bugs
  • The knowledge transfer dilemma
  • Code smell
  • The danger of complexity

Design Principles

  • Broken windows
  • Screaming monkeys
  • DRY
  • Single responsibility
  • Separation of concern
  • Least astonishment

Case Studies

  • GSM/GPRS system
  • 3-tier client-server-backend system
  • Credit-card processing batch system

Design Patterns

  • Patterns and anti-patterns
  • Singleton
  • Template method
  • Decorator
  • Composite
  • Builder
  • and more...


  • What it is
  • Tools
  • Extract variable/method/class
  • Pull/push members
  • Renaming
  • and more...

Clean Code Basics

  • What it is
  • How to do it

Comments and Formatting

  • How to deal with comments
  • General advice
  • Different categories of comments

Meaningful Names

  • Naming matters
  • What about encodings


  • Function size
  • Return policy
  • Side effects
  • Parameters


  • Class size
  • What is a cohesive class
  • Open-closed principle
  • Loosly coupled classes
  • Class organization

Data Structures

  • Data structures vs. objects
  • Law of demeter

Error Handling

  • Return codes
  • Null returning
  • Null arguments
  • The exception debate is over
  • Assertions

Unit Testing

  • Test FIRST
  • Clean tests
  • The given-when-then idiom
  • Intro to Spock

System Architecture

  • Separation of concern
  • Constructions vs. usage
  • Dependency injection

Build Tools

  • Overview of build tools
  • Repositories
  • Proxies
  • Work flow

Continuous Integration and Deployment

  • What is Continuous Integration (CI)
  • How is it related to clean code
  • CI servers
  • What is Continuous Deployment (CD)
NameClean Code
Duration2 Days
AudienceJava developers
PrerequisitesFluent in Java programming
  • Java JDK 8, or later
  • JetBrains Intellij IDEA
Course Dates
DatePlace Price
2020-02-20Stockholm 15 000 kr
2020-03-12Stockholm 15 000 kr
2020-04-02Stockholm 15 000 kr
2020-04-27Stockholm 15 000 kr
2020-05-18Stockholm 15 000 kr

Same-Company Discout

We offer a 20% discount for additional participants from the same company and at the same course date. Read more here.

Teaching Language

Our printed course material is always authored in English. The oral presentation in our classrooms is generally in Swedish, unless all participants agree to that we perform the course in English.

On-Site Course

If you order an On-Site course, we will come to you and hold the course in your office. The price is determined by our price model and is based on the number of course days, number of participants and any travel and lodging.

Read more about out price modell and term of sales here.

Related Courses
CourseDays Level
Design Patterns2IntermediateShow
Java Basics5 BeginnerShow
Java 8/9/...3 IntermediateShow