Documentation‎ > ‎Development‎ > ‎Getting Started‎ > ‎

Creating a new class

What is the optimal way of starting something new in OctoMY™ project source code?

We try to fully embrace test driven development (TDD), so every new feature you start begins with creating a new test project for that feature. In OctoMY™ project this is very simple thanks to a clever little script. More on that below.
  1. Have your environment set up correctly, and build + run the relevant part of application on the platform you are currently targeting to make sure everything is right from the get-go. TODO: Link to the relevant documentation for  building.
  2. Open terminal and go to <octomy project folder root>/test and start the script ./ with the name of your feature in CamelCase as the only parameter. Example: ./ MyNewFeature
  3. Open the main test project file and add the name of your new test to the end of the list or test projects and save. Wait for QtCreator to catch up.
  4. Open the testMyNewFeature.cpp file from the new testMyNewFeature project that has magically shown up in the project explorer in QtCreator.
  5. Start writing the code that implements your new feature in this file and the matching .hpp file, and for each relevant testable part create a new test*() slot in the TestMyNewFeature class that exercises that part of the code. To learn how to write the test code, use the excellent QTest documentation.
  6. Once the new features have matured to a point they are useful in their own right, simply migrate them their own properly named and placed source files, and simply include the correct headers into the test project so that the test will continue exercising the code.