Skip to content

Instantly share code, notes, and snippets.

@DearRude
Last active January 30, 2023 01:47
Show Gist options
  • Save DearRude/3fa92d38abf4bdef9d50834e5acccc50 to your computer and use it in GitHub Desktop.
Save DearRude/3fa92d38abf4bdef9d50834e5acccc50 to your computer and use it in GitHub Desktop.
Software design summery

Table of Contents

  1. Process Models and Agile Development:
    1. Process
    2. Non-prescriptive process flow models
    3. Prescriptive process flow models
    4. Evolutionary models
    5. Framework activity
      1. Umbrella activity
    6. Agile
      1. Manifesto
      2. Principles:
    7. Other process models:
  2. Understanding Requirements
    1. Requirement engineering
      1. inception: شروع
      2. elicitation: استخراج
      3. elaboration: شناخت
      4. negotiation: مذاکره
      5. specification: تایین مشخصات
      6. validation: اعتبارسنجی
      7. requirements management: مدیریت خواسته‌ها
    2. QFD
    3. EWP
    4. Analysis models
      1. Elements of the analysis model
      2. Negotiating requirements
      3. Validating requirements
  3. Use case diagram
    1. Relation types
      1. Generalization relations:
      2. Dependency relations:
  4. Use case narrative
    1. Use case narration parts
  5. Activity diagram
    1. Fork node (هم‌روندی)
    2. Joint node (هم‌زمانی)
  6. Class diagram
    1. Class diagram parts
  7. Design patterns
    1. GOF design patterns
      1. Observer
      2. Mediator
      3. State
      4. Strategy
      5. Composite
      6. Decorator
  8. Software refactoring
    1. Basic refactoring
    2. Software refactoring process
  9. Software quality
    1. Factors
      1. Flexibility
      2. Reusability
      3. Maintainability
    2. Subfactors
      1. Expandability
      2. Modularity
      3. Adaptability
      4. Analyzability
      5. Testability
      6. Stability
      7. Simplicity
    3. OOP concepts
      1. Abstraction
      2. Inheritance
      3. Cohesion
      4. Coupling
      5. Polymorphism
      6. Encapsulation
      7. Complexity

Process Models and Agile Development:

مدل‌های فرایند و توسعه چابک

  • adaptable approach: رویکرد سازگار

Process

  • activity: فعالیت کاری
  • action: کنش
  • task: وظیفه

Non-prescriptive process flow models

  • linear
  • iterative
  • evolutionary: circular iterative
  • parallel

Prescriptive process flow models

prescriptive process models strive for structure and order

  • waterfall: when requirements are well understood
  • v
  • incremental: parallel lines

Evolutionary models

  • prototyping: circular
  • spiral
  • concurrent

Framework activity

  • commutation
  • planning
  • modeling
  • construction
  • deployment

Umbrella activity

  • project tracking and control
  • risk management
  • quality assurance
  • configuration management
  • technical reviews

Agile

Agility: rapid, incremental delivery of software. Conventional wisdom: that the cost of change increases nonlinearly as a project progresses.

A well-designed agile process may “flatten” the cost of change curve by coupling incremental delivery

Manifesto

  • individuals and interactions over processes and tools
  • working software over comprehensive documentation
  • customer collaboration over contract negotiation
  • responding to change over following a plan

Principles:

  • satisfy the customers
  • welcoming changes
  • deliver working software frequently
  • daily meeting
  • motivated individuals
  • face-to-face communications
  • working software
  • technical excellence
  • simplicity
  • self–organizing teams
  • tunes and adjusts

Other process models:

  • Component based development: the process to apply when reuse is a development objective
  • Formal methods: emphasizes the mathematical specification of

requirements

  • AOSD: provides a process and methodological approach for

defining, specifying, designing, and constructing aspects

  • Unified Process: a “use-case driven, architecture-centric, iterative and incremental” software process closely aligned with the Unified

Modeling Language (UML)

Understanding Requirements

فهم نیازمندی‌ها

Requirement engineering

مهندسی نیازمندی‌ها

inception: شروع

  • basic understanding
  • identify stakeholders
  • asking the first question

elicitation: استخراج

  • meeting with stakeholders & engineers
  • agenda suggestion
  • facilitator controls meeting

elaboration: شناخت

  • analysis model

negotiation: مذاکره

  • deliverable realistic system

specification: تایین مشخصات

  • written document
  • models
  • user scenarios
  • prototype

