2015 second half of Software designer Test Center, difficulty 2

Source: Internet
Author: User

Resource allocation diagram, which is the process Resource Graph

  

Simplification:

    • The first step: see how many resources the system has left unallocated, and then see which processes are not blocked ("No blocking" that is, the system has enough free resources allocated to it)
    • Step Two: Remove all the edges of the non-blocking process, form an isolated point, and then recycle the resources that the system allocates to the process
    • Step three: See what the rest of the process does not block, and then turn them into isolated points.
    • Fourth step: Finally, all the resources and processes become isolated points. Such a diagram is called "Fully simplified".

If a diagram is completely simplified, no deadlock occurs, and if a diagram is not completely simplified (that is, there is an "edge" in the diagram), a deadlock is generated. This is the "death lock".

Extension: Deadlock

ISO/IEC Software quality model

Detailed design, process design tools

1. Graphical Tools

(1) Program Flowchart (FC)

Advantages: Easy to master, long history, wide use

Disadvantages:

In essence, it does not have the characteristic of gradual refinement, which has little effect on improving the comprehension of large-scale system.

      data structure is not easy to represent;

Control processes can be drawn at will, resulting in unstructured program structures

Trend: Stop using

(2) box diagram (NS)

Advantages:

The functional domain (the scope of a particular control structure) is clear, and can be seen from the box map at a glance

No arrows do not allow arbitrary transfer of control, can not arbitrarily transfer control

It is easy to determine the scope of local and full data

It is easy to represent a nested relationship or to represent the hierarchy of a module

Disadvantage: As the number of layers embedded in the program increases, the inner box becomes smaller, it will increase the difficulty of drawing, affect the sharpness

(3) Problem Analysis Chart (PAD)

Advantages:

Clear program structure and high degree of structure

Support for top-down, progressive refinement design methods

Can either represent program logic or depict data structures

Express program Logic , easy to read and write, easy to use

Easy to convert to high-level language source program , can also use software tools to achieve automatic conversion

2. Table Tools

(1) Decision table

Advantages: When multiple nested conditions are selected, the program flowchart, N-S diagram, pad are not easy to describe clearly. But the judgment table can clearly reach the correspondence between complex condition combination and action.

    Disadvantages:

Lack of versatility, can not be as good as the pad map into code

more than two values for data elements are not easy to represent

Inability to clearly express order, repetition, etc.

(2) Decision tree

Advantages:

Represents the correspondence between complex conditional combinations and actions to be made

The form is simple, has been valued for a long time

Disadvantages:

Simplicity is not as good as the decision table: Repeat multiple times for the same value; page-end repetitions increase sharply

The branching order has a great influence on the simplicity of the final decision tree.

3. Language Tools

(1) Process design language (PDL), pseudo code

Advantages:

can be inserted directly in the middle of the source program as a comment

can use ordinary text editing program, word processing system, it is easy to complete the writing and editing of PDL, easy to write

There are already programs that automatically handle PDL and can automatically generate program code from PDL

   Disadvantage: The image of the non-shape tool is intuitive, it is not as clear as the judgment table when describing the correspondence between complex condition combinations and actions.

Reverse engineering: That is, reverse engineering, reverse enginneering

Through disassembly, anti-compilation and dynamic tracking methods, the animation effect of the implementation process is analyzed, this behavior is reverse engineering, not only anti-compilation, but also to tear down the design, and documentation, reverse engineering software is designed to enable the maintenance.

Software maintenance: A software maintenance tool that assists maintenance personnel in the maintenance activities of software code and its documentation, which is referred to as the "software maintaining tools" during the process of supporting software maintenance.

Tools include: 1, version control tools, 2, document analysis tools, 3, development information base tools, 4, Reverse engineering tools, 5, re-engineering tools, 6, configuration management Support Tools. Among them, the tools of reverse engineering are: program slicing, static analyzer, dynamic analyser, data stream Analyzer, cross-reference, Dependency Analyzer. Program Complexity metric 1. McCabe measurement method, 3 methods: (1) The number of regions in the flow graph is equal to the ring complexity.
(2) Flow graph G of the ring Complexity V (G) =e-n+2, where E is the number of edges in the flow graph, N is a node point.
(3) The annular Complexity V (g) =p+1 of the flow graph G, wherein P is the number of the decision nodes in the flow graph. Relationship between UML classes 1. Inheritance = generalization: parent-child relationship.

2. Implementation: Class-to-interface relationships.

3. Dependency: One class uses another class. Relationship is contingency, temporary, very weak, will affect. The code appears as a parameter.

4. Affinity: A strong dependency of two classes, or the semantic level between classes and interfaces. More than relying on the contingency, the relationship is not temporary, is generally long-term, and the relationship between the two sides is generally equal, the association can be one-way, two-way. The code appears as an attribute.

5. Aggregation: A special case of association relationship, he embodies the whole and part, the relationship of ownership, that is, the relationship between the whole and the part is has-a, they can have their own life cycle, some can belong to multiple whole objects, can also be shared for multiple whole objects. Now the code level, and the association relationship is consistent, can only be differentiated from the semantic level;

6. Combination: is a special case of association, he embodies a contains-a relationship, which is stronger than aggregation, also known as strong aggregation, he also embodies the relationship between the whole and part, but at this time the whole and part is not divided, the whole life cycle end also means that part of the end of life cycle At the level of code, and the relationship is consistent, can only be differentiated from the semantic level;

