Story Time: Dont Merge the Conflux
Story time: I worked on a legacy AQA project where we made extensive use of a data generator. It was fairly robust: we had a database you filled with your dataset and in your test you’d make a method call to the mythical datagenerator.jar with the name of your database table and a few flags dictating the boundaries of the data.
This worked well for a time, but eventually we outgrew it and it fell to me to figure out how to write some new functionality. The problems were three fold: the original author left the company. This in and of itself isn't a huge problem, but it does compound with the second issue: the documentation we had was literally two documents, neither of which covered all the flags (some of the ones we used weren't documented at all) and both conflicted with each other in multiple places. Finally we didn't have the source code only the compiled jar, so we couldnt easily make our own documentation.
So I set about my task. Step one: decompile the jar and try to read the result. This was the first surprise: the jar was just one method with a couple overrides that fed into the same core method. All the mythical jar did was package your request into a SOAP query and send it off to a service - a service none of us knew existed.
I requested access to the server from IT, and they didn't even know it existed. After some back and forth (first over its existence, second no they couldnt tear it down and rebuild it, I didn't know what was on it) IT eventually gave me access. Keep in mind this was a server we were actively using with dozens of requests a day. If anything had ever happened to it, we would have been in a blind panic.
Once inside, I found the actual source code which was not source controlled in any of our systems. The codebase was an undocumented recursive mess - it’s no wonder documentation was missing as the original author probably lost sight of what some of the methods did. In fact, some of the methods were orphaned and never used and some of the methods we did inadvertently use only worked for a specific range of data - which luckily we stayed inside.
One particular line has always stood out to me though. At the top of the class was a final static string called ‘CONFLUX’. It was set to the entire alphabet - upper and lower case. Above it was a comment:
//this is the Confluxer.
Later in the codebase, there was a method that dealt with randomly generating nonsense strings of fixed length. In that method was a comment:
//dont merge the conflux.
It should be noted that this method did not ever reference the CONFLUX variable.
Please, when building tests, document your work. And don't merge the conflux.