How I write characterization tests
01-Mar-2019 2443
Let’s say I come across a piece of code that I want to refactor but unfortunately a) I don’t understand what it does and b) it’s not covered by tests. Refactoring untested code I don’t understand that’s not tested is risky business. But how can I write tests for the code if I don’t even know what it’s supposed to do?Luckily there’s a technique called Characterization Testing, which I first discovered from Michael Feathers’ book, which makes solving this challenge pretty straightforward and easy. I’m going to show you how I do it.
How I write characterization tests #ruby #rubydeveloper #rubyonrails #write #characterization #tests #tests https://rubyonrails.ba/link/how-i-write-characterization-tests