Skip to content

yousuketakada/refactoring_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Refactoring Example

A C++ project for the first refactoring example of Fowler (2018).

Features

  • Based on the "theatrical players" (rather than "video rental store") exercise from the first chapter (freely available from here) of Fowler (2018)
  • C++20 (rather than JavaScript) with some tests (using GoogleTest)
  • Two branches: master (the starting point before refactoring) vs. refactored (the fully refactored state) with some refactoring memo describing the key refactoring steps

How to configure, build, and test

$ cmake --preset ninja -D CMAKE_BUILD_TYPE=Debug
$ cmake --build build
$ ctest --test-dir build --output-on-failure

Reference(s)

  • Fowler, M. (2018). Refactoring: Improving the Design of Existing Code (2nd ed.). Addison-Wesley.