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

Should be pretty simple: I have an InputStream where I want to peek at
This should be a really really simple thing, but for some reason it is
should be simple enough but it's causing me a couple of issues. I have
should be simple right? but have not found any anwsers :
This should be simple to answer. When I have a variable, say $id, and
This is one that should be simple, but since I'm rather new to the
Should be simple and quick: I want a C# equivalent to the following Java
My scenario should be simple... the type I want to convert FROM is ALWAYS
I know this should be simple and I should know it but it's eluding
This should be a simple question, but I haven't been able to find a

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.