CND67Refactoring

Refactorings IZ#136314

Must Have

  • Rename (file, macro, class, function, variable, typedef, namespace)
  • Encapsulate field (generate and use getter/setter) IZ#135627
  • Change method parameters IZ#153818

Nice To Have

  • Extract function IZ#156905
  • Extract variable IZ#156906
  • Rename in comments
  • Hide method
  • Implement method

Measure

Do correct refactoring in 99% of cases for each refactoring type.

Correct refactoring changes compilable and testable code into compilable and testable code.

Limitations for this release

  • Project should be correctly configured for code assistance use
  • Refactoring works only in active preprocessor blocks, but for all project configurations at once.
  • If user have blocks of code which is not active in any of project configuration than no refactoring in it. User will be warned about existence of inactive blocks and will have possibility to review such blocks.
  • Refactoring doesn't perform the check of possible name collisions

Approach

  • Find existing projects with unit tests (see Gentoo portage)
  • Generate golden data (long and incremental process)
  • compilation/testing in different configurations (remember dead code!)
  • as a quicker approximation: self-testing with hyperlink (applicable to Rename)
  • Visual Assist can help to generate
  • Run refactorings and compare with golden results

Challenges

  • Dead code
  • Macros
  • Expressions
  • Types
  • Verification of refactoring possibility

Flash demo

refactoring_and_macros_CND67Refactoring.htm

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo