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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:01:49+00:00 2026-05-15T10:01:49+00:00

Intro: I’ve seen lots of topics here on SO about software testing and other

  • 0

Intro:
I’ve seen lots of topics here on SO about software testing and other terms I don’t understand.

Problem:
As a beginner developer I, unfortunately, have no idea how software testing works, not even how to test a simple function. This is a shame, but thats the truth. I also hope this question can help others beginners developers too.

Question:
Can you help me to understand this subject a little bit more?

Maybe some questions to start would help:

  • When I develop a function, how should I test it? For example: when working with a sum function, should I test every input value possible or just some limits? How about testing functions with strings as parameters?
  • In a big program, do I have to test every single piece of code of it? When you guys program do you test every code written?
  • How automated test works and how can I try one? How tools for automated testing works and what they do?
  • I`ve heard about unit testing. Can I have a brief explanation on this?
  • What is a testing framework?

If possible please post some code with examples to clarify the ideas.

Any help on this topic is very welcome! 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-15T10:01:49+00:00Added an answer on May 15, 2026 at 10:01 am

    Let’s start with the obvious:

    How does testing work ? In test-driven development you first think about the functionality you want to implement and then write a test for it. In the example you gave of a sum function it is quite obvious what it should do. You then write a test that makes sure that the summation worked.

    Unit tests should be as lightweight as possible so you can run them each time you hit the build button. When you do this now in this example your test will fail, because you have not yet implemented a sum function.

    Now you write the actual function and continue debugging and implementing until the test passes. Then you are sure you have implemented the feature you wanted.

    Now how should you design your test ? You cannot test all, that is impossible. As an example lets say you take user input you have to validate. Then it would be a natural thing to write at least two test cases for that validation code: one that makes sure that valid input is parsed as such. The second test case gets invalid input and you make sure that it fails, raises an exception or whatever behavior you desired. So in this case it is good to have a positive test which is expected to pass and a negative test which checks if invalid input is not validated.

    When should one test? As I mentioned before the test should be lightweight enough so that they can be run on each build. And yes, run all of them. This makes sure that you do not miss a dependency in your code that breaks things far away from the point you edited.

    Can anything be tested ? Well, usually methods that rely on external ressources are hard to test. What I mean by that are databases, network connections or specific hardware and drivers. It can be done but then you have to set up a larger test setup.

    Bugfixing and tests A typical scenario where test get really useful is if you are squeezing bugs. Not literally of course. If you have a bug you have to fix, first try to write a test for it. And then fix your code until your test passes. From this point on this test “watches over your code” that this bug will never come back again.

    What do you gain by testing ? In my opinion there are many things

    1. More modular, easier to maintain code because it has to be testable
    2. Confidence. Having a code base that is largely tested gives you the confidence that it works as expected and stays like this.
    3. You find bugs early. This means you can fix them more easily.

    It takes some effort to get used to using tests but I think it is worth it. Especially if you are writing libraries of some kind.

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

Sidebar

Related Questions

Intro Here is an example to illustrate the problem. Consider I am tracking and
intro: I am pretty sure this is my fault. But I just don't see
Boring intro: I know - DDD isn't about technology. As i see it -
problem intro: Dead Island game crashes once save file exceeds certain file size. Files
On the discussion of dynamic memory here: Intro to C Pointers and Dynamic Memory
Intro to problem: I am given recipes how to craft items. Recipe is in
Directly under this small intro here you'll see the layout of the database tables
Intro : I'm trying to migrate our Trac SQLite to a PostgreSQL backend, to
Intro: I successfully implemented a WCF Service hosted in a Windows Service a few
Intro I work in a facility where we have microscopes. These guys can be

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.