내용으로 건너뛰기
권남
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
추적:
java:powermock
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== Powermock ====== * https://code.google.com/p/powermock/ ===== 참고 ===== * [[http://stackoverflow.com/questions/427750/using-powermock-or-how-much-do-you-let-your-tests-affect-your-design|java - Using PowerMock or How much do you let your tests affect your design? - Stack Overflow]] * 어쩔 수 없이 Third Party 라이브러리를 테스트할 때가 아니면 사용하지 말고, Third Party 라도 Anti Corruption Layer를 만들어서 Anti Corruption Layer를 테스트하라. > I totally agree that Testability is not an end goal, this has been one of the things I have realized when developing PowerMock. I also agree that writing unit tests is one way of getting good design. Using PowerMock should probably be an exception rather than a rule, at least features such as expectations on constructors and static mocking. > The main motivation we have for using PowerMock is when using third party code that prevents your code from being testable. A good alternative is using an anti-corruption-layer that abstracts the third party code and makes it testable. However, sometimes I think the code is cleaner just using the standard APIs. A good example of this is the Java ME API. This is full of static method calls that prevent unit testing. > The same problem can occur with legacy code. Some organizations are extremely afraid of modifying their existing code and in this case PowerMock can be used to introduce unit testing in the parts you are writing at the moment, without forcing big refactorings. > Our problem is specifying a set of best practice rules when to use PowerMock or not that a rookie developer can follow. Creating good design is really hard and since PowerMock gives you more options, maybe it just gets harder for a beginner? I think a more experienced developer appreciates having more choices. > (founder of PowerMock)
java/powermock.txt
· 마지막으로 수정됨: 2015/06/02 10:32 저자
kwon37xi
문서 도구
문서 보기
이전 판
역링크
맨 위로