validation: اعتبارسنجی

  • errors in content or interpretation
  • required clarification
  • missing information
  • inconsistencies
  • unachievable requirements

requirements management: مدیریت خواسته‌ها

QFD

Quality function deployment: استقرار عملکرد کیفیت

  • needs -> technical requirements

EWP

Elicitation Work Products: استخراج محصولات کاری

EWP is a statement of need bounded for the product which customers, users and stakeholders participated to make

EWP includes description of system, requirements, usage scenarios or any provided prototypes.

Analysis models

Elements of the analysis model

  • scenario-based elements
  • class-based elements
  • behavioural elements
  • flow-oriented elements

Negotiating requirements

In order to achieve the best result, the stakeholders “win” condition first should get determined.

Then, the stakeholders’ win condition can get negotiated in order to achieve a “win-win” condition.

Validating requirements

  • Is the requirement consistent with the overall objective of the system?
  • Does the requirement have the proper level of abstraction?
  • Is the requirement really necessary?
  • Do any requirements conflict with other requirements?
  • Is each requirement testable, once implemented?

Use case diagram

  • Use case elements are based on the requirements of the system, not the solutions.
  • In use case diagram we show what the system does as opposed to how the system works.
  • Each element in the system must effect or be effected from the system.
  • Each element outside the system must depend or be depended from the system elements.

Relation types

  • association: line (انجمنی)
  • generalization: arrow (تعمیم)
  • dependency: dashed arrow (وابستگی)

Generalization relations:

A generalization relation depicts an inheritance of the use cases where the child use case have the parent’s features.

Usually when two use cases have the same type, a generalization relation is used.

Dependency relations:

vs

  • include is mandatory dependency while extend is secondary.
  • include can connect to actors while extend can’t.

Use case narrative

Use case diagram shows the requirements of the system visually while use case narrative describes what system requirements are.

Use case narrative includes information from analysis, design & coding steps.

Use case narration parts

  1. Assumption: فرضیات

    • Conditions which must be met before the execution of the system.
    • Unlike pre-conditions, assumptions are not evaluated before the execution.
    • e.g. user authentication for banking transactions.
  2. Pre-conditions: پیش‌شرط‌ها

    • Like assumptions, pre-conditions must be met before the execution of the system.
    • Unlike assumptions, pre-conditions are evaluated before the execution of the system.
    • e.g. evaluation of the user input
  3. Start: شروع

    • By calling a use case in the system, the start is began.
    • The start part can be called from an actor, another use case or in a timely manner.
    • When start is began, the different states of the system is described.
  4. Dialogue: گفت‌وگو

    • Includes the commutation between the actor and use cases or uses cases themselves.
    • Shows the different ways of how to implement a feature.
    • Dialogue does not illustrate implementation.
  5. End: پایان

    • A use case can end from controlled/planned or uncontrolled/unexpected actions.
    • The causation of the end should be in the dialogue part.
    • When the use case can end in many ways, pre-conditions can be used in order to balance the outputs.
  6. Post-conditions: پس‌شرط‌ها

    • A list of conditions and stated that must be met after the execution of the system use case.
    • Because the ending of the use case is not well-defined, system must be remain stable. Thus, post-conditions are used.

Activity diagram

  • Activity diagram describes the processes, dependencies, logical process of the system.
  • This diagram is an enhanced version of the flowchart which is used in the UML.
  • AD defines the steps and implementation of how things are done in the system; so details are not debated.
  • Each activity can itself have multiple activities inside.
  • An activity diagram have one start point and one or more end points.

Fork node (هم‌روندی)

  • When an activity diverge and can run in parallel.

Joint node (هم‌زمانی)

  • When multiple parallel activities merge and become one.

    Study diagram symbols in SLIDES

Class diagram

  • Class diagram is the main source of inspirition for making software. UML diagrams can be used to complete the details.

Class diagram parts

  • Class
    • Name
    • Attribute
    • Activity
  • Relation
    • Association (انجمنی)
      • Plurality (تعدد)
      • Restriction (محدودیت)
      • Restricted (محدود شده)
      • Reflation (بازتابی)
    • Aggregation (تجمع) Aggregation is a special kind of association where one or more relations belong to another relation.
    • Composition (ترکیب) Composition is a special kind of aggregation where if the parent relation demolishes, the childrent relations demolish as well.
    • Generalization (تعمیم)

Design patterns

Experienced designers try to reuse solutions that worked before. Patterns capture the static and dynamic structures and collaborations of successful solutions.

GOF design patterns

