In the recent consulting process, the customer often asked the following questions: what preconditions should be written for the use case? Wikipedia is defined as follows:
A preconditions section defines all the conditions that must be true (I. E ., describes the state of the system) for the trigger (see below) to meaningfully cause the initiation of the use case.
However, such a definition cannot solve our problem, because it seems that there are many preconditions that can be written, for example, for use cases such as counter withdrawal, do you need to write preconditions like "normal system operation? Or the earth still exists? What are the preconditions for "a user has an ATM card?
To answer this question, first of all, we need to clarify the purpose of writing preconditions, the roles it plays in the entire software development process, and then check whether a precondition has achieved a certain purpose. So far, I have summarized the purpose of writing two preconditions, and I may think of more in the future:
1. this allows the use case readers to better understand the status of the system and helps them understand the use case. For example, for a use case such as "withdrawal from the cabinet", it may be necessary to indicate that the clerk has verified the login, therefore, you can use "Teller verification login" as a precondition;
2. it makes it possible for the case authors not to write some implementation-related error handling details into the case, but to record them in the case in the form of a previously set condition, in the future, testers can write test cases when the preconditions are not met. For example, for a use case such as "withdrawal from the console", the "smooth communication between the Console System and the background host" can be used as a precondition.