MS Computer Science Virtual University of Pakistan

CS711 – Software Design Viva Preparation

CS711 – Software Design Viva Preparation

 Software crisis: Software crisis is a term used in the early days of computing science for the difficulty of writing useful and efficient computer programs in the required time.

 Sequence diagram vs. activity diagram:

They are both behavioral diagrams. Activity diagram control flowing from one activity to another, especially good at the logic of conditional structures, loops, and concurrency.

Sequence diagram: the sequence of messages flowing from one object to another,

 Activity Diagram: Activity diagram belongs to the dynamic category of the UML diagrams,

This diagram shows difference in the behavior of the system as it changes its state from one to another.

Use case diagram: a user’s interaction with the system that shows the relationship between the user and the different use cases in which the user is involved.

 Open Close principle: an entity can allow its behavior to be extended without modifying its source code.

 Good software design characteristics:

  • Correct:
  • Understandable:
  • Efficient:
  • Maintainable:

Metaphor:XP teams use a common system description that guides development and communication

 Difference between include and extend in use case diagram:

Extend is used when a use case adds steps to another first class use case.

The original use case is not complete without the included one.

 Framework: a framework is often a layered structure indicating what kind of programs should be built and how they would interrelate.

 Waterfall model: The waterfall model is a sequential design process, in software development, in which progress is seen as flowing downwards (like a waterfall).

Advantages of waterfall model:

  • Easy to understand and use.
  • It is easy to manage due
  • In this model Phases do not overlap, phases are processed and completed one at a time..
  • Waterfall model works well for smaller projects where requirements are very well understood.

 Disadvantages of waterfall model:

  • Once an application is in the testing stage, it is very difficult to go back and change something
  • High amounts of risk and uncertainty.
  • Not a good model for complex and long object-oriented projects.
  • Not suitable for the projects where requirements are at a moderate to high risk of changing.
  • No working software is produced until late during the life cycle.

Agile methodology: Agile is a methodology that anticipates the need for flexibility and applies a level of pragmatism into the delivery of the finished product.

Demerits of Agile:

  • Difficult to Assess the Effort Required at the Beginning of the Software Development Life Cycle
  • Can be Very Demanding on the Users Time
  • Harder for new Starters to Integrate in the Team
  • Costs can Increase as Testers Required all the Time Instead of at the End

Difference b/w static and dynamic Modeling:

A dynamic model refers to runtime model of the system,

Static model is the model of the system not during runtime.

Dynamic models keep changing with reference to time

Whereas static models are at balance of in a stable state.

 Software Design: Based on the system architecture which defines the main software blocks the software design will break them further down into code modules.

Static methods: A Static method belongs to a class. A Static method can be invoked directly without object.

Decomposition: We split one system into smaller components.

Vertical Decomposition: Decomposition of the system into smaller, more manageable units that are layered. Each layer supplies one level of abstraction.

DESIGN PATTERN: A design pattern is a documented solution in multiple environments to solve a problem.

 Factory Pattern: Factory Pattern defines an interface for creating the object  but let the subclass decide which class to instantiate.

Composition: A composition relationship implies strong ownership of the part and the whole. E.g Wheel of a car.

Type of messages of Sequence Diagram:

Synchronous: In this type of message, the object that calls a method or sends a message is blocked or waits for the response from the called object.

Asynchronous: This type of message is opposite to that of Synchronous message call, in this type ofmessage the flow is not interrupted and response is not awaited i-e caller is not blocked till response and caller can perform any other activity.

Difference b/w static and dynamic diagrams

  1. Static
    1. Use case diagram
    2. Class diagram
  2. Dynamic
    1. Activity diagram
    2. Sequence diagram
    3. Object diagram
    4. State diagram
    5. Collaboration diagram

Includes and extends // difference and example

There are relationships that exists between actors and use cases or both

  1. Include

When multiple use cases share same functionality then it logical that rather than writing the same functionality again and again, we can use the concept of re-usability to write the common functionality once and include it as a part of required use case.

  1. Extends

A use case may extend by adding new actions to the base use case. Extends relationship is shown by using directed arrows.                                                                                                                                        XP Corners: Communication, Simplicity, Feedback, Courage

Principles of XP: Feedback, Assuming simplicity, Embracing change

Rational Unified Process: The Rational Unified Process is a process product, developed and maintained by Rational Software.

Architectural design: The process of defining a collection of hardware and software components and their interfaces to establish the framework for the development of a computer system.

Software Design Components: Principle, Criteria, Techniques

External Abstraction: In this type of abstraction we try to apply techniques and principles which help us to have a system which include a stable communication mechanism between the different components of the system

Subsystems: A Subsystem is a secondary or subordinate system within a system.

Tree-Structures – Tree Shaped Decomposition: This is a hybrid decomposition which is a combination of subsystem and layers in which we can start at the root node and each node can be reached in exactly one way.

Modularization: Software architecture embodies modularity; that is, software is divided into separately named and addressable components.

Encapsulation: A view of a problem that extracts the essential information relevant to a particular purpose and ignores the remainder of the information.

Separation of concerns Principle (SOC): When designing software, there are usually certain requirements or considerations to be carried out so that the software comes up to the expectations placed on it. These requirements or considerations are called concerns.

Coupling: Coupling refers to how many dependencies there are between modules and the nature of thelinks. The Components should “Loosely Coupled”. Loose Coupling promotes “Separation ofconcern”.

Content Coupling: This is highest level of coupling and occurs if there are two (or more) modules and if one refers tothe “inside” – the “internal” or “private” part – of the other in some way.Common Coupling: Common coupling occurs when modules communicate using global data areas (i.e., universalcommon data areas).

Control Coupling – Moderate Coupling: Two modules exhibit control coupling if one (“module A”) passes to the other (“module B”) apiece of information that is intended to control the internal logic of the other.

Stamp Coupling – Low Level Coupling: Stamp coupling is when modules share a composite data structure and use only a part of it,possibly a different part (e.g., passing a whole record to a function that only needs one field of it)

Data Coupling – Low Level of Coupling: Data coupling occurs between two modules when data are passed by parameters using asimple argument list and every item in the list is used

Cohesion: A measure of the closeness of the relationships between elements of acomponent or “module” of a system. From software design view point always “High cohesion” is desirable because: it simplifiescorrection, change and extension process.

Coincidental Cohesion – Lowest Cohesion: Modules with “low” levels of cohesion are highly undesirable and should be modified orreplaced. Coincidental cohesion occurs when parts of the component are only related by theirlocation in source code.

Logical Cohesion: A logically cohesive module is one whose elements contribute to activities of the same generalcategory in which the activity or activities to be executed are selected from outside the module.

TEMPORAL COHESION: A temporally cohesive module is one which performs several activities that are related in time.Temporally cohesive modules typically consist of partial activities whose only relationship to oneanother is that they are all carried out at a specific time.

Procedural Cohesion: Elements of a component are related only to ensure a particular order of execution. Module with(only) procedural cohesion is one supporting different and possibly unrelated activities, in whichcontrol passes from one activity to the next.

Communicational Cohesion: In communicational cohesion, module performs a series of actions related by a sequence of stepsto be followed by the product and all actions are performed on the same data. A communicationally cohesive module is one which performs several functions on the same input or output data.

Sequential Cohesion: A sequentially cohesive module contains activities where output data from one activity serves asinput data to the next activity. In general, a sequentially cohesive module has good coupling andis easy to maintain.

Functional Cohesion – Highly cohesive: A functionally cohesive module performs one and only one problem related task and everyessential element to a single computation is contained in the component. A functionally cohesivemodule performs one and only one problem related task.

Code extensible: Compile time, Link time, Run time

Inheritance: It implies the functionality of data sharing between super and sub class. All the data members and methods of super class are available for use in sub class but not vice-versa.

Abstract Classes: An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.

Polymorphism:Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.

Synchronous: In this type of message, the object that calls a method or sends a message is blocked or waits for the response from the called object.

Asynchronous: This type of message is opposite to that of Synchronous message call, in this type ofmessage the flow is not interrupted and response is not awaited i-e caller is not blocked till response and caller can perform any other activity.

UML Diagram Types:

Structure Diagrams

  • Class Diagram
  • Component Diagram
  • Deployment Diagram
  • Object Diagram
  • Package Diagram
  • Profile Diagram
  • Composite Structure Diagram

Behavioral Diagrams

  • Use Case Diagram
  • Activity Diagram
  • State Machine Diagram
  • Sequence Diagram
  • Communication Diagram
  • Interaction Overview Diagram
  • Timing Diagram

V-Model: The reason for this is that for each of the design phases it was found that there is a counterpart in the testing phases which correlate to each other.

Requirement Analysis & Definition: All requirements of the system which has to be developed are collected in this step.

System Design: The system has to be properly designed before any implementation is started.

UML: The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems, as well as for business modeling and other non-software systems

UCD: In object oriented analysis and design methodology, UCD form the basis for identification and documentation of requirement gathering phase in a procedural and graphical way.

Association: This is a basic relationship that exists between classes; it is a structural relationship which represents a binary relationship between objects.

Uni-Direction Association: At time we need to mention the direction of the association that exists between classes because we want to retrieve the value of class which is based on the value from another class.

Creational Patterns: Creational design patterns abstract the instantiation process or in other words we can say that it make the underlying system independent of how the objects are created, composed and represented.

Singleton Pattern: Singleton Design Pattern ensures that there is only one instance of a class and provides global point of access to it

Difference between release and iteration: Iterations are basically single units of work within your release plan. Typically, your iteration planning phase will be a short (1-4 week) series of tasks that will be done.After an iteration, there should be a series of acceptance tests. This verifies that the problem domain was handled correctly.The series of iterations plus acceptance lead to a single release. The release leads to deployment, whether to a customer or internal usage by the end user (which is the critical difference).Granted, in many teams, the lines can blur a bit, especially if you’re releasing every iteration, etc…