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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:38:49+00:00 2026-06-16T01:38:49+00:00

I have been two months on a one year old java/J2EE project, and every

  • 0

I have been two months on a one year old java/J2EE project, and every time the existing JUnit tests failed because of me, it was because the JUnit tests were outdated or wrong… So I am wondering “what’s the use of those tests if the only time they fail is because the name of a method has changed, or because they were done wrong”…

So… To what extent should we implement test cases, for what kind of methods? At what moment in the project and why? To sum up : any good practice to tell me about test cases ?

Thanks!

  • 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-06-16T01:38:50+00:00Added an answer on June 16, 2026 at 1:38 am

    you are asking ten questions, which can fill up a major book.
    I try to answer some:
    what
    Unit test are mainly for module tests, although they can be used for integration tests, too, the integration scope is secundary.
    when
    The inventor of unit test, introduced the term “test first” (write the test case in advance), because the sw developpers he knows were mostly lazy and undisciplined. If he would have recommended to test later, many test would never have been written.
    My approach is, test after you completed 30%, otherwise you dont have a useable structure to test. I call that “Test early approach”

    Usefull for
    Junit test are less usefull for User Interface tests, that will not work easily.
    Unit test are a bit difficult to write for modules that have a high integrational character, (central managing methods)
    For ther rest they are quite usefull. Especially they are obligate for algorithms mathematical formulas, all kind of calulations.

    One of the main advantages is that by writing unit test, you avoid time consuming debugging in real life code. The time you lose writing the unit test, that time you gain by avoiding that debugging.

    Up to a unit test coverage of 80% of the source code statements, Unit test do not create additional project costs.

    My experience showd, that even getter and setter should be unit tested, because that can be done in 2 minutes per class (uisng on testGetterSetter()). Last year whe had two serious bugs in setter and getter.

    if the only time they fail is because the name of a method has changed

    If you use eclipse refactor->rename, then the Unit case will be included in refactoring, as long as they are in the same project, which is recommendable.
    Of course can a chnage in source code cause the neccesity to adapt the unit case, src and unit test form together an unit.

    Finally one of the main advantages of unit test is, that when you create a new release that contain some changes, you still know that all your unit test run. This is especially importnt when you inherit work form colleagues, that left the company.

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

Sidebar

Related Questions

I have been writing javascript for one or two months , I never used
I have been developing in Android for approximately two months now. Yesterday, my eclipse
So, I have been trying to fix this for about two months. It all
I have two machines, one is an old toshiba laptop that I use at
I have an iphone app that has been downloaded in the last two months
Background: I am one of two developers on our team. We have been using
I have been working for several months on a RoR project with fellows university
I have been trying to join two tables (USERS AND USERS_ROLES) based on their
I have been coming across these two words more often but i didn't see
I have been trying for the past two days now to implement Admob ads

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.