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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:34:45+00:00 2026-05-19T04:34:45+00:00

When writing unit tests, it is normally advisable to test the edge cases. However,

  • 0

When writing unit tests, it is normally advisable to test the edge cases.

However, are these the right sort of things?

  • Test the connection to the db is not open (assert an exception is thrown)
  • Assert that a table, which must always have >1 row, does so
  • Assert that a field which is required, is != null.
  • Assert that an ip has been set in the right format (I can parse the string to IP).

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-05-19T04:34:45+00:00Added an answer on May 19, 2026 at 4:34 am

    Your tests seem OK, but the phrase “edge case” normally refers to the tests and checks you need to do around the limits of the input.

    Say you have a column in your database that can accept 50 characters. Your edge case tests are:

    • Save a string of 49 characters – success
    • Save a string of 50 characters – success (or perhaps failure because of the null termination character, depending on your language)
    • Save a string of 51 characters – failure

    You can see that you are testing around and at the edges of your application where there are most likely to be errors. In this case there could be some confusion of the number of usable characters you can store which could cause errors in applications writing to your database.

    Other tests where you would test saving a string of 20 characters and saving a string of 100 characters (say) should be done but these are going to be more stable.

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

Sidebar

Related Questions

For writing unit tests, I know it's very popular to write test methods that
When writing unit tests, there are cases where one can create an Assert for
Two questions about unit tests. I've been writing unit tests for a while, however
I am writing unit tests in visual studio 2010. For test some functionality, I
I am writing unit tests to test an MVC application. How can I validate
I am writing unit tests in GHUnit test framework. I have a NSMutableDictionary detailsDict
When writing unit tests, do you place your tests inside the assembly you wish
I am writing unit tests for some of my code and have run into
In which parts of a project writing unit tests is nearly or really impossible?
Many people use Mock Objects when they are writing unit tests. What is 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.