flaviostutz / ruller-dsl-feature-flag

A feature flag engine that can be used to enable, change or rollout features of a system dynamically based on system or user attributes
MIT License
2 stars 6 forks source link

Add unit testing #9

Open eabili0 opened 4 years ago

eabili0 commented 4 years ago

After a deep reading of the code because of issue #4, I think the code as it stands today is not maintenance friendly. The addition of unit testing is advisable.

flaviostutz commented 4 years ago

This is very important for the project sanity!

flaviostutz commented 4 years ago

Do you guys know about fuzzy testing? It is the kind of thing we have to implement in this project because of the way it works (string replaces).

I was working on a project these days (https://github.com/tsenart/vegeta) and they perform random tests to the library. It is amazing. See an example at https://github.com/tsenart/vegeta/blob/master/lib/results_test.go TestResultEncoding(..).

It runs tests in a loop, but each time with a different randomized set of input parameters, all accounting on the Go test framework, so if a single test fails, the reporting shows exactly what was being run.

There are other fuzzy test libs. There is a "Trophy" section in this one https://github.com/dvyukov/go-fuzz that blowed my head up! The guys run various important projects agains its library, found some bugs and got them fixed!

flaviostutz commented 4 years ago

@abilioesteves @milhomens @jairsjunior @tiagostutz

What do you think?

eabili0 commented 4 years ago

First time I'm reading about this. Quite awesome indeed!

I need to digest and experiment with it a little bit more to give my 50c in this discussion.