이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== 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)
· 마지막으로 수정됨: 2015/06/02 10:32 저자
별도로 명시하지 않을 경우, 이 위키의 내용은 다음 라이선스에 따라 사용할 수 있습니다:
CC Attribution-Share Alike 4.0 International