1.
Take a simple Tetris game system specification as an example, described in natural language as follows:
Each state of the game corresponds to a game interface, the start state, but the variable cd_start=1 is entered into the normal game state, cd_start=2 when entering the game state, cd_start=3
After the storage is finished, return to the normal game state, in the normal game state, if the variable game_res=0, then the game ends, enter the game
is to go to the score list interface to view. In the score table interface Press any key to return to the start screen, in the Reading game interface, when the game data read completed into the normal game state, the normal game state, the same
Press the left and right button to enter the storage game interface, the number
The description with poor status is as follows:
End screen. It can be seen that the system specification is written in natural language, wordy and complicated, and there may be contradictions, ambiguity, vagueness, incompleteness and confusion of the level of abstraction.
State machine j:{Start, normal game (play in progress), score list, read game, save game, end of Game}
Input set k:{key up, press down, key left, key right, register variable cd_start, register variable Game_res}
Conversion function T: if
Initial state s:{Start}
End state set f:{game over}
It can be seen that the descriptive language is more concise and clear, without ambiguity.
PS Digression: The installation process of Tomcat is a bit of a problem, in addition to view and learn a few simple Web page source code.
An introduction to software engineering Exercise IV