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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:41:35+00:00 2026-05-30T06:41:35+00:00

I maintain a Python program that provides advice on certain topics. It does this

  • 0

I maintain a Python program that provides advice on certain topics. It does this by applying a complicated algorithm to the input data.

The program code is regularly changed, both to resolve newly found bugs, and to modify the underlying algorithm.

I want to use regression tests. Trouble is, there’s no way to tell what the “correct” output is for a certain input – other than by running the program (and even then, only if it has no bugs).

I describe below my current testing process. My question is whether there are tools to help automate this process (and of course, if there is any other feedback on what I’m doing).

The first time the program seemed to run correctly for all my input cases, I saved their outputs in a folder I designated for “validated” outputs. “Validated” means that the output is, to the best of my knowledge, correct for a given version of my program.

If I find a bug, I make whatever changes I think would fix it. I then rerun the program on all the input sets, and manually compare the outputs. Whenever the output changes, I do my best to informally review those changes and figure out whether:

  1. the changes are exclusively due to the bug fix, or
  2. the changes are due, at least in part, to a new bug I introduced

In case 1, I increment the internal version counter. I mark the output file with a suffix equal to the version counter and move it to the “validated” folder. I then commit the changes to the Mercurial repository.

If in the future, when this version is no longer current, I decide to branch off it, I’ll need these validated outputs as the “correct” ones for this particular version.

In case 2, I of course try to find the newly introduced bug, and fix it. This process continues until I believe the only changes versus the previous validated version are due to the intended bug fixes.

When I modify the code to change the algorithm, I follow a similar process.

  • 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-30T06:41:36+00:00Added an answer on May 30, 2026 at 6:41 am

    Here’s the approach I’ll probably use.

    1. Have Mercurial manage the code, the input files, and the regression test outputs.
    2. Start from a certain parent revision.
    3. Make and document (preferably as few as possible) modifications.
    4. Run regression tests.
    5. Review the differences with the parent revision regression test output.
    6. If these differences do not match the expectations, try to see whether a new bug was introduced or whether the expectations were incorrect. Either fix the new bug and go to 3, or update the expectations and go to 4.
    7. Copy the output of regression tests to the folder designated for validated outputs.
    8. Commit the changes to Mercurial (including the code, the input files, and the output files).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to maintain/update/rewrite/fix a bit of Python that looks a bit like this:
I have a Python program that takes around 10 minutes to execute. So I
I maintain a project that has a function definition similar to this: def f(a,
I have a python program that processes image frames with Python 2.7, PIL, OpenCV,
I use cvs to maintain all my python snippets, notes, c, c++ code. As
I maintain the build system at my company, which is currently using CVS. This
I maintain an applet that helps users to upload photos to our service. The
I maintain a few Python packages. I have a very similar setup.py file for
What are the current rules for writing python code that will pass cleanly through
I've got some example Python code that I need to mimic in C++. I

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.