[Starlingx-discuss] Unit tests first!!!

Wensley, Barton Barton.Wensley at windriver.com
Fri Jan 31 19:25:55 UTC 2020


Hey everyone.

Following on the success of our recent StarlingX test hack-a-thon, I'd like to remind everyone about our goal to submit unit tests along with new (or changed) code.

As a core reviewer for many of our projects, I often see new code being put up for review with no unit tests. At that point, you have working code and it feels like going back to write unit tests is a lot of effort (and it can be). To avoid this, I would highly recommend that you write (and execute) your unit tests BEFORE doing any testing on hardware (or virtual) labs. This has big advantages:

*         The unit tests catch many errors in the code and the test cycle (running tox) is extremely short. This saves time when you do get to the point of testing on hardware because you will be dealing with far fewer bugs.

*         Many error conditions are very easy to catch with unit tests and either very time consuming (or impossible) to test on hardware. In this case, the unit tests are a big time saver and result in better quality code.

So... my advice is to write your unit tests up front whenever possible. This saves time vs. writing them after you have already done your hardware testing (or worse - after your review has been given a -1 due to missing unit tests). If you have questions about what unit tests would be expected for a particular change or how to write them, contact one of the cores for the project you are working on - they will be happy to help.

Bart

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.starlingx.io/pipermail/starlingx-discuss/attachments/20200131/de57c411/attachment.html>


More information about the Starlingx-discuss mailing list