Summary: Strong and weak degree: Combination > Aggregation > Association > Dependency

Figure

1. Use case diagrams: Relationships between other entities and systems, and relationships between use cases within the system. Advanced features commonly used to express system or system categories

2. Class diagram: How different entities (people, things, and data) are related to each other. The static structure of the system for representing the logical class

3. Sequence diagram: A detailed process that shows a specific use case (or part of a use case). Shows the call relationships between different objects in the process, as well as displaying different calls to different objects in great detail. There are two dimensions: the vertical dimension displays the sequence of messages/calls in the chronological order in which they occur, and the horizontal dimension displays the instance of the object to which the message is sent.

4. State diagram: The different states in which a class is located and the state transformation information for that class.

5. Activity diagram: Process Control flow between two or more class objects when processing an activity.

6. Component diagram: Physical view of the system. Displays the dependencies of software on other software components (for example, library functions) in the system.

7. Deployment diagram: How software systems are deployed to a hardware environment. Used to display the architecture between hardware and software, which is a specific system implementation environment deployment. The symbols in the deployment diagram include the symbol elements used in the component diagram, plus several symbols, including the concept of nodes.

Extension, Network Diagram:

Design Patterns

Create type

1. Factory method (Factory methods): Defines an interface for creating objects so that subclasses decide which class to instantiate.

2. Abstract Factory: Create a series of interfaces of related or interdependent objects without specifying their specific classes.

3. Builder: Separates the construction of a complex object from its representation so that the same build process can create different representations.

4. Prototype (prototype): Use the prototype instance to specify the kind of object to create, and create new objects by copying the prototypes.

5. Singleton (singleton): guarantees that a class has only one instance and provides a global access point to access it.

Structural type

6. Adapter Class/object (Adapter): Transforms the interface of one class into another interface that the customer wants. The Adapter mode makes it possible for those classes that would otherwise not work together because of incompatible interfaces to work together.

7. Bridge (bridging): Separate the abstract part from its implementation, so that they can vary independently.

8. Composite (COMBO): Combines objects into a tree structure to represent a "partial -Whole " hierarchy. C o m P o s i t e makes the user consistent with the use of a single object and a composite object.

9. Decorator (decoration): Dynamically add some additional responsibilities to an object. For added functionality, theDecorator mode is more flexible than generating subclasses.

Facade (appearance): Provides a consistent interface for a set of interfaces in a subsystem, and thefacade schema defines a high-level interface that makes this subsystem easier to use.

Flyweight (Share): the use of sharing technology to effectively support a large number of fine-grained objects.

Proxy: Provides a proxy for other objects to control access to this object.

Behavioral type

Interpreter (interpreter): Given a language, defines a representation of its grammar and defines an interpreter that uses that representation to interpret sentences in a language.

Template method: Defines the skeleton of an algorithm in an operation, and delays some steps into subclasses. Templatemethod allows subclasses to redefine some specific steps of the algorithm without altering the structure of an algorithm.

Chain of Responsibility (Chain of responsibility): Enables multiple objects to have the opportunity to process requests, thus avoiding the coupling between the sender and receiver of the request. Link the objects together and pass the request along the chain until an object handles it.

Command: Encapsulates a request as an object so that you can parameterize the customer with different requests, queue requests or log requests, and support undoable operations.

Iterator (iterator): Provides a way to sequentially access individual elements of an aggregated object without exposing the object's internal representation.

Mediator (mediator): Use a Mediation object to encapsulate a series of object Interactions . The mediator makes the objects not need to explicitly reference each other, so that they are loosely coupled, and can independently change the interaction between them.

Memento (Memo): captures the internal state of an object without compromising encapsulation, and saves the state outside that object. The object can then be restored to its previously saved state.

OBSERVER (Observer): Defines a one-to-many dependency between objects , and when an object's state changes , all objects that depend on it are notified and automatically updated.

(state): Allows an object to change its behavior when its internal state changes.

Strategy (Strategy): Define a series of algorithms , encapsulate them one by one , and make them interchangeable with each other. This mode allows the algorithm to be independent of the customers who use it.

Visitor (visitor): Defines the skeleton of an algorithm in an operation, and delays some steps into subclasses. Templatemethod allows subclasses to redefine some specific steps of the algorithm without altering the structure of an algorithm.

Inter-object relationships:

1. Overloading: In the same class, overload. Condition: The function name is the same, the argument list must be different, there is no requirement for the return value 2. Overwrite: Subclass, override condition: function name, parameter list, return value identical note: 1, when a subclass method overrides a parent class method, the subclass permission must be greater than or equal to the parent class's permission.

2, static can only override static, or be statically overwritten.

3. Overloading if the function name is the same in the child parent class, only the return value is different never allow overloading (compile error, call uncertainty). Because overloading is based on function parameter differences;

4. The Declaration of the overwrite function must be exactly the same, including the return value must also be consistent.

① if the child parent class function name is the same and the argument list is different, the method becomes a subclass-specific method, and there is no overwrite

② if the child parent class function name and argument list are the same and the return value is different, the compilation does not pass

  

2015 second half of Software designer Test Center, difficulty 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.