Testing Legacy Code: Hidden Dependencies
Corneliu Dascalu

Nice article indeed, is something usually is not treated and is tremendously important. As junior I do not get 2 points: 1)what does it means” The four parameters of the buyPizza() method could be encapsulated in a small class, to improve the clarity of the code” 2) if OrderFactory would be passed as dependency into the constructor the code would of buyPizza(…) would be maybe: without the line `OrderFactory factory = new OrderFactory();` but maintaining the entire line `Order order = factory.createOrder(userId, name, count);` is that correct? Thanks Corneliu

Like what you read? Give Giovanni Perrotta a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.