Object-oriented Information Systems

Packaging and Testing

Unit 9

Code testing should not be neglected. Unit 9 overviews how to test code and which modules can be used to test the code automatically. Furthermore, the unit indicates how necessary is the documentation of the code by explaining the PEP257 convention to document a Python program. It also discusses cyclomatic complexity and how it is relevant for object-oriented systems.

Outcomes

  • Summary of the learning outcomes

This unit aims to:

  • Appropriately package a Python code development
  • Adequately and effectively document your code
  • Use the tools available in Python to test the quality of code
  • Reflection

What exactly have I learnt and how?

In this unit, I learned how to test the code and which packages can be used to test the code automatically. The cyclomatic complexity and the portfolio tasks on this topic made me think about how I should structure my code next time. The higher the number of cyclomatic complexity, the more complex the code and the more difficult it is to test. As I said in unit 8, my fellow students' participation in the collaborative discussion was relatively low, so I could only respond to one of my fellow students, which is attached in the notes section
  • Notes

Notes from the elaboration of the unit, various meetings, and feedback from team members and tutors

Feedback from a student on the collaborative discussion "OO Design for IoT"
I completely agree with your views on the use of metamodels. I think this brings back to our first collaborative discussion about software reusability: using metamodels is a great way to reuse the existing models.
Indeed, it takes strict discipline to fully capitalize on the metamodels. Because it increases the time required in the design phase, project owners might be reluctant to use them or spend adequate time to use them properly, especially when there is a pressing need to market the product in the shortest time possible. However, the advantages of using them are obvious.

Reply to a student on the collaborative discussion topic: "OO Design for IoT"
Since object-oriented programming aims to simulate the real-world objects in programming practices, it is a perfect match for the Internet of Things (IoT) in which real-world objects communicate with each other via a network and users interact with them. For this reason, modeling and particularly metamodels play an important role in the design and implementation of the systems.
From my point of view, the most important strength of the metamodel approach (Fortino et al., 2015) is that it helps to identify the way smart object interacts with devices/services. It also urges developers to focus on the design aspects and agree upon them before the implementation and development process begins. Finally, such metamodels provide a blueprint for the systems that would be developed in the future, enhancing reusability of the models.
When it comes to the weaknesses, I think metamodel approach also suffers from the same weaknesses of Unified Modeling Language (UML) (Lange, et al., 2006).
For instance, lack of “formal semantics” is an important difficulty. Moreover, following the metamodel approach is time-consuming and thus, it may be challenging to follow this model especially in time-sensitive projects. Because of this, it might also prove difficult to persuade project owners and the developers to devote time to the design process.
I came up with this smart model for a driverless car:
OO Design Model for IoT - Driverles Car
As expected from the metamodel approach it is a high-level model which excludes implementation details.
References:
Fortino, G., Guerrieri, A., Russo, W. & Savaglio, C. (2015) Towards a Development Methodology for Smart Object-Oriented IoT Systems: A Metamodel Approach. 2015 IEEE International Conference on Systems, Man, and Cybernetics. 1297-1302.
Lange, C. F. J., Chaudron, M. R. V. & Muskens, J. (2006) In practice: UML software architecture and design description. IEEE Software 23(2): 40-46.
- Post by Gianluca Cannone:
Hi,
I also agree with you that the great strength of the metamodel approach is the focus on device interactions. But, as you said, it is very time-consuming and a big challenge when time is of the essence in development.

Contact Me