Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Refactoring in Java
  • Table Of Contents Toc
  • Feedback & Rating feedback
Refactoring in Java

Refactoring in Java

By : Stefano Violetta
5 (1)
close
close
Refactoring in Java

Refactoring in Java

5 (1)
By: Stefano Violetta

Overview of this book

Refactoring in Java serves as an indispensable guide to enhancing your codebase’s quality and maintainability. The book begins by helping you get to grips with refactoring fundamentals, including cultivating good coding habits and identifying red flags. You’ll explore testing methodologies, essential refactoring techniques, and metaprogramming, as well as designing a good architecture. The chapters clearly explain how to refactor and improve your code using real-world examples and proven techniques. Part two equips you with the ability to recognize code smells, prioritize tasks, and employ automated refactoring tools, testing frameworks, and code analysis tools. You’ll discover best practices to ensure efficient code improvement so that you can navigate complexities with ease. In part three, the book focuses on continuous learning, daily practices enhancing coding proficiency, and a holistic view of the architecture. You’ll get practical tips to mitigate risks during refactoring, along with guidance on measuring impact to ensure that you become an efficient software craftsperson. By the end of this book, you’ll be able to avoid unproductive programming or architecturing, detect red flags, and propose changes to improve the maintainability of your codebase.
Table of Contents (15 chapters)
close
close
1
Part 1: Introduction to Refactoring
4
Part 2: Essence of Refactoring and Good Code
Free Chapter
10
Part 3: Further Learning

What this book covers

Chapter 1, What is Refactoring?, starts with the fundamental concepts, explaining what is meant by refactoring and why it is important. Faced with many possible opportunities for refactoring, let’s learn to understand how to give each opportunity the right importance, i.e., which one to refactor first. We also understand when it is not necessary to refactor.

Chapter 2, Good Coding Habits, covers the topic of writing high-quality code by day-to-day habits. What is good code? What is bad code? We will delve into this and briefly explore the concept of clean code. We’ll talk about the SOLID principles of software design, and also about the importance of (not using) side effects and mutability and common causes of bad code.

Chapter 3, Code Smells, is about the most frequent “red flags” that you can step into when going through your codebase; those red flags should immediately catch the eye of a professional. Recognizing them (and thus avoiding them) is a crucial part of our skills.

Chapter 4, Testing, is about the importance of the testing phase. Why is it important and why do you have to test as often as you can? We’ll learn about unit testing and how we can be sure that most of our codebase is covered by tests. We’ll go into Test Driven Development.

Chapter 5, Refactoring Techniques, is an overview of the main “tricks” that we can adopt to get rid of the code smells we discovered in Chapter 3. We’ll learn to write better methods and move code when necessary; we’ll organize data and simplify both conditional logic and method calls. We’ll also discuss generalization.

Chapter 6, Metaprogramming, is about... not writing code! In other terms, we can use well-tested and well-grounded frameworks and libraries to write the code for us, avoiding reinventing the wheel.

Chapter 7, Static and Dynamic Analysis, talks about how we can be sure we’re on the right path. The chapter delves into the concept of code analysis and program analysis, also exploring some tools that can be very useful in understanding how far we are from the quality threshold we want to set.

Chapter 8, Crafting Quality Every Day, tells us about the little and big actions that we can put in place during our day-to-day work routine. From code versioning to code formatting, from code reviews to pair programming, we can incorporate a lot of small but constant effort to keep our codebase clean and maintainable.

Chapter 9, Mastering Software Architecture, lifts our gaze and talks about the architecture of a software project. It explains what architecture is and what it is made of; it tells us about the main architectural patterns. Just as we did for individual pieces of code, we discussed which are the main architectural red flags to avoid.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY