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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:41:43+00:00 2026-05-13T23:41:43+00:00

I want to begin unit testing our application, because I believe that this is

  • 0

I want to begin unit testing our application, because I believe that this is the first step to developing a good relationship with testing and will allow me to branch into other forms of testing, most interesting BDD with Cucumber.

We currently generate all of our Base classes using Codesmith which are based entirely on the tables in a database. I am curious as to the benefits of generating test cases with these Base classes? Is this poor testing practices?

This leads me to the ultimate question of my post. What do we test when using Unit Tests?

Do we test the examples we know we want out? or do we test the examples we do not want?

Their can be methods that have multiple ways of Failing and multiple ways of Success, how do we know when to stop?

Take a Summing function for example. Give it 1,2 and expect 3 in the only unit test.. how do we know that 5,6 isn’t coming back 35?

Question Recap

  • Generating unit tests (Good/Bad)
  • What/How much do we test?
  • 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-13T23:41:43+00:00Added an answer on May 13, 2026 at 11:41 pm

    The point of unit tests is to give you confidence (but only in special cases does it give you certainty) that the actual behavior of your public methods matches the expected behavior. Thus, if you have a class Adder

    class Adder { public int Add(int x, int y) { return x + y; } }
    

    and a corresponding unit test

    [Test]
    public void Add_returns_that_one_plus_two_is_three() {
        Adder a = new Adder();
        int result = a.Add(1, 2);
        Assert.AreEqual(3, result);
    }
    

    then this gives you some (but not 100%) confidence that the method under test is behaving appropriately. It also gives you some defense against breaking the code upon refactoring.

    What do we test when using Unit Tests?

    The actual behavior of your public methods against the expected (or specified) behavior.

    Do we test the examples we know we want out?

    Yes, one way to gain confidence in the correctness of your method is to take some input with known expected output, execute the public method on the input and compare the acutal output to the expected output.

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

Sidebar

Related Questions

I'm developing an application in WPF and I want to know how to begin
I want to match expressions that begin with ${ and end with } in
I want to loop over the files that begin with '.' in directory x
I want to start unit testing my javascript files as part of my build
I am very new in Java Unit Testing and I heard that Mockito framework
i've this component that i want to use it in a DLL to achieve
I want to begin using DBForge and migrations class thats built into CI but
I want to copy files that have timestamps from the time the script begins
a want that, he found all select elements with id than begins with 'chbTypes'
I want to minimize a Delphi application to the systray instead of the task

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.