Giter Club home page Giter Club logo

refactor-basic's Introduction

重构基础:Java版

练习描述

练习1

使用防卫语句取代条件表达式(Replaced the Nexted Conditional with Guard Clauses)重构遗留代码

练习2

使用提炼函数(Extract Method)手法重构遗留代码

练习3

使用抽象方法对象(Extract Method Object)重构遗留代码

要求:

  • 不得修改测试(除非必要情况)
  • 重构后的代码必须通过测试

环境要求

  • java 8

如何开始

  • 克隆模版库
  • 根目录下执行./gradlew clean test,出现BUILD SUCCESS字样,说明项目启动成功
  • /src/main/java/practice*下的源码上进行重构

如何测试

  • 根目录下执行./gradlew clean test,查看测试结果

输出规范

  • /src/main/java/practice*下的代码被重构,且测试通过

refactor-basic's People

Contributors

ruifeng-wu avatar linwenjun avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.