GSoC 2019 – Unit testing LibreMesh

Project introduction

LibreMesh as an embedded Operating System depends a lot on the underlying hardware. But, there are some parts of the code that don’t have that dependency, neither they depend on the network, or any particular state that the device could have. Also, there are many other cases were the states that one would like to achieve in order to reproduce a situation are complex or impractical to reproduce with hardware. In this project I will integrate a testing and mocking framework to LibreMesh and provide the functionality needed to easily write new tests for actual or new code. Also I will add tests for the core functions of LibreMesh.

Motivation

Unit testing the LibreMesh code-base will greatly help on approaching this two situations, and help having a much more robust solution for the communities it serves. Having automated unit testing integration test may improve the quality, the development speed, and shorten the release cycles of the LibreMesh software.

Also, having tests that safeguard the core functionality may allow new developers to engage with the code-base with more confidence.

For some developers (like me) having the option of doing test driven development greatly enhance the development experience. For reviewers it is also easier to understand and maintain code that has unit tests.

About me

I am Santiago Piccinini an Electronic Engineering student of University of Buenos Aires, Argentina. In my studies I focused on wireless, communication protocols, signal analysis, electronics prototyping and software development. I am currently finishing my master thesis.

I have been involved in different projects related to Community Networks, lately focused in the LibreRouter project.

This is my first GSoC, I wanted to participate for a long time!

Deliverables

  • Integrate unit testing and mocking framework to LibreMesh, that would allow the code-base to be tested with the specific lua version of the target system
  • Integrate tests with existing testing infrastructure (Travis CI)
  • Incorporate coverage reports and increase the coverage level of LibreMesh code
  • Proofread report of LibreMesh code testability, particularly what needs to be mocked of the code in order to be tested, and a rough idea of the complexity of the refactor needed.
  • At least one pull request of a refactor task for different levels of complexity as examples for the community to follow.
  • Try to write mocks for common functionality, for example:
    • Iwinfo
    • Nixio.fs, etc
    • Uci, lime.config
  • Write tests for some core functionality of lime-system package.
  • Refactor some LibreMesh code if needed for easy testing.
  • Add a device emulation module that provides specific mocking of device details (iwinfo, /sys/class/iee80211/, etc) to allow writing integration tests.

Next steps

I will start doing research about open-source Lua unit testing and mocking frameworks starting from this blog post https://blog.freifunk.net/2017/06/29/tdd-unit-testing-lua-openwrtlede-case/ from @nicopace. Next I will discuss with mentors about pros/cons of each framework and will propose a reasonable architectural solution to integrate this framework with some testing code as example and discuss with LibreMesh developers. If everything goes smooth then I will integrate it with Travis CI.

2 thoughts on “GSoC 2019 – Unit testing LibreMesh

Leave a Reply

Your email address will not be published. Required fields are marked *