martinsson / BugsZero-Kata

Practice Designing code for less bugs
86 stars 130 forks source link

Provide a result file with bug fixed #17

Open loicknuchel opened 5 years ago

loicknuchel commented 5 years ago

As mentionned in instructions-intermediate.md, there is some bugs/problems with the code :

Fixing theses will break the test, so it could be good to have a file with the correct output so we can switch on it when they are fixed

martinsson commented 5 years ago

True.

One file per step? I'm worried that people will fix all bugs in one go and not launch the tests in between.

The way I do this is see the tests fail, scrutinize the comparison difference that opens up, validate by copying the left side to the right side, then save. i.e. the standard way of working with a golden master.

How do you see this approach? What has your experience been while running the kata?

Regards, Johan Martinsson

Le mer. 17 oct. 2018 à 5:02 AM, Loïc Knuchel notifications@github.com a écrit :

As mentionned in instructions-intermediate.md, there is some bugs/problems with the code :

  • A player that get's into prison always stays there
  • bug with the money attribution, coins are added to the wrong player
  • typo (corrent instead of correct)

Fixing theses will break the test, so it could be good to have a file with the correct output so we can switch on it when they are fixed

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/martinsson/BugsZero-Kata/issues/17, or mute the thread https://github.com/notifications/unsubscribe-auth/AALHwNZWtAxhpOGzRApKqdIWQ0WmDqfuks5ulp2tgaJpZM4XjCe- .

-- @johan_alps https://twitter.com/johan_alps Blog: Better code and tests http://martinsson-johan.blogspot.fr/ Brown-bag-lunch proposals http://www.brownbaglunch.fr/baggers.html#Grenoble

loicknuchel commented 5 years ago

Ok, I see. As I didn't use the ApprovalTests in Scala, it was very painful to see the diffs, so we used the test only as red/green indicator. We missed a source of truth with fixed bugs so we fixed them only when it was very easy: https://github.com/loicknuchel/BugsZero-Kata/commit/48d7ca19241deedae232f2923fd46b1871378bd7

I think having a result file with all bugs fixed don't prevent people to fix them one by one and validate at the end with it.

martinsson commented 5 years ago

That's an interesting experiment to try out. If you'll have the opportunity to try it out in scala I can merge the corresponding MR. But I'd like to try an experiment in one language and perhaps improve it before generalising the concept. What do you think?

One thing about it though is that the files will be language specific, because even the same seed to the randomizer will produce different results. Not a problem of course we'd just need files in each language directory.