The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Thursday, July 30, 2020

I can't believe I didn't think of that—clarification

Over on Me­Linked­Insta­My­Face­In­Gram­Space­Book­We, my friend Brian commented “Cool! (Whatever it was exactly you did!!!)” about my work issue. Rereading that post, I think I can clarify a bit what I did. But first, a disclaimer: I'm not revealing any personal information here as all the data for the regression test is randomly generated. Names, numbers, it's all generated data.

So I ran the test and the output from that is a file that looks like (feature names changed to protect me):

ERR CNAM feature8 failed: wanted "VINCENZA GALJOUR" got ""
testcase =
{
  id = "3.0037",
  orig =
  {
    number = "2012013877",
    person =
    {
      business = "-",
      first = "VINCENZA",
      name = "VINCENZA GALJOUR",
      last = "GALJOUR",
    },
    feature9 = false,
    cnam = true,
    extcnam = false,
    feature4 = true,
    feature10 = false,
    feature7 = false,
    feature8 = true,
  },
  term =
  {
    feature10 = true,
    feature1 = false,
    feature2 = false,
    feature3 = false,
    feature4 = true,
    feature5 = false,
    feature6 = false,
    number = "6012013877",
    feature7 = false,
    feature8 = false,
  },
}

ERR CNAM feature8 failed: wanted "TERINA SCHUPP" got ""
testcase =
{
  id = "3.0039",
  orig =
  {
    number = "2012013879",
    person =
    {
      business = "-",
      first = "TERINA",
      name = "TERINA SCHUPP",
      last = "SCHUPP",
    },
    feature9 = false,
    cnam = true,
    extcnam = false,
    feature4 = true,
    feature10 = false,
    feature7 = false,
    feature8 = true,
  },
  term =
  {
    feature10 = true,
    feature1 = false,
    feature2 = false,
    feature3 = false,
    feature4 = true,
    feature5 = false,
    feature6 = false,
    number = "6012013879",
    feature7 = false,
    feature8 = false,
  },
}

Since the regression test is written in Lua, I found it easy to just dump the structure holding the test data to the file, given I already have have a function to do so. I also print out what failed just before the data for that particular test case. The code that prints the structure outputs valid Lua code. All I changed was adding an array declaration around the output, turned the error message into a comment, and changed testcase to a valid array index:

testcase = {
-- ERR CNAM feature8 failed: wanted "VINCENZA GALJOUR" got ""
[1] =
{
  id = "3.0037",
  orig =
  {
    number = "2012013877",
    person =
    {
      business = "-",
      first = "VINCENZA",
      name = "VINCENZA GALJOUR",
      last = "GALJOUR",
    },
    feature9 = false,
    cnam = true,
    extcnam = false,
    feature4 = true,
    feature10 = false,
    feature7 = false,
    feature8 = true,
  },
  term =
  {
    feature10 = true,
    feature1 = false,
    feature2 = false,
    feature3 = false,
    feature4 = true,
    feature5 = false,
    feature6 = false,
    number = "6012013877",
    feature7 = false,
    feature8 = false,
  },
}

-- ERR CNAM feature8 failed: wanted "TERINA SCHUPP" got ""
[2] =
{
  id = "3.0039",
  orig =
  {
    number = "2012013879",
    person =
    {
      business = "-",
      first = "TERINA",
      name = "TERINA SCHUPP",
      last = "SCHUPP",
    },
    feature9 = false,
    cnam = true,
    extcnam = false,
    feature4 = true,
    feature10 = false,
    feature7 = false,
    feature8 = true,
  },
  term =
  {
    feature10 = true,
    feature1 = false,
    feature2 = false,
    feature3 = false,
    feature4 = true,
    feature5 = false,
    feature6 = false,
    number = "6012013879",
    feature7 = false,
    feature8 = false,
  },
}
}

That way, I can verify my hypothesis with some simple Lua code:

dofile "errorlog.txt"
for _,result in ipairs(testcase) do
  if not (result.feature10 and (result.feature8 or result.feature4)) then
    print("hypothesis failed")
  end
end

Obligatory Picture

[The future's so bright, I gotta wear shades]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.