Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Developers: Some observations about the codebase.  (Read 353 times)

0 Members and 1 Guest are viewing this topic.

Offline MartianMouse

  • Newbie
  • *
  • Posts: 2
    • View Profile
Developers: Some observations about the codebase.
« on: September 02, 2014, 05:31:05 AM »

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 :)

Offline bodenliu

  • Full Member
  • ***
  • Posts: 82
    • View Profile
Re: Developers: Some observations about the codebase.
« Reply #1 on: September 02, 2014, 05:46:23 AM »
hope the dev look into this

Offline CrazyCriple

  • Full Member
  • ***
  • Posts: 51
    • View Profile
Re: Developers: Some observations about the codebase.
« Reply #2 on: September 02, 2014, 07:09:49 AM »
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 suwoder

  • Sr. Member
  • ****
  • Posts: 206
    • View Profile
Re: Developers: Some observations about the codebase.
« Reply #3 on: September 02, 2014, 09:24:43 AM »
 +5% +5%

Offline bytemaster

Re: Developers: Some observations about the codebase.
« Reply #4 on: September 02, 2014, 01:04:07 PM »
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 liondani

Re: Developers: Some observations about the codebase.
« Reply #5 on: September 02, 2014, 01:34:03 PM »
  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
  https://bitshares.OPENLEDGER.info/?r=GREECE  | You are in Control | BUY | SELL | SHORT | SWAP | LOAN | TRADE |  

 

Google+