libotr-ng icon indicating copy to clipboard operation
libotr-ng copied to clipboard

Refactor tests

Open claucece opened this issue 7 years ago • 4 comments

Why

A library should be correctly tested.

Reference

Please, refer to the test folder.

Tasks

  • [ ] Understand the scope of the test and remove what does not correspond to it.
  • [ ] Focus on creating tests that test overall functionality rather than unit test.
  • [ ] Think about what to expose for tests.
  • [ ] Check the variable names.
  • [ ] Remove repeated tests.
  • [ ] Remove or decide what to do with test test_api_messaging.
  • [ ] Check that everywhere real functionality is used: API tests should test the API, and not use "unit-like" functions on them.

Open questions

None.

claucece avatar Apr 10 '18 08:04 claucece

After discussing this, we have decided several things. Please add to this list if you remember something specific. We should refactor the tests to be a bit more factored. We also need to make a distinction between unit tests and functional tests. We should do these things:

  • [x] Create a new category of unit tests - either in a completely new directory, or using a naming convention like test_unit_client_profile.c
  • [x] Make it possible to run functional and unit tests separately
  • [x] Look at existing tests and move existing ones that look like unit tests into the newly created unit tests.
  • [x] Make it possible to run unit tests separately
  • [x] Make it possible to capture coverage information for unit tests only.

olabini avatar Sep 21 '18 22:09 olabini

I'll do the unit test refactoring and then unassign myself

olabini avatar Sep 22 '18 11:09 olabini

Thanks @olabini

claucece avatar Sep 22 '18 14:09 claucece

This is something we can tackle at the assembly at CCC. We should create tasks. But this can be a nice start for people in OTRv4.

claucece avatar Dec 07 '18 21:12 claucece