Block / unit testing

does anyone here do this? it is huge for compliance purposes in the corporate world. but let me give an example. in excel, for instance, if I want to know what an array would output before I run the code and do damage because I’ve coded too long during any given day, I would write this:

function test_array_out_first()

dim a() as string
dim start as long
dim finish as long
dim counter as long
dim r as range
dim s as string
dim sIn as string
dim sOut as string
dim sTemp as string
const spaceDbl as string = "  "
const space as string = " "

set r = range("a1")
s = r
a() = split(s, " ")
finish = ubound(a)
start = 0

   for counter = start to finish
      sIn = a(counter)
      sTemp = replace(sIn, space spaceDbl)
      sOut = sOut & sTemp
   next counter
      debug.print sOut

set r = nothing

end function 

then, if that goes fine and I see what I want, I would change it to this (ending only):

   for counter = start to finish
      sIn = a(counter)
      sTemp = replace(sIn, space spaceDbl)
      sOut = sOut & sTemp
   next counter
      ''''PRINT OUT TO AN I/O FILE HERE

so my question for people here is, can more sophisticated dev tools do this same thing in this same very simplistic manner? I have an issue with over-complication that comes from corporate devs who know too much. My life is very simple and I try to make things as simple as possible. I don’t live in a big city ghetto or corporate big tech tower. that’s why. =) thanks!

this is sort of a follow up to this thread by me: Best "navigatable" IDE you know of

Well, are you talking about MySQL? In that, you can test and use COMMIT/ROLLBACK functions. This allows you to test if commands work and if they do commit the process and if they fail, rollback the database to it’s full status before you test.

Another way is to just use a “VIEW” of the database table. You can create a view using your query, then check it for it’s accuracy and if it fails remove the view and if it works, update the table with the view data.

If you are talking about PHP, you would need to create the correct code to handle whatever you want.

i’m talking about ALL languages ernie. i’m talking about writing applications with all types of languages. this question has nothing to do with databases. are you following me now? =) do you know what I’m asking about now? I can link an excel file XLSM to my next post if you want and everyone else wants to see what I’m talking about.

Sponsor our Newsletter | Privacy Policy | Terms of Service