Gang of four design patterns are a set of 23 design patterns.

  • Creational: deal with initializing and configuring classes or objects.
  • Structural: Deals with composition of classes or objects and deal with decoupling interface and implementation of classes and objects.
    • inheritance
  • Behavioral: Characterizes ways in which classes or objects interact

and distribute responsibility

Observer

  1. Intent

    Define a one-to-many dependency between objects.

  2. Example

    • Different plot engines using the same spreadsheet data.
    • Email subscriptions.
  3. Applicability

    • When an abstraction has two aspects, one dependent on the other.
    • When a change to one object requires changing others.
    • When an object should be able to notify other objects.
  4. Participants

    • subject
    • observer
    • concrete subject
    • concrete observer

Mediator

  1. Intent

    Define an object that encapsulates how a set of objects interact by loose coupling.

    Restricts direct communication between objects and forces them to collaborate via a mediator, hence reducing the dependencies between then.

  2. Example

    • Planes in an airport communicate with the traffic tower instead of direct communication.
    • User inputs in graphical interfaces.
  3. Applicability

    • A behavior that’s distributed between several classes should be customizable without a lot of subclassing.
  4. Participants

    • mediator
    • concrete mediator
    • colleague
    • concrete colleague

State

  1. Intent

    Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

  2. Example

    • Having different classes for TCPConnection state such as TCPClosed & TCPOpen where TCPConnection’s methods would act differently in each state.
  3. Applicability

    • An object’s behavior depends on its state, and it must change its behavior at run-time depending on that state.
    • The state pattern convert logical conditions into structural subclasses.
  4. Participants

    • context: TCPConnection
    • state: TCPState
    • concreate state subclasses: TCPEstablished, TCPListen, TCPClosed

Strategy

  1. Intent

    Define a family of algorithms, encapsulate each one, and make them interchangeable. The object will appear to change its class.

    The difference between state and strategy is that:

    • Unlike state, in strategy we have different implementation of the same goal.
    • Unlike states, strategies are completely independent and unaware of each other.
  2. Example

    • Sorting algorithms
  3. Applicability

    • Many related classes differ only in their behavior.
    • An algorithm uses data that clients shouldn’t know about.
  4. Participants

    • context
    • strategy
    • concrete strategy

Composite

  1. Intent

    Compose objects into tree structures to represent part-whole hierarchies.

  2. Example

    • Calculating price of boxes and products.
  3. Applicability

    • You want to represent part-whole hierarchies of objects.
    • You want clients to be able to ignore the difference between compositions of objects and individual objects thus treating them uniformly.
  4. Participants

    • client (Box calculator)
    • component (Box)
    • composite (Composite Box)
    • leaf (Book, Videogame)

Decorator

  1. Intent

    Attach additional responsibilities to an object dynamically.

  2. Example

    • Notify users with email as well as SMS.
  3. Applicability

    • To add responsibilities to individual objects dynamically and transparently, that is, without affecting other objects
    • For responsibilities that can be withdrawn.
  4. Participants

    • component (INotifier)
    • concrete component (Notifier)
    • decorator (BaseNotifierDecorator)
    • concrete decorator (SMSDecorator, EmailDecorator)

Software refactoring

Software refactoring is the process of changing the structure of software without any alteration in its behavior and functionality.

Basic refactoring

extract: make, create inline: delete if unnecessary

  • extract class

  • extract subclass

  • extract superclass

  • extract interface

  • move class

  • rename class

  • extract method

  • inline methods

  • move methods

  • pull up methods

  • push down methods

  • rename methods

  • extract variable

  • inline variable

Software refactoring process

  1. determine the signature of the potentials
    • structural analysis
    • behavioural analysis
    • qualitative analysis
  2. detect the potentials
    • detect structural candidates
    • detect behavioural candidates
    • detect qualitative candidates
  3. investigate behaviour preservation
  4. investigate detected opportunities
  5. apply refactoring
    • code-to-code transformations
    • semi-automatically or manually

Software quality

  • functional requirements: define what a software product must do, features and functions

  • non-functional requirements: quality attribute factors of the system

  • quality factors -> quality subfactors -> OOP concepts -> quality metrics

Factors

Flexibility

How easy is to a system can be modified for conditions other than its purpose

Reusability

How much a module can be used in more than one system

Maintainability

How easy is to correct a module faults

Subfactors

Expandability

How easy is to build upon a module

  • formula: abstraction + polymorphism + inheritance - final and static class

Modularity

