cat /home/markus/gsoc/2019/fem_testing/devlog

# Community Bonding Phase

May 5-24: Reherse testing theorie material of my university course last year.

May 10: Search FreeCAD source code for existing testing solutions that I potentially missed till now. I couldn't find anything besides lots of python unit tests.

May 12-16: Work with the Fem Workbench to get up to date about the current state of the Workbench.

May 19: Start Testing Tool Survey with the purpose of finding out which tools and frameworks are liked by the community and which aren't.

May 24: Setup development environment on Arch Linux.

May 26: Setup devlog on github pages.

# Coding Phase 1

May 28: Create simplified version of FreeCAD runtime components for future prototype development. Code is avaliable on GitHub. For more information please read the FreeCAD Forum post.

May 29: Publish second part of the testing tool survey concerning the C++ unit test library on FreeCADs Forum. Add more runtime components (Document and Object) to prototype repository.

May 30: Add tests to the prototype repository. Implement test runner for C++ using Google Test. Try out different configuration for test suites (multiple binaries vs single binary, combined test execution of C++ and Python, ...).

June 3: Trying to untangle the Base and App source code to figure out the best way on how to test DocumentObjects. For that I must define what exactely defines the behaviour of one Object in isolation. I'm going to share my results this week.

June 4: Write a little summery about the type system of FreeCAD and some other basics. This helps me understand the topic better and of course I'm going to share it with the FreeCAD community and if they find it helpful I can also put it on the wiki.

June 5: Do reading on cmake to figure out the build system of FreeCAD. I also digged around in the FreeCAD source a lot. After that I wrote a new CMakeLists.txt file for a (not jet written) test binary.

June 6: Write first version of a google test binary for the Fem workbench. See commit 85b290636 on my testing branch. Be aware that I rebase that branch frequently which means that you have to use --force often.

June 11: Write specification (source documentation) for the Analysis Document Object. I also deleted a few overrides that did basically nothing (implementation of the base class have the same effect). Based on that specification I wrote a few (two :P) tests and started writing a test support library that should be useful for all C++ tests in FreeCAD. See commits 1a244a88c, e7b3bc2d8, 94f60f01a.

June 11: Write specification (source documentation) for the Analysis Document Object. I also deleted a few overrides that did basically nothing (implementation of the base class have the same effect). Based on that specification I wrote a few (two :P) tests and started writing a test support library that should be useful for all C++ tests in FreeCAD. See commits 1a244a88c, e7b3bc2d8, 94f60f01a.

Unfourtionately I was sick for a week so not much happend during that time. I used the time to read up on some related stuff like testing theorie, cmake build system and I also worked a bit on my notes on the FreeCAD source. I try to make up for the lost time by working a few weekends.

June 19: Fix documentation so that it looks good in doxygen. I also wrote my own doxygen config because in my opinion the default is overly complicated. It displays so much information (that is not needed imo) that it gets hard to find stuff. It only includes documented C++ source (no undocumented stuff and no python) I currently host my version of the documentation on github. Here are two classes I documented: Fem::FemAnalysis and DocumentTest.

June 20: Implement missing FCTest functions. Add documentation and tests for FCTest library. See commits: 555c537, 8935576 and a7f6589.

June 21: Study code related to FreeCADs ViewProvider and the Part module. The Part module relies heavily on components of App and Base. This was done as a preparation for writing tests for Fem::Constraint and the Mesh framework of the Fem module.

June 24: For future tests of FemConstraint a few comperators and std::cout support was added to the FCTest library. The operators can compare opencascade vectors with FreeCADs vectors directely with ==. This is handy for google tests ASSERT_EQ and ASSERT_NE macros. The output support enables google test to print better debug messeges when a test fails (it displays the value of the two operands). See commit ae62ae9.

June 25: The DocumentTest::addObject function makes it easier and less error prone to add Document Objects for testing purpose. The function is documented and tested. See commit 0ac25dd.

June 26: Add tests for App::Constraint. App::Constraint is the base class for all constraints of the Fem module. It provides a few unitily functions and properties for its subclasses. See commit e93efd6.

June 27: Fix the build system and tests to work on ubuntu and better integrate into the existing build system. I'm developing on Arch Linux so there where a few issues. See commits 730835c and 85d6c14.

Juli 1: Assess state of python unit testing situation of the Fem Module. There are already a number of unit tests in the femtest package. State of the test is not the best because most just fail on error and don't assert the actual output.

Juli 2: Start testing progress for python command line only tests (App). Write documentation for the femtools package. See commit fd6857e.

Juli 4: Work on python documentation using a separate doxygen website (separate from the C++ API documentation) to reduce confusion when using the docs. If you visite my doc page on github you'll notice that there is now a context sensitive C++ or Python button in the menu bar which switches between the two doc instances. I also worked on a alternative using sphinx for python and doxygen for C++ which is much more promising in my opinion (use the best tools for the jobs respectively) but it isn't yet online.

Juli 7: Change organisation of C++ unit tests. The test runner and support code is now directely below src/ in the src/Test folder. I think this is a good place for now. Tests are collected via cmake object libraries which are only fully supported till cmake 3.12. I probably have to find a less elegant solution involving cached cmake variables to avoid having to bump the required cmake version from 3.3 to 3.12. See commit: a6fcff7.

Juli 9: Add python support library to FreeCAD analog to the library I created for C++. Also very small atm. See commit: 6f60a43.

Juli 10: Add python unit tests for the femtools package. They can be executed with the following command: ./bin/FreeCADCmd -t femtest_new.test_tools. See commit e371c94.