Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 879735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:58:53+00:00 2026-05-15T11:58:53+00:00

In JUnit FAQ you can read that you shouldn’t test methods that are too

  • 0

In JUnit FAQ you can read that you shouldn’t test methods that are too simple to break. While all examples seem logical (getters and setters, delegation etc.), I’m not sure I am able to grasp the “can’t break on its own” concept in full. When would you say that the method “can’t break on its own”? Anyone care to elaborate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:58:54+00:00Added an answer on May 15, 2026 at 11:58 am

    I think “can’t break on its own” means that the method only uses elements of its own class, and does not depend upon the behavior of any other objects/classes, or that it delegates all of its functionality to some other method or class (which presumably has its own tests).

    The basic idea is that if you can see everything the method does, without needing to refer to other methods or classes, and you are pretty sure it is correct, then a test is probably not necessary.

    There is not necessarily a clear line here. “Too simple to break” is in the eye of the beholder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In JUnit you can use @Ignore before methods to tell the test runner to
How do I use JUnit to test a class that has internal private methods,
How can I use JUnit idiomatically to test that some code throws an exception?
I have three JUnit test classes that all had some common code, including identical
I have a simple JUnit test in Eclipse. public class HelloTest extends TestCase {
I use JUnit 3.x TestRunner that intantiates all tests at once before running them.
In JUnit tests, I need to test that a given object (not the reference,
I am referring to JUnit annotations like @test, @before , @after. e.g i can
From my junit test I'm calling a simple method to clear my table: @AfterClass
I have a junit test method that takes a CommonsMultipartFile object as a parameter.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.