are most of the JUnit test written for public methods or private methods? Which do I need to focus on if I have not so much time?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should to test everything that forms part of the API. Unless you’re using reflection, this means the public/protected and package level methods.
Clearly, this is opinion. But it is one based on experience. Let me take my opinion further.
Ideally, you should practice test-driven development. In this practice you:
Until you get to the refactoring stage, you probably won’t even have any private methods.