# Best way to code and test changes on C++ modules

**URL:** <https://discourse.slicer.org/t/best-way-to-code-and-test-changes-on-c-modules/35069>\
**Category:** Development\
**Created:** [March 25, 2024, 7:53pm UTC](https://discourse.slicer.org/t/best-way-to-code-and-test-changes-on-c-modules/35069 "2024-03-25T19:53:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [March 26, 2024, 8:33am UTC](https://discourse.slicer.org/t/best-way-to-code-and-test-changes-on-c-modules/35069/2 "2024-03-26T08:33:37Z")

</div>

@randomizedid C++ code needs to be compiled and this cannot be avoided. `qt-loadable-modules` usually are not that time consuming when compiling them, if you can structure your development in this way you will experience shorter compilation times.

If you cannot structure your development in a `qt-loadable-module`, you can still speed up the building process. The Slicer building system is structured in many build targets. The default compilation is `all`, which will try to build everything (in practice, this will go through the files and check for changes, so it is not as time consuming as a fresh compilation…still, it takes a while). However, you can build a specific target (typically that part of Slicer where you have made changes; this should already avoid building code that is not related). There is even a `/fast` version of targets, which I believe won’t resolve dependencies (this can be risky if you don’t know what you are doing). Finally, you can use `ccache` ([Speeding up Slicer builds with CCache](https://discourse.slicer.org/t/speeding-up-slicer-builds-with-ccache/20497) and `ccache` tip in [GNU/Linux systems — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/linux.html#configure-and-generate-the-slicer-build-project-files)). I’m not sure `ccache` is available for Windows and MAC, but it is possible to use it on GNU/Linux systems.

---

_[View the full topic](https://discourse.slicer.org/t/best-way-to-code-and-test-changes-on-c-modules/35069)._