How much a system is composed of different modules

  • formula: cohesion + encapsulation - coupling - complexity

Adaptability

How well the system can adapt to changes

  • formula: cohesion - coupling - complexity - inheritance

Analyzability

How well the system can be diagnosed for deficiencies or causes of failures

  • formula: cohesion + inheritance - coupling - complexity - encapsulation

Testability

How much each component facilitates test criteria

  • formula: cohesion + inheritance - coupling - encapsulation

Stability

How resistance the system is to the amplification of changes

  • formula: abstraction - coupling - complexity

Simplicity

How simple is the design and implementation of the system

  • formula: 1 - complexity

OOP concepts

Abstraction

  • formula: (abstract classes + interfaces / classes) + (abstract methods / methods)

Inheritance

  • formula: average DIT, where DIT is the level of the class in an inheritance hierarchy

Cohesion

  • formula: average INS factors within the class, where INS is the instace method and instance variables.

Coupling

  • formula: average number of relations of each methods in class

Polymorphism

  • formula: (overloaded methods + overriden methods) / methods

Encapsulation

  • formula: (private variables / variables) + (private methods / methods)

Complexity

  • formula: (sum of iteration, declaration and jumps in each method) / lines of code in the class

Software Design

Process Models and Agile Development:

مدل‌های فرایند و توسعه چابک

  • adaptable approach: رویکرد سازگار

Process

  • activity: فعالیت کاری
  • action: کنش
  • task: وظیفه

Non-prescriptive process flow models

  • linear
  • iterative
  • evolutionary: circular iterative
  • parallel

Prescriptive process flow models

prescriptive process models strive for structure and order

  • waterfall: when requirements are well understood
  • v
  • incremental: parallel lines

Evolutionary models

  • prototyping: circular
  • spiral
  • concurrent

Framework activity

  • commutation
  • planning
  • modeling
  • construction
  • deployment

Umbrella activity

  • project tracking and control
  • risk management
  • quality assurance
  • configuration management
  • technical reviews

Agile

Agility: rapid, incremental delivery of software. Conventional wisdom: that the cost of change increases nonlinearly as a project progresses.

A well-designed agile process may “flatten” the cost of change curve by coupling incremental delivery

Manifesto

  • individuals and interactions over processes and tools
  • working software over comprehensive documentation
  • customer collaboration over contract negotiation
  • responding to change over following a plan

Principles:

  • satisfy the customers
  • welcoming changes
  • deliver working software frequently
  • daily meeting
  • motivated individuals
  • face-to-face communications
  • working software
  • technical excellence
  • simplicity
  • self–organizing teams
  • tunes and adjusts

Other process models:

  • Component based development: the process to apply when reuse is a development objective
  • Formal methods: emphasizes the mathematical specification of

requirements

  • AOSD: provides a process and methodological approach for

defining, specifying, designing, and constructing aspects

  • Unified Process: a “use-case driven, architecture-centric, iterative and incremental” software process closely aligned with the Unified

Modeling Language (UML)

Understanding Requirements

فهم نیازمندی‌ها

Requirement engineering

مهندسی نیازمندی‌ها

inception: شروع

  • basic understanding
  • identify stakeholders
  • asking the first question

elicitation: استخراج

  • meeting with stakeholders & engineers
  • agenda suggestion
  • facilitator controls meeting

elaboration: شناخت

  • analysis model

negotiation: مذاکره

  • deliverable realistic system

specification: تایین مشخصات

  • written document
  • models
  • user scenarios
  • prototype

validation: اعتبارسنجی

  • errors in content or interpretation
  • required clarification
  • missing information
  • inconsistencies
  • unachievable requirements

requirements management: مدیریت خواسته‌ها

QFD

Quality function deployment: استقرار عملکرد کیفیت

  • needs -> technical requirements

EWP

Elicitation Work Products: استخراج محصولات کاری

EWP is a statement of need bounded for the product which customers, users and stakeholders participated to make

EWP includes description of system, requirements, usage scenarios or any provided prototypes.

Analysis models

Elements of the analysis model

  • scenario-based elements
  • class-based elements
  • behavioural elements
  • flow-oriented elements

Negotiating requirements

In order to achieve the best result, the stakeholders “win” condition first should get determined.

Then, the stakeholders’ win condition can get negotiated in order to achieve a “win-win” condition.

Validating requirements

  • Is the requirement consistent with the overall objective of the system?
  • Does the requirement have the proper level of abstraction?
  • Is the requirement really necessary?
  • Do any requirements conflict with other requirements?
  • Is each requirement testable, once implemented?

Use case diagram

  • Use case elements are based on the requirements of the system, not the solutions.
  • In use case diagram we show what the system does as opposed to how the system works.
  • Each element in the system must effect or be effected from the system.
  • Each element outside the system must depend or be depended from the system elements.

Relation types

  • association: line (انجمنی)
  • generalization: arrow (تعمیم)
  • dependency: dashed arrow (وابستگی)

Generalization relations:

A generalization relation depicts an inheritance of the use cases where the child use case have the parent’s features.

Usually when two use cases have the same type, a generalization relation is used.

Dependency relations:

<<include>> vs <<extend>>

  • include is mandatory dependency while extend is secondary.
  • include can connect to actors while extend can’t.

Use case narrative

Use case diagram shows the requirements of the system visually while use case narrative describes what system requirements are.

Use case narrative includes information from analysis, design & coding steps.

Use case narration parts

Assumption: فرضیات

  • Conditions which must be met before the execution of the system.
  • Unlike pre-conditions, assumptions are not evaluated before the execution.
  • e.g. user authentication for banking transactions.

Pre-conditions: پیش‌شرط‌ها

  • Like assumptions, pre-conditions must be met before the execution of the system.
  • Unlike assumptions, pre-conditions are evaluated before the execution of the system.
  • e.g. evaluation of the user input

Start: شروع

  • By calling a use case in the system, the start is began.
  • The start part can be called from an actor, another use case or in a timely manner.
  • When start is began, the different states of the system is described.

Dialogue: گفت‌وگو

  • Includes the commutation between the actor and use cases or uses cases themselves.
  • Shows the different ways of how to implement a feature.
  • Dialogue does not illustrate implementation.

End: پایان

  • A use case can end from controlled/planned or uncontrolled/unexpected actions.
  • The causation of the end should be in the dialogue part.
  • When the use case can end in many ways, pre-conditions can be used in order to balance the outputs.

Post-conditions: پس‌شرط‌ها

  • A list of conditions and stated that must be met after the execution of the system use case.
  • Because the ending of the use case is not well-defined, system must be remain stable. Thus, post-conditions are used.

Activity diagram

  • Activity diagram describes the processes, dependencies, logical process of the system.
  • This diagram is an enhanced version of the flowchart which is used in the UML.
  • AD defines the steps and implementation of how things are done in the system; so details are not debated.
  • Each activity can itself have multiple activities inside.
  • An activity diagram have one start point and one or more end points.

Fork node (هم‌روندی)

  • When an activity diverge and can run in parallel.

Joint node (هم‌زمانی)

  • When multiple parallel activities merge and become one.

    Study diagram symbols in SLIDES

Class diagram

  • Class diagram is the main source of inspirition for making software. UML diagrams can be used to complete the details.

Class diagram parts

  • Class
    • Name
    • Attribute
    • Activity
  • Relation
    • Association (انجمنی)
      • Plurality (تعدد)
      • Restriction (محدودیت)
      • Restricted (محدود شده)
      • Reflation (بازتابی)
    • Aggregation (تجمع) Aggregation is a special kind of association where one or more relations belong to another relation.
    • Composition (ترکیب) Composition is a special kind of aggregation where if the parent relation demolishes, the childrent relations demolish as well.
    • Generalization (تعمیم)

Design patterns

Experienced designers try to reuse solutions that worked before. Patterns capture the static and dynamic structures and collaborations of successful solutions.

GOF design patterns

Gang of four design patterns are a set of 23 design patterns.

  • Creational: deal with initializing and configuring classes or objects.
  • Structural: Deals with composition of classes or objects and deal with decoupling interface and implementation of classes and objects.
    • inheritance
  • Behavioral: Characterizes ways in which classes or objects interact

and distribute responsibility

Observer

Intent

Define a one-to-many dependency between objects.

Example

  • Different plot engines using the same spreadsheet data.
  • Email subscriptions.

Applicability

  • When an abstraction has two aspects, one dependent on the other.
  • When a change to one object requires changing others.
  • When an object should be able to notify other objects.

Participants

  • subject
  • observer
  • concrete subject
  • concrete observer

Mediator

Intent

Define an object that encapsulates how a set of objects interact by loose coupling.

Restricts direct communication between objects and forces them to collaborate via a mediator, hence reducing the dependencies between then.

Example

  • Planes in an airport communicate with the traffic tower instead of direct communication.
  • User inputs in graphical interfaces.

Applicability

  • A behavior that’s distributed between several classes should be customizable without a lot of subclassing.

Participants

  • mediator
  • concrete mediator
  • colleague
  • concrete colleague

State

Intent

Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

Example

  • Having different classes for TCPConnection state such as TCPClosed & TCPOpen where TCPConnection’s methods would act differently in each state.

Applicability

  • An object’s behavior depends on its state, and it must change its behavior at run-time depending on that state.
  • The state pattern convert logical conditions into structural subclasses.

Participants

  • context: TCPConnection
  • state: TCPState
  • concreate state subclasses: TCPEstablished, TCPListen, TCPClosed

Strategy

Intent

Define a family of algorithms, encapsulate each one, and make them interchangeable. The object will appear to change its class.

The difference between state and strategy is that:

  • Unlike state, in strategy we have different implementation of the same goal.
  • Unlike states, strategies are completely independent and unaware of each other.

Example

  • Sorting algorithms

Applicability

  • Many related classes differ only in their behavior.
  • An algorithm uses data that clients shouldn’t know about.

Participants

  • context
  • strategy
  • concrete strategy

Composite

Intent

Compose objects into tree structures to represent part-whole hierarchies.

Example

  • Calculating price of boxes and products.

Applicability

  • You want to represent part-whole hierarchies of objects.
  • You want clients to be able to ignore the difference between compositions of objects and individual objects thus treating them uniformly.

Participants

  • client (Box calculator)
  • component (Box)
  • composite (Composite Box)
  • leaf (Book, Videogame)

Decorator

Intent

Attach additional responsibilities to an object dynamically.

Example

  • Notify users with email as well as SMS.

Applicability

  • To add responsibilities to individual objects dynamically and transparently, that is, without affecting other objects
  • For responsibilities that can be withdrawn.

Participants

  • component (INotifier)
  • concrete component (Notifier)
  • decorator (BaseNotifierDecorator)
  • concrete decorator (SMSDecorator, EmailDecorator)

Software refactoring

Software refactoring is the process of changing the structure of software without any alteration in its behavior and functionality.

Basic refactoring

extract: make, create inline: delete if unnecessary

  • extract class
  • extract subclass
  • extract superclass
  • extract interface
  • move class
  • rename class
  • extract method
  • inline methods
  • move methods
  • pull up methods
  • push down methods
  • rename methods
  • extract variable
  • inline variable

Software refactoring process

  1. determine the signature of the potentials
    • structural analysis
    • behavioural analysis
    • qualitative analysis
  2. detect the potentials
    • detect structural candidates
    • detect behavioural candidates
    • detect qualitative candidates
  3. investigate behaviour preservation
  4. investigate detected opportunities
  5. apply refactoring
    • code-to-code transformations
    • semi-automatically or manually

Software quality

  • functional requirements: define what a software product must do, features and functions
  • non-functional requirements: quality attribute factors of the system
  • quality factors -> quality subfactors -> OOP concepts -> quality metrics

Factors

Flexibility

How easy is to a system can be modified for conditions other than its purpose

Reusability

How much a module can be used in more than one system

Maintainability

How easy is to correct a module faults

Subfactors

Expandability

How easy is to build upon a module

  • formula: abstraction + polymorphism + inheritance - final and static class

Modularity

How much a system is composed of different modules

  • formula: cohesion + encapsulation - coupling - complexity

Adaptability

How well the system can adapt to changes

  • formula: cohesion - coupling - complexity - inheritance

Analyzability

How well the system can be diagnosed for deficiencies or causes of failures

  • formula: cohesion + inheritance - coupling - complexity - encapsulation

Testability

How much each component facilitates test criteria

  • formula: cohesion + inheritance - coupling - encapsulation

Stability

How resistance the system is to the amplification of changes

  • formula: abstraction - coupling - complexity

Simplicity

How simple is the design and implementation of the system

  • formula: 1 - complexity

OOP concepts

Abstraction

  • formula: (abstract classes + interfaces / classes) + (abstract methods / methods)

Inheritance

  • formula: average DIT, where DIT is the level of the class in an inheritance hierarchy

Cohesion

  • formula: average INS factors within the class, where INS is the instace method and instance variables.

Coupling

  • formula: average number of relations of each methods in class

Polymorphism

  • formula: (overloaded methods + overriden methods) / methods

Encapsulation

  • formula: (private variables / variables) + (private methods / methods)

Complexity

  • formula: (sum of iteration, declaration and jumps in each method) / lines of code in the class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment