Unit testing internals by Mark Seemann FAQ: How should you unit test internals? A: Through the public API. This question seems to come up repeatedly: I have some internal ( package-private in Java) code. How do I unit test it? The short answer is: you unit test it as you unit test all other code: through the public API of the System Under Test (SUT). Purpose of automated testing Details can be interesting, but don't lose sight of the big picture. Why do you test your software with automated tests? Automated testing (as opposed to manual testing) only serves a single purpose: it prevents regressions. Some would say that it demonstrates that the software works correctly, but that's inaccurate. Automated tests can only demonstrate that the software works correctly if the tests are written correctly, but that's a different discussion . Assuming that all automated tests are correct, then yes: automated tests also demonstrate that the software works, but it's still regression testing.
Read full article from Unit testing internals
No comments:
Post a Comment