How to draw a logical diagram — 4. The attributes of the elements: black box and white box

In the previous article, the attributes describing the size of the element (granularity and stratification) have been introduced. This article will explain the attributes describing the state of the element.

Seeing the "black box/white box", may you think that you are discussing software testing? Wrong, the black/white box concept of software testing is borrowed in the analysis method. Using this concept can be very helpful in understanding the expression of elements in the logic diagram. Of course, this concept is not only useful for drawing logical diagrams, it also has a very good effect on training the analyst's thinking, observation and narrative skills.

Attribute 2: Black box and white box are the description of the state of the element.

1. The concept of black/white box

Black box and white box are descriptions of two opposite states of elements.
As mentioned earlier, the elements can be split again. When the object of discussion is composed of plural elements, pay attention to the granularity of the discussion elements to be the same, temporarily conceal the small-granularity elements to avoid discussion due to the different granularity of the elements The result is difficult to converge. In order to explain this situation easily, the concept of black box/white box is introduced.

1) The concept of
black box ■ Black box : the state when the box is covered and the contents (elements) inside cannot be seen from the outside.
Originally refers to the state of a system or device that only knows the input and output relationships but does not know the internal structure. This concept is borrowed here, which means that when studying the relationship between several elements with the same granularity, there is no need to pay attention to the internal details of one of the elements at the same time. The element is said to be in a "black box state" (because the box is covered, the contents of the box cannot be seen), see Figure 1(a).

Insert picture description here
Figure 1 Schematic diagram of the state of the black box/white box

For example, take Figure 1(a) as an example: the elements of finance, sales, planning, and design equal granularity (=department) are separated from the object of enterprise management. When discussing department-level issues, there is no need to pay attention to what finance contains. "Income" and "Expenses" and other small-grained business details. At this time, "Finance" can be regarded as a whole (black box), focusing on the relationship between finance and sales, design, production and other elements with the same granularity. .

2) The concept of
white box ■ White box : the state when the box is opened and the contents (elements) inside the box are exposed.
The definition of white box is opposite to black box. For example, see Figure 1(b): After opening the “black box” of finance, the small-grained elements inside are displayed. At this time, finance is not in a “black box” state. Instead, it is in a "white box" state, and at the same time, finance has changed from an element to an object, and the content of "income", "expenditure", and "budget" in the white box has become the elements that constitute the financial object. , The various elements of finance (budget, expenditure, income, etc.) can be regarded as a black box with each other again.
In Figure 1(b), only the financial box is opened in the white box state, and the rest of the sales, production and other factors are still in the black box state.

2. The role of the black box/white box concept

What role do the black box and white box concepts play in drawing logic diagrams?
When drawing a logical diagram, especially a diagram of a complex business relationship, pay special attention to the fact that the elements displayed on the diagram should be of the same granularity. If the granularity of the elements is not the same, the relationship between the elements expressed in the diagram will become very complicated and transferable. Intentions can become confusing. The following examples illustrate the application of the black box/white box concept in drawing production flow charts.

Assuming that there are 6 nodes in a production process, each node is an element, namely: sales, design, purchase, production, logistics, and settlement. These 6 elements are of the same granularity. This case focuses on the difference between the node "4. Production" when it is in the black box state and the white box state.

Insert picture description here
Figure 2 Production process

[Study 1] "4. Production = Black Box" scenario.
Research the relationship between node "4. Production" and its upstream nodes 1, 2, 3 and downstream nodes 5, 6, as shown in Figure 3.
Because we need to study the relationship between "4. Production" and other upstream and downstream nodes, other nodes are also considered to be in a "black box" state. At this time, the relationship between the input terminal and output terminal of "4. Production" is expressed as
□input terminal: the upstream nodes 1, 2, and 3 respectively provide ① orders, ② drawings, and ③ plans to the “4. production” node;
□ output End: The "4. Production" node outputs the ④ qualified order and ⑤ settlement order to the downstream nodes 5 and 6 respectively;

Insert picture description here
Figure 3 The "4. Production" node is in a black box state

[Research 2] "4. Production = White Box" scenario.
If you want to express the internal situation of "4. Production", you must regard the "4. Production" node as a "white box" and display its internal details. Then upstream input (orders, drawings, plans) must be It is directly associated with its internal content, as shown in Figure 4:

Insert picture description here
Figure 4 "4. Production" is in the state of white box

After "4. Production" is opened (=white box), the following relationships will occur with the input content (not limited to this).
①Order: must have a relationship with the production process and equipment conditions in the "4. Production" node;
②Drawing: must have a relationship with the production process, construction method, quality, etc.;
③Plan: must have a relationship with the production plan, delivery, and materials Price, etc. have a relationship;

It can be seen that how to treat each node including "4. Production" as a "black box", then the expression of the relationship between the elements in the graph is relatively simple, as shown in Figure 3. Once the inside of "4. Production" is opened, many small elements will be exposed. The logical expression between these small elements and the input content will become more complicated. Therefore, when drawing a logical diagram, think about: black box state Does it meet the expression requirements? If it is enough, do not open "4. Production". If detailed expression is necessary, "4. Production" must be left in a white box state.

■Extended description
Apart from drawing logic diagrams, the concepts of black box and white box also play a very important role in demand analysis.
Why do novices feel helpless when encountering complex problems, while experienced veterans can easily find a way to solve the problem? Let's also try to explain it with the concept of black/white box.

1)
Inexperienced novices lack experience when observing problems. They see the state of the problem (object, element), both in the black box state and in the white box state. As a result, they will feel that there are many problems and intertwined roots. A mess. The reason is that the eyes of novices will not "only grasp the elements of the same granularity to observe", but see all the problems of different granularities at the same time.

2) Experienced veterans
first clarify the relationship between coarse-grained elements (= black box). If you pay attention to the details of a certain element, you can open it into a white box state, and then check the details in the white box. In-depth research on the problem avoids the presence of black and white boxes and greatly reduces the difficulty of research (of course, experienced but lack of methods will make the same basic mistakes as novices).

The coarser the granularity of the elements, the less business knowledge is required for understanding. Conversely, the finer the granularity of the elements, the more business knowledge is required. Opening black boxes of different categories at the same time not only causes a large number of details to appear at the same time, but also requires a variety of business knowledge, and there may be complex associations between elements in different black boxes, which makes the workload of judgment And the difficulty has reached a level that is difficult to grasp.

Therefore, it can be said that understanding the concept of black box/white box can not only help software engineers draw logical diagrams correctly, but also help improve the level of communication and analysis.

For detailed content description, please refer to the book "Dahua Software Engineering—Requirements Analysis and Software Design".

Insert picture description here

Guess you like

Origin blog.csdn.net/lihognjun/article/details/111241251