PacktLib: Refactoring with Microsoft Visual Studio 2010

Refactoring with Microsoft Visual Studio 2010

Credits

About the Author

Acknowledgement

About the Reviewers

Preface

Introduction to Refactoring

What is refactoring?

Why the term refactoring?

Unit testing the second half of the equation

Simple refactoring

Technical debt

In the software development trenches

The option of rewriting

Working refactoring into the process

What to refactor

Refactoring in Visual Studio® 2010

Summary

Improving Code Readability

Built-in Visual Studio® refactorings

The smell of code

Dead code

Intention-revealing design

You ain't gonna need it

KISS principle

Keeping track of code changes

Check-in often

Removing unused references

Summary

Improving Code Maintainability

Code maintainability

Summary

Improving Code Navigation

Navigating object-oriented code

Convention over Configuration

IDE navigation

Navigation with design patterns and principles

Summary

Improving Design Correctness

Liskov substitution principle

Composition over inheritance

Object-oriented design and object behavior

Move initialization to declaration

Summary

Improving Class Quality

Cohesion

Coupling

Summary

Refactoring to Loosely Coupled

What is loosely coupled?

Dependency Inversion principle

Inversion of Control

Dependency Injection

Working with IoC containers

Decorator pattern

Detecting highly-coupled

Types of coupling

Interface segregation principle

Drawbacks of loosely-coupled

Other methods of loose-coupling

Summary

Refactoring to Layers

Layers

Model View Presenter (MVP)

Additional layers

Summary

Improving Architectural Behavior

Behavioral patterns

Summary

Improving Architectural Structure

Structural patterns

Object/Relational Mapping

Summary

Ensuring Quality with Unit Testing

Change is not always good

Automated testing

Unit tests

Mocking frameworks

Unit testing existing legacy code

Unit testing in Visual Studio®

Test driven development

Unit testing frameworks

Automating unit-testing

Third party refactoring tools

Summary