정보시스템감리사

정보시스템감리사 기출문제 2024-소프트웨어공학32

thesolutionmaster 2025. 4. 16. 18:37
리팩토링 기법 문제

리팩토링 기법 문제

다음의 코드에 적용된 코드 리팩토링 기법으로 가장 적절한 것은? <적용 전> int increment(int inValue, int Qty, int amount) { if (inValue > 50) inValue++; .... <적용 후> int increment(int inValue, int Qty, int amount) { int grade = inValue; if (inValue > 50) grade++; ....
  • ① 임시변수 분리 기법 (Split temporary variable)
  • ② 매개변수 할당 제거 기법 (Remove assignments to parameters)
  • ③ 중간자 제거 기법 (Remove middle man)
  • ④ 조건 다형성 대체 기법 (Replace conditional with polymorphism)