<div dir="ltr">Hi,<div>I'd like to propose a change for TestCase that allows reproducible tests that use randomness. The original idea is from Leandro Caniglia, he implemented it in Bee Smalltalk. It works like this: every TestCase has a 'seed' instance variable that is set at random during initialization, and any test can send the message 'random' to get a new instance of Random initialized with this seed. This makes tests with randomness reproducible, i.e. if a test fails or produces an error and you want to debug it, it will be run again with the same seed as the first time.</div><div><br></div><div>In order to make this work I had to also change the methods TestCase>>debug and TestCase>>debugAsFailureIfCanNot:, because instead of running again the same instance of TestCase they created a new one. Could someone more familiar with SUnit look at this and let me know if it's ok? It doesn't seem necessary to create a new instance of the TestCase every time you run it, but I might be missing something. If for some reason it is important to create a fresh instance we could copy it so it keeps the seed and any other state that was set at initialization. Keeping the state is important for my tests, not only due to the use of randomness but also because I'm doing parametrized testing (for example I generic tests for vector spaces and I set a particular coefficients field, if the TestCase is recreated sending TestCase class>>selector: the extra information of the coefficients field is lost).</div><div><br></div><div>Thanks,</div><div>Luciano</div></div>