Open source and epicurus project

Epicurus is my current open-source software that I'm working on.

It started as a tool to generate mutation tests configuration based on git commits diff, to avoid overloading on CPU and results in slow mutation tests.

After some time, I started mentorship about software architecture and because of that, I learned some precious lessons.


First lesson

I thought a lot and structured the project only to generate Stryker configuration, copying the configuration file and recreating this file, putting the modified files in mutate: [] array. This process took me some time thinking a lot about how to do that in a safer way because I have to modify a file on the fly. After some researches, I discovered that the idea is not the best path to follow in the project. If Stryker changes the way to pass the files I have to mutate, I need to reformulate the code, the maintenance cost is too high.

Do I really need to modify the file? It's the question rounding my mind.

After the first talk with my mentor, they brought some ideas that blew my mind.

Instead of modify the file, what do you think about use the Stryker CLI? Do they have some flag to pass files you want to mutate? If yes, we can use that!

And they have the flag! It's all we want to fast-forward the project! It can see more in the documentation.

Scope changed

Now with this new possibility, I changed the scope of the project. Removed all code about modify configuration files, and refactored to only return the modified files in this format: modifiedFile1.js,modifiedFile2.js


Second lesson

With the change of the scope, I discovered the Epicurus is not more specific to Stryker, but should be applied in different projects. To use with Stryker, I can only do this command in terminal:

$ npx stryker run -m $(epicurus)

Based on Unix philosophy, I basically build a modular software to retrieve modified files and use the result to run my mutation tests at Stryker.

I can use Epicurus in another contexts because there is modular and minimalist software.


Third lesson

With this new structure, I have to refactor some things.

My constructor has this code:

 constructor({ dirDepth = '../../../', dir = 'src', format = ',' } = {}) {
    this.dirPath = path.resolve(`${__dirname}`, dirDepth);
    this.dir = dir;
    this.format = format;
  }

My idea with this code is when you use epicurus CLI you can decide the dirDepth , dir and format , but my mentor says when I put on this way, in the constructor, I need to instantiate another object to change dirDepth, dir and format. For my scope, it's not a bad thing, but for another project could be a problematic thing. He suggests me to pass these arguments to the method responsible for that, in this case fiilterFiles and getFilesFromDir .


You'll only receive email when they publish something new.

More from jess