Our JUnit tests do a good job of making sure that each part does what the developer expected it to do, but they don't verify end-to-end behaviors. That leaves us at risk for the big picture things not working even though everyone things their part is correct. For example, when a player moves, a command on the client should cause a message to go to the game server that client is playing on and then a message should go from the game server to every other player connected to that server so that everyone can see that you've moved. Because that functionality is spread across machines, JUnit tests cannot verify that executing the one command has all of those effects. You can see how that player movement interaction is tested in MovementBasicSequenceTest and that will be the example for the rest of this explanation.
Our JUnit tests do a good job of making sure that each part does what the developer expected it to do, but they don't verify end-to-end behaviors. That leaves us at risk of the big picture things not working even though everyone thinks their part is correct. For example, when a player moves, a command on the client should cause a message to go to the game server that client is playing on, and then a message should go from the game server to every other player connected to that server so that everyone can see that you've moved. Because that functionality is spread across machines, JUnit tests cannot verify that executing the one command has all of those effects. You can see how that player movement interaction is tested in MovementBasicSequenceTest and that will be the example for the rest of this explanation.
In order to address that, we developed a system we call "Sequence Tests" where each test starts with a command on one machine and specifies the sequence of messages (between systems) that should result from the execution of that command. The system then emulates every machine involved in the sequence to make sure that its message outputs are correct for the command and messages it receives.
In order to address that, we developed a system we call "Sequence Tests" where each test starts with a command on one machine and specifies the sequence of messages (between systems) that should result from the execution of that command. The system then emulates every machine involved in the sequence to make sure that its message outputs are correct for the command and messages it receives.