# Framework Based on Simulation of Real-World Message Streams to Evaluate Classification Solutions
## 2 Proposed Framework
### Message Stream Simulation  
Message Stream Simulation, using the simulation technique [20] and the queueing theory [21], attempts to mimic the generation of a message stream, similar to a real-world environment. The goal of this module is to generate a message stream \(S\) that is as close as possible to a real scenario. To achieve this goal, profiles are modelled. A profile \(p\) is considered in this paper as an abstract entity that can have \(n\) instances, each of which generates a message stream \(S_{p_{n}}\). Profiles can be used to model thematic sources and/or user profiles. A thematic source generates a message stream about one or more topics such as Computers, Science, Society and others. A user profile generates a message stream with similar characteristics to user/entity types of the web such as Spammer, Social Network, Personal, Marketing, Information and others. A profile instance is defined as \(p_{n}=(name,svb,mc,S_{p_{n}})\), where \(name\) is the identifier of each instance profile, \(svb\) is a set of variable behaviours that can be different for each profile instance, \(mc\) is a message corpus and \(S_{p_{n}}\) is the generated message stream. The set of variable behaviours (\(svb\)) are parameters that can change the way a profile instance generates a message stream. When simulating non-stationary message streams to closely emulate message sending sources, the variables message send rate, message batch size, message size and message obfuscation play an essential role. The message send rate represents the frequency with which messages are sent by the source, and in a non-stationary environment, the message send rate can fluctuate over time. By adjusting this variable in the simulation, one can capture the varying intensity of message traffic. Similarly, the message batch size, which refers to the number of messages sent together as a batch, affects the burstiness and temporal patterns of the message streams. In non-stationary scenarios, batch size can change, and adjusting this variable in the simulation allows for the replication of such dynamics. Message size refers to the size in digital units of the content of each message. In non-stationary message streams, the size distribution of messages may change, and incorporating this variability into the simulation will affect the processing of message content, as the content and size of the context to be analysed by the word processor will vary. In addition, message obfuscation is one of the tricks used by spammers to evade spam filters and is relevant to the evaluation of solutions to be developed in the context of spam detection. Future versions of the framework could include the modelling of other tricks used by spammers. Based on that, the \(svb\) Message Send Rate (\(msr\)), Message Batch Size (\(mbs\)), Message Size (\(ms\)) and Message Obfuscation (\(mo\)) are defined. \(msr\) is equal to mean arrival rate \(\lambda\), which is the time between sending messages. \(\lambda\) can be a constant or a random value that can change in a constant time \(t_{\lambda}\). In \(mbs\), the size \(s\) of the message batch \(mb\) can be a constant, or it can change randomly in a constant time \(t_{mb}\). To change \(s\), an integer uniform random number is generated with an interval \([0,z]\), where \(z\) is the maximum value of the size for \(mb\). In \(mbs\), before forming each \(mb\), the input source can be filtered by a minimum message size \(ms\) that changes in constant time \(t_{ms}\). This reduces the input source to form the \(mb\) to the message with a size equal to or greater than \(ms\). To change \(ms\), a uniform integer random number is generated with an interval \([1,k]\), where \(k\) is the maximum value of KB for \(ms\). The \(mo\) consists of replacing the letters \(i\) and \(l\) in the body of the message with the characters \(j\) and \(1\), respectively. Before sending each \(mb\), \(q\) message from the batch of messages can be selected and obfuscated.