cll-sim icon indicating copy to clipboard operation
cll-sim copied to clipboard

More convenient & powerful checking.

Open o-jasper opened this issue 10 years ago • 1 comments

Having to refer all the way down assert self.contract.storage[index] == is a bit tiresome, and also we dont check all the things that shouldnt change. I propose we want ability to easily:

  • declare what values should be:
    • for consequentive array entries(also change by certain factor/addition)
    • for values that are zero
  • declare that a value has changed by a certain factor or addition.
  • for balances, declare change-by-addition excepting fees
  • track changes
    • declaring things shouldnt (have) change(d)
    • declaring nothing change(d) other than specified
    • exceptions to the above
  • track transactions
    • how many of them
    • any of their attributes, as (non)specific as desired.
  • how it stopped, or the whole 'logic path'

With the latter i mean, now we check simulation.stopped, we could instead have .cll(heard name .hll floating around too?) files scan for comments besides those on stop, and make a list. Then you could check that entire flow.

jorisbontje mentioned testing libraries. (pytest, nosetest or unittest) To be honest i am not familiar about them, or how they fit in.

o-jasper avatar Apr 01 '14 12:04 o-jasper

Good suggestions, hard to address specifics since there are so many :)

A couple of your suggestions are already implemented as part of .load: see the subcurrency example for the stop comments / assertion; which are based on comments after the stop statement in the .cll file.

Shortcuts for some of these checks would be great. I'd prefer to implement them on top of an existing Python unittest framework over (further) building my own.

Full code traces are interesting for debugging, but enforcing fixed code paths makes your tests hard to maintain.

As for the .cll to .hll rename, I am waiting on the naming dust to settle a bit; maybe it will be called .pll next week :)

jorisbontje avatar Apr 01 '14 13:04 jorisbontje