범위 검사로 변환할 수 있는 두 개의 연속 비교를 보고합니다.

범위를 검사하면 테스트 대상 중복을 제거해 코드가 더 단순해집니다.

예:


  fun checkMonth(month: Int): Boolean {
      return month >= 1 && month <= 12
  }

빠른 수정에서는 비교를 기반으로 하는 검사를 하나의 범위로 바꿉니다.


  fun checkMonth(month: Int): Boolean {
      return month in 1..12
  }