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

  • Home
  • SEARCH
  • 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 274697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:38:59+00:00 2026-05-12T00:38:59+00:00

On Proggit today I was reading the comment thread on a submission entitled, Why

  • 0

On Proggit today I was reading the comment thread on a submission entitled, “Why Unit Testing Is A Waste of Time“.

I’m not really concerned with premise of the article so much as I am with a comment made concerning it:

The stem of the problem is that most “units” of code in business software
projects are trivial.

Change the size of the unit until it
is no longer trivial? Who the hell
defined the unit of code as a single
function or method anyway!?

and

Well, some of the guys I worked with
wanted to define a unit as single
functions. It was completely stupid.
My favorite definition of “unit” is:
the smallest piece of the code that
can be usefully tested.

Are we spending too much time just to Mock out some objects and test a trivial piece of code and not really adding anything of value?

What should a “unit” be when Unit Testing? Are function level tests too granular?

  • 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-12T00:38:59+00:00Added an answer on May 12, 2026 at 12:38 am

    It may seem trivial to quote Wikipedia, but I think it’s very succinct and accurate in this case:

    A unit is the smallest testable part of an application.

    This seems to agree with the comment in your question that a unit is “the smallest piece of the code that can be usefully tested”. In other words, make the unit as small as you possibly can such that it still makes sense to the developer/tester by itself.

    Often you will want to test parts of a project in isolation, and then test how they interact in combination. Having various tiers (levels) of unit testing is often a wise thing to do, as it helps insure that your code is working as it should on all levels, from individual functions up to entire self-contained tasks. I personally do not believe that it is wrong, or even unhelpful, to test individual functions, so long as they are doing something useful in themselves, which can often be the case.

    To be quite honest, there is no definite or rigorous definition of a “unit” in “unit testing”, which is precisely why the vague term “unit” is used! Learning what needs to be tested and at what level is a matter of experience, and quite often, simply trial and error. It may sound like a slightly unsatisfying answer, but I believe it is a sound rule to follow.

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

Sidebar

Ask A Question

Stats

  • Questions 252k
  • Answers 252k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Actually, it isn't quite true that you need .NET 3.5… May 13, 2026 at 9:38 am
  • Editorial Team
    Editorial Team added an answer I like the int Delete() myself. I can then tell… May 13, 2026 at 9:38 am
  • Editorial Team
    Editorial Team added an answer Here is an example of a ProgressBar Pager integrated with… May 13, 2026 at 9:38 am

Related Questions

I came across a reference to it recently on proggit and (as of now)
On the UNIX bash shell (specifically Mac OS X Leopard) what would be the
On my Vista machine I cannot install the .Net framework 3.5 SP1. Setup ends
On a recent Java project, we needed a free Java based real-time data plotting

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.