사용자 도구

사이트 도구


intellij_idea:unittest

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
마지막 판 양쪽 다음 판
intellij_idea:unittest [2013/10/10 11:06]
kwon37xi
intellij_idea:unittest [2018/08/06 17:04]
kwon37xi [고속 단위 테스트 설정]
줄 1: 줄 1:
 ====== IntelliJ IDEA Unit Test ====== ====== IntelliJ IDEA Unit Test ======
  
-===== 고속 단위 테스트 설정 =====+===== Branch Coverage 측정 ===== 
 +  * **Run/Debug Configurations -> Defaults -> JUnit -> Code Coverage**에서 다음 상태로 설정한 뒤에 테스트를 수행하면 된다. 
 +    * Choose coverage Runner : **IntelliJ IDEA** 
 +    * check **Tracing** 
 +      * check **Track per test coverage** 
 +  * **Run With Coverage**로 테스트를 실행하면 다음과 같이 어느 조건이 히트했고 안했는지를 코드 상에서 볼 수 있다. 
 +    {{:intellij_idea:intellij_branch_coverage_show.png|}} 
 + 
 +===== 고속 단위 테스트 설정 : 하지 말 것 =====
   * [[http://plugins.jetbrains.com/plugin/?id=3822|Eclipse Mode]] 플러그인을 설치하고, 설정에서 **Enable incremental compilation on Save**를 체크한다.   * [[http://plugins.jetbrains.com/plugin/?id=3822|Eclipse Mode]] 플러그인을 설치하고, 설정에서 **Enable incremental compilation on Save**를 체크한다.
     * 혹시 이로인해 문제가 생기면 [[http://www.stitchy.org/?p=107|IntelliJ IDEA 12 and Incremental Builds | Stitchy]] 참조.     * 혹시 이로인해 문제가 생기면 [[http://www.stitchy.org/?p=107|IntelliJ IDEA 12 and Incremental Builds | Stitchy]] 참조.
 +    * EclipseMode는 XML 파일 등 프로그램 소스가 아닌 것을 저장해도 Make 명령을 내려서 오히려 속도를 떨어뜨릴 수도 있다.
   * **Settings -> Compiler** 에서 **Make project automatically** 를 체크를 해제한다. 이는 완벅하게 저장할 때마다 컴파일하지는 않는다.   * **Settings -> Compiler** 에서 **Make project automatically** 를 체크를 해제한다. 이는 완벅하게 저장할 때마다 컴파일하지는 않는다.
     * [[http://stackoverflow.com/questions/12744303/intellij-idea-java-classes-not-auto-compiling-on-save|IntelliJ IDEA Java classes not auto compiling on save]] 문서에 따르면, "Make project automatically"는 Eclipse의 컴파일 방식과 다소 다르고 Run/Debug 모드에서 작동하지 않으므로 즉시 컴파일이 안 될 수도 있다고 한다.     * [[http://stackoverflow.com/questions/12744303/intellij-idea-java-classes-not-auto-compiling-on-save|IntelliJ IDEA Java classes not auto compiling on save]] 문서에 따르면, "Make project automatically"는 Eclipse의 컴파일 방식과 다소 다르고 Run/Debug 모드에서 작동하지 않으므로 즉시 컴파일이 안 될 수도 있다고 한다.
   * **Run -> Edit Configuration -> Defaults -> JUnit**의 **Configuration 탭 -> Before launch** 항목에서 "Make"를 **삭제!!**한다. 이 설정을 해주면 빌드 과정 없이 즉시 단위 테스트를 실행한다.   * **Run -> Edit Configuration -> Defaults -> JUnit**의 **Configuration 탭 -> Before launch** 항목에서 "Make"를 **삭제!!**한다. 이 설정을 해주면 빌드 과정 없이 즉시 단위 테스트를 실행한다.
 {{:intellij_idea:intellij-run-junit-configuration.png?nolink|}} {{:intellij_idea:intellij-run-junit-configuration.png?nolink|}}
intellij_idea/unittest.txt · 마지막으로 수정됨: 2018/08/06 17:07 저자 kwon37xi