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 47257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:05:39+00:00 2026-05-10T16:05:39+00:00

Should simple JavaBeans that have only simple getters and setters be unit tested?? What

  • 0

Should simple JavaBeans that have only simple getters and setters be unit tested??

What about Beans with some logic in getters and setters?

  • 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. 2026-05-10T16:05:39+00:00Added an answer on May 10, 2026 at 4:05 pm

    You should not write tests which:

    • Test the language or the IDE (i.e. automatically generated getters and setters)
    • Add no value to your test harness and kill your enthusiasm for Unit Testing

    The same applies for .NET objects which only have properties (sometimes called ‘Info’ objects).

    In an ideal world you would have 100% test coverage, but in practice this is not going to happen. So spend the client’s money where it will add the most benefit i.e. writing tests for classes with complex state and behaviour.

    If your JavaBean becomes more interesting you can of course add a test case later. One of the common problems associated with Unit Testing / TDD is the mistaken belief that everything has to be perfect first time.

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

Sidebar

Related Questions

This should be simple but for some reason I'm stuck. I have data that
It should be simple, but it's not. I have a library that is hoping
This should be simple. I have an integer array that I want to encode
should be simple right? but have not found any anwsers :
It should be simple: Hook a MODEL_save_after event (or MODEL_save_before if that’s more appropriate).
This should be simple, yet I can't get it to work. I have a
This should be simple but I have never done it before and didn't find
That should be simple web site but with an editable tree. This tree will
This should be simple, but clearly I am missing the trick. I have a
This should be simple enough, but somehow my brain stopped working. I have two

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.