I am working with java and I have a method that runs a simulation. The simulation just adds and removes elements from an array. I have unit tested both add and remove methods, but I am not sure if I should test also the method that runs the simulation.
Share
Yes, it sounds like you should test your simulation. Ideally, you should test every non-trivial piece of application code that you write.
If you don’t write tests for your simulation and you later come to enhance it or refactor it, how will you be able to verify that it still does what it did before? You will have to manually test it, or retrospectively write the tests (which is always harder).