
Use Mocking Framework – code cast
Blog post series
This blog post is part of a series about legacy coderetreat and legacy code techniques you can apply during your work. Please click to see more sessions about legacy code.
Code Cast
This is a code cast in Java.
In this code cast you can see how to start using mocking framework on an existing code base. Once we have an interface, we can start using the mocking framework to test external dependencies.
After extracting new and clear methods from the messy code and after extracting classes, we now have a code base with clearer dependencies. However, once we understood how to do dependency inversion, testing the core system becomes a bit more difficult. We need to write tests to show how the core system collaborates with the dependencies we inverted. For testing collaboration with inverted dependencies we use mocking framework.
Read here more about this concept in my blog post.
This 3-day advanced workshop is aimed to improve the knowledge of experienced programmers on how to evolve a software system. It is a practical workshop, with coding exercises and discussions around design options.
Evolutionary Design is the practice of growing a system in a natural way, by adding the minimum amount of code to satisfy the business needs in an iterative and incremental approach. When done right, the code structure changes continuously to optimize for change, thus allowing a constant speed of development for longer periods of time.
Recent Comments