Author Topic: Developers: Some observations about the codebase.  (Read 1736 times)

0 Members and 1 Guest are viewing this topic.

Offline liondani

  • Hero Member
  • *****
  • Posts: 3737
  • Inch by inch, play by play
    • View Profile
    • My detailed info
  • BitShares: liondani
  • GitHub: liondani
  I also noticed that several of the classes are very large with dozens of methods each, and frequently the methods themselves are quite long - this makes testing them very difficult.

the good news is, it will be hard for NSA also...  :P

Offline bytemaster

We have a set of regression tests in the "tests" directory, but you are correct that the number of tests need to be greatly increased. 

Right now our single biggest testing challenge is enumerating all of the possible inputs which I do not think is possible. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.


Offline CrazyCriple

  • Full Member
  • ***
  • Posts: 51
    • View Profile
Hi Guys,

I'm fascinated with your idea for BitUSD, so I recently bought some BTSX on an exchange and then downloaded the wallet to start experimenting.  Because my wallet kept crashing, I started looking at the bitsharesx codebase on github.

There seems to be some missing tests.  I can't find tests for many of the classes.  I also noticed that several of the classes are very large with dozens of methods each, and frequently the methods themselves are quite long - this makes testing them very difficult.  If you could  refactor these large classes and methods into a more manageable object model, i.e., extract out new classes from the large ones so you have more classes, smaller classes, with fewer methods, it'll be a lot easier to test them.

Ideally, from the perspective of an investor, I'd love to see a TDD approach with the goal of 100% test coverage.  In that scenario I believe that many of the bugs users are experiencing would be avoided, and investor confidence would soar.

I haven't programmed in C++ for over a decade so maybe the tests are there and I just missed them.  In that case, feel free to kick me in the head and point me in the right direction :)

 +5%

Even with the TDD approach it will be hard to get 100% Test Coverage. 70%-80% is more than enough I feel. I don't know c++ so I don't know how difficult it is to mock or stub dependencies but I can imagine it is allot harder then in c#.

Offline bodenliu

  • Full Member
  • ***
  • Posts: 82
    • View Profile

Offline MartianMouse

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hi Guys,

I'm fascinated with your idea for BitUSD, so I recently bought some BTSX on an exchange and then downloaded the wallet to start experimenting.  Because my wallet kept crashing, I started looking at the bitsharesx codebase on github.

There seems to be some missing tests.  I can't find tests for many of the classes.  I also noticed that several of the classes are very large with dozens of methods each, and frequently the methods themselves are quite long - this makes testing them very difficult.  If you could  refactor these large classes and methods into a more manageable object model, i.e., extract out new classes from the large ones so you have more classes, smaller classes, with fewer methods, it'll be a lot easier to test them.

Ideally, from the perspective of an investor, I'd love to see a TDD approach with the goal of 100% test coverage.  In that scenario I believe that many of the bugs users are experiencing would be avoided, and investor confidence would soar.

I haven't programmed in C++ for over a decade so maybe the tests are there and I just missed them.  In that case, feel free to kick me in the head and point me in the right direction :)