Software Engineering—Chapter 12 Object-Oriented Implementation of Knowledge Points

This column is the blogger's personal notes, the main purpose is to use the fragmented time to memorize the knowledge points of soft engineering, hereby declare!

Article directory

1. What are the characteristics of object-oriented language technology?

2. What factors should be considered when choosing an object-oriented programming language?

3. Can object-oriented design results be realized only in object-oriented languages?

4. Which programming language should be used for object-oriented implementation? Why?

5. What new features do the unique encapsulation, inheritance and polymorphism mechanisms in object-oriented programs bring to object-oriented testing?

6. What are the main principles of good object-oriented programming style?

7. What are the guidelines for increasing reusability?

8. What are the guidelines for improving scalability?

9. What are the guidelines for improving robustness?

10. What is the smallest testable unit for object-oriented unit testing?

11. What are the two main different strategies for object-oriented integration testing?

12. What is the main basis for object-oriented confirmation testing to confirm test cases?

13. What two points does object-oriented testing focus on?

14. What are the main methods of designing unit test cases? (i.e. the method of the test class)

 15. What are the main methods of designing integration test cases?

16. What are the main methods for designing and confirming test cases?

Summary at the end of the chapter


1. What are the characteristics of object-oriented language technology?

  1. Mechanisms supporting the concepts of classes and objects
  2. Mechanisms to achieve aggregated (whole-part) structures
  3. Mechanisms for implementing generalized (general-specific) constructs
  4. Mechanisms for Implementing Properties and Services
  5. Provide a useful class library
  6. Use class libraries to achieve high efficiency
  7. persistent object

2. What factors should be considered when choosing an object-oriented programming language?

  1. Whether it can dominate in the future : In order to make its products still have strong vitality after several years
  2. Reusability : The basic purpose and main advantage of developing software using object-oriented methods is to increase software productivity through reuse
  3. Class library and development environment : The factors that determine reusability are not only the object-oriented programming language itself, but the development environment and class library are also very important factors
  4. Other factors : training services that can be provided for users to learn object-oriented analysis, design and coding techniques; technical support that can be provided during the use of this object-oriented language; development tools, development platforms, and distribution platforms that can be provided to developers; The demand for machine performance and memory; the ease of integrating existing software, etc.

3. Can object-oriented design results be realized only in object-oriented languages?

no. Object-oriented design results can be implemented in both object -oriented and non-object-oriented languages

4. Which programming language should be used for object-oriented implementation? Why?

An object-oriented language that expresses the semantics of the problem domain more completely and correctly should be chosen .

Because object-oriented languages ​​have outstanding advantages over non-object-oriented languages :

  1. consistent representation
  2. reusability
  3. maintainability

5. What new features do the unique encapsulation, inheritance and polymorphism mechanisms in object-oriented programs bring to object-oriented testing?

Increased difficulty of object-oriented testing and debugging

6. What are the main principles of good object-oriented programming style?

  1. Improve reusability
  2. Improve scalability
  3. Improve robustness

7. What are the guidelines for increasing reusability?

  1. Improve method cohesion
  2. reduce the size of the method
  3. maintain consistency in approach
  4. Separate strategy from implementation
  5. Methods should comprehensively cover all possible outcomes
  6. Try not to use global information
  7. Use the inheritance mechanism

8. What are the guidelines for improving scalability?

  1. Encapsulation Implementation Strategy
  2. Do not use one method to traverse multiple association chains
  3. Avoid using multi-branch statements
  4. Carefully identify public methods

9. What are the guidelines for improving robustness?

  1. Prevent user's operation error
  2. Check the legality of parameters
  3. Don't predetermine constraints
  4. Test first , then optimize

10. What is the smallest testable unit for object-oriented unit testing?

Object-oriented unit testing The smallest testable units are encapsulated classes and objects

When testing object-oriented software, individual operations cannot be tested in isolation, but operations should be tested as part of a class .

11. What are the two main different strategies for object-oriented integration testing?

  1. Thread- based testing
  2. usage - based testing

12. What is the main basis for object-oriented confirmation testing to confirm test cases?

Object-oriented validation testing mainly designs validation test cases based on dynamic models and scripts describing system behavior

13. What two points does object-oriented testing focus on?

  1. proper sequence of operations
  2. Check the status of the class

14. What are the main methods of designing unit test cases? (i.e. the method of the test class)

  1. random test
  2. division test
  3. failure-based testing

 15. What are the main methods of designing integration test cases?

        The integration testing method must test the cooperation between classes , which can be done by random testing method and partition testing method, as well as scenario-based testing and behavioral testing

16. What are the main methods for designing and confirming test cases?

Can use a traditional black box approach or a scenario-based approach

Summary at the end of the chapter

        Object-oriented methodology naturally links analysis, design, and implementation . Although object-oriented design does not depend on a specific implementation environment in principle, the implementation results and implementation costs depend on the implementation environment to a large extent . Therefore, an object-oriented programming language, development environment, and class library that support the object-oriented design paradigm are very important for oriented implementation.

        In order to smoothly transform object-oriented design results into object-oriented programs, an appropriate programming language should be selected first. Object-oriented programming languages ​​are very suitable for implementing object-oriented design results. The object-oriented programming language with convenient development environment and rich class library is the best choice for realizing object-oriented design .

        Good programming style is especially important for object-oriented implementations. It includes not only the traditional programming style guidelines , but also some new guidelines adapted to the characteristics of the object-oriented method .

        Object-oriented methodology uses unique concepts and techniques to complete software development work. Therefore, when testing object-oriented programs, in addition to inheriting traditional testing techniques, new testing techniques that adapt to the characteristics of object-oriented programs must also be studied.

The general goal of object-oriented testing is the same as that of traditional software testing, which is to find the most errors with the least amount of work . However, the strategies and techniques of object-oriented testing are different from traditional testing, and the focus of testing has shifted from process components (traditional modules) to object classes.

        Once the object-oriented programming is done, start unit testing each class. The methods used when testing classes are mainly random testing, partition testing and failure-based testing . Each method tests the operation encapsulated in the class. Test sequences should be designed to ensure that related operations are adequately tested. Check the state of the object (represented by the object's property values) to determine if there is an error.

Integration testing         can be done with a thread-based or usage-based strategy . A thread-based test that integrates a set of classes that cooperate to respond to an input or an event. Based on usage testing, structure the system hierarchically, starting with those classes that do not use server classes. Design integration test cases, you can also use random testing and partition testing methods. In addition, test cases derived from the dynamic model can test specified classes and their collaborators.

        The confirmation test of the object-oriented system is also oriented to the black box , and the traditional black box method can be applied to complete the test work. But scenario-based testing is the main method for validation testing of object-oriented systems .

Next chapter : Software Engineering—Chapter 13 Knowledge Points of Software Project Management (End)

Repeatedly, down-to-earth; never forgetting, there will be echoes!

Guess you like

Origin blog.csdn.net/qq_52487066/article/details/131676232