According to the requirements of the software level and qualification examination, advanced programmers not only have high levels of programming capabilities, but also master the method and technology of software design, with certain software design capabilities. Software design is the difficult problem of the afternoon, this paper gives a general method of software design, and gives an understanding case, and finally analyzes the test questions in the past years, hoping to help the majority of candidates.
General method for solving the problem
First, software design questions
Looking at the universal afternoon design questions from 1990 to 2002, mainly include the following test sites:
1. Improve the processing process or point out the processing content, or point out the result.
2. Indicate the error in the flowchart, or to avoid errors to add a processing item in some place.
3. To achieve a purpose, what processing needs to be changed, or what consequences caused by changing the processing method.
4. Indicate the contents of the wrong list.
5. What should be included in the documentation.
6. What kind of file does you need to do, or what is the feature of the file or an introduction of a file.
7. How to classify or point out keywords.
8. A certain frequency of processing.
9. Enter the format of the data.
10. What is the benefits of the classification in the meaning.
11. To implement a record content of the file appropriately modified the file.
12. Point out the data in the figure, or indicate which location data can be increased or deleted.
The most concentrated part of the test center is the content of the document record, followed by the classification order of the file, once again, the purpose change should be changed.
Second, answer questions
The transaction processing flow chart generally consists of several processing and several data, and should pay attention to some of the following problems when evaluating the flow chart and answering questions.
From the perspective of "processing", you must pay attention to:
1. Each transaction has a specific goal, which is often a text description. The corresponding process corresponding to this should be able to overwrite the set target. For explanation, you should consider the problem goal.
2. In addition to the processing of the problem of overlay, there are two types of processing should be considered: one is to ensure the correctness of the processing, design some processing boxes to check the data items of the input data and the value domain; the other is Check the consistency of the data incoming data. The second is to introduce some processing for processing efficiency, such as speed, number of times, reducing processing access, etc.
3. In a flowchart, various processing on a flow cannot be functionally repeated. If there is any repetition, it is not wrong, the process is also optimized.
4. Each process is "the basis" to "use data", and from "processing result" to "generate data". "Use data" or "generating data" is very important to match each other.
From the perspective of "data", you must pay attention to:
1. Pay attention to the initial input data to the final output data, consider the case where data is input between the outputs. According to the evolution and flow of the data, what data should be made from input to output, and its role can also be understood from the evolution.
2. Consider the data flow, which data should appear as a file form, which is temporary data in the middle. In the data evolution, some data is obtained after multiple "processing" processing, and each processing has generated a new data, and the storage requirements of each data can be obtained.
3. Design the data structure as required by the data. The structure of the input (output) data is related to the problem, while the structure of the intermediate data is related to the processing in addition to the input (output) data.
4. In order to reduce data redundancy, ensure data consistency, the relationship should be considered in the data file design, that is, the contact between the records of various files. We have analyzed the solution method of senior programmer software design questions. Now let's analyze the questions.
★ Solution example
2000 test 3: Read the following instructions and flow charts, answer questions 1 and problems 2.
[Description]
A supply and marketing system accepts customers' order. When the number of accessories in inventory is less than the order quantity or inventory is below a certain amount, the purchase order is issued to the supplier; when the inventory of an accessory is greater than or equal to the order quantity, or receive the supplier's delivery and update After the stock, send a bill of lading to the customer. The system can also provide sales and inventory tables to the general manager at any time. The composition of some of the data streams and files in the layered data flow diagram of the supply and marketing system is as follows:
Accessories inventory = accessory number accessory name specification quantity permissible minimum stock
data flow
Ordering list = Parts Number Accessories Name Specification Quantity Customer Name Address
Plumber = ordering order amount
Caordler = accessory number accessory name specification quantity supplier name address
Delivery order = accessory number accessory name specification quantity amount
Assume that the top graph is correct, the "vendor" file is generated by other systems.
[Question 1]
It is pointed out which files in which map can be drawn. [Problem 2] Statects what data flows in which of which is missing. Use one of the following forms when answering. (1) The X X Data Flow of X X Processing (or File) is missing to X X processing (or file); (2) x x-x x x processing omits the X x input (or output) data stream. [Flowchart] top graph
In the top graph, 3 input data streams of the supply and marketing system (order, delivery, payment and sales and inventory) and 5 output data streams (illegal order list, unlaveiled delivery, delivery, purchase Single and sales and inventory tables are reflected in the 0 layer diagram. Check if all input data flows and output data flow in the 0 layer map have omissions? The query of the general manager in the top graph is a separate processing, but it is given to the processing 1 in the 0 layer diagram, and the input or output data stream is also included in the processing. Test the processing 1 sub-map, processing 1.3 is included in processing 1 is scientific because the processing needs to be supported from processing 1 data support, and the transaction is simple, which can greatly reduce the complexity of system analysis and design. Therefore, it cannot be said that the 0 layer map is missing. As for the file, wherever the file is required in the 0-layer map, it is entered from the file, and there is no misfortune.
Take a closer study, generally determine the machining 1 has 3 input data streams (order, arrival notice, query sales and inventory), processing only the order and query sales and inventory in the processing 1 binding Obviously, I miss the input data arrival notice, which sub-processing input should the data? The description of the test questions "After receiving the supplier's delivery, after the stock is updated, the goods will be issued to the customer." According to this, at least it can be determined that the input data flow arrives as a prerequisite for sub-processing 1.4 update stocks, and does not update the stock. Is it directly input to machining 1.4? Re-see the relationship between the child processing 1.4 and other sub-processing. Sub-machining 1.5 Output Data Stream is sub-machining 1.4. Sub-machining 1.5 requires support for notification, but from sub-processing 1.4 to sub-machining 1.5 has no data stream. Comprehensive analysis, should be input to the data stream at the sub-processing 1.5.
First look at the accessories inventory file. In the processing 1 sub-map (Figure 3), the accessories inventory file is modified by processing 1.4 update inventory, and then provides data support for machining 1.1 and processing 1.2, in processing 1.1, by checking the accessories ordered in the order single Is there a record in inventory to determine if the accessory belongs to the scope of distribution, and then determines if the ordering form is legal. Second, it is necessary to compare the number of orders and stocks in the processing 1.2, to determine if a procurement request is required. Again, after sending the bill of lading, if the inventory is below the minimum inventory allowed, it is necessary to issue a purchase order. It can be seen that in this machining diagram, the inappropriate use of the accessory stock file is not found. In the machining 2 subgraph (Figure 4), the inventory file is updated after the processing 2.4 checks the payment, and then processes 2.3 calculation increment provides data support to calculate the number of accessories that need to be purchased. It should be said that the use of accessories inventory files is correct. Therefore, we can determine that the accessories inventory files are applied in processing 1 and processing 2, which is suitable in the 0 layer chart.
The out-of-stock order file is not mentioned in the test instructions, and the specific application requires our own analysis. The file is shown in the 0 layer diagram to be processed 1 and processing 2. The current task is to determine whether the use of the file in both processing is correct. The data from the shortage order in the processing 1 is from machining 1.2 and machining 1.4. After processing 1.2, after accepting legitimate ordering orders, if the number of orders larger than the number of accessories inventory files will result in the number of accessories inventory files. In the machining 1.4, after the goods are delivered, you need to deliver the bill of lading and then update the stock. If the stock is below the permissible minimum stock, the out of stock information should be reflected in the outstanding order. In processing 2, the out-of-stock order provides part of the data support for machining 2.3, and requires an out-of-stock order when calculating the increment of the accessory to clearly need to increase the list. Combined with the above analysis of the use of the outstanding order file, it can be considered that it is necessary to draw this file in the 0 layer diagram.
We analyzed accessories inventory files and out-of-stock order files, and then look at the purchase list.
The 0 layer diagram shows that the file is applied only to machining 2. Purchase list If only in processing 1 is applied, the most likely is the processing 1.2 and after the purchase request data stream, but is it necessary to purchase a list here? As can be seen from the machining 2, the purchase list is summarized according to the supplier to the purchase order, and the purchase order is summarized, which is clearly the work of processing 2, and should not be reflected in the processing 1. This can be determined that there should be no purchase single file in processing 1. Therefore, it is not appropriate to draw a purchase list in the 0 layer chart.
The use of 0 layers, processing 1 sub-map and processing 2 sub-graphs are used in the use of outsider orders, accessories inventory and procurement list, and the sales history documents in the processing 1 are studied below. If there is no file support, processing 1.3 is unable to make sales and inventory forms; and the file is generated by processing 1.4 update inventory, and its input data stream and output data flow are in processing 1, using this file in processing 1. suitable.
Question 2 Requires which elements have been pointed out in. In general, the answer to this type first should first consider data balancing of each level, followed by considering the machined input data stream and output data, that is, the output data stream that guarantees the processing has its corresponding input data stream. The so-called data balance is in the multi-level data flow diagram, the data stream between parentograms and sub-maps must be consistent, for example, in a parent figure has 2 input data streams and an output data stream, then in this processing The input (output) data stream in the sub-figure must be consistent with the parent map in number and content.