HomeGenie Forum

Development => Feature request => Topic started by: Bounz on April 15, 2017, 08:12:40 AM

Title: ZWaveLib + UnitTests (a call to developers)
Post by: Bounz on April 15, 2017, 08:12:40 AM
Hi!

Recently I found out that Sigma Designs partly opened ZWave protocol specification to the public (thanks to this forum). So I decided to cover ZWaveLib (used in HomeGenie and developed mostly by Gene) with unit tests to be sure that it conforms the standards.

Now I'm writing tests for command classes, from the bottom of the list to top. I'm adding comments to classes and to the tests with references to the documentation and also add new methods, that should be implemented, but were not implemented yet. I also did some refactoring to make code testable and more readable, so right now it's not 100% compatible with MIG library. At the end of this rework, I will need to tune up MIG library to use the new version of ZWaveLib. But I'm trying to make things backward compatible and mark deprecated methods with ObsoleteAttribute.

I configured automatic building, testing, and test covering with Appveyor and Codecov.
If you are a developer and could contribute to this activity - I encourage you to do so.

Here is the link to my fork of repository https://github.com/Bounz/zwave-lib-dotnet/tree/zwavelib-tests.
Title: Re: ZWaveLib + UnitTests (a call to developers)
Post by: pim555 on April 15, 2017, 10:26:38 AM
Sounds great. Have been looking into this as well but my coding skills are not sufficient to do this...Happy to help in testing when ready. I have a mix of various X10 and Z-wave devices in my set-up running on RPI3 +Razberry + CM15pro.

Best
Pim
Title: Re: ZWaveLib + UnitTests (a call to developers)
Post by: dani on April 21, 2017, 11:08:05 AM
Hi Bounz,

I can help you for some tests, I am senior developper in C#.
I will download your github project, then I can make some tests for you and correct some issues in ZWaveLib, I have found with my nodes. I transmit those to Gene some time ago but no answer.

Cheers
Dani 
Title: Re: ZWaveLib + UnitTests (a call to developers)
Post by: Bounz on April 21, 2017, 11:40:44 AM
Hi dani,

Glad to hear, that you can join me in this task.
Please, start writing tests to command classes from the top of the list: Alarm, Association and so on.
Also, I really recommend you to use official documentation from http://zwavepublic.com/specifications (http://zwavepublic.com/specifications)

PS. Looks like they have updated their documents, so document numbers in my comments are not relevant.
Title: Re: ZWaveLib + UnitTests (a call to developers)
Post by: [email protected] on April 22, 2017, 11:11:13 AM
Nice work, I don't have Zwave so wont be much use but I am still trying to learn unit testing in c# having now done a lot of testing using pester for powershell..
Title: Re: ZWaveLib + UnitTests (a call to developers)
Post by: Bounz on April 22, 2017, 11:19:20 AM
Wow, a BDD-style testing framework for PowerShell! I have never heard about it.
If you want to know more about unit testing in C# I can recommend you to read "The Art of Unit Testing" book by Roy Osherove (https://www.amazon.com/Art-Unit-Testing-examples/dp/1617290890 (https://www.amazon.com/Art-Unit-Testing-examples/dp/1617290890)).