Software Analysis and Design Lecture 3-8

Requirements is not necessities

Requirement interact with tasks -> stps
i.e. Pacman video game involved requirement

Use case diagram is used to represent requirements

Activity Diagram: sequence of something, condition, loop
State diagram

Functional

i.e.
Ensure normal song is played when no pellets are eaten

  • what the software do

  • Basically if you have to program it, it’s functional

  • if its not a constraint then its functional

anything the software will do is considered a functional requirement

Non-fuctional

we may still need to code,
non fuctional is about quality

i.e.

  1. Add multi-device functionality (mouse/keyboard, controller)

Not a requirement

  • Ages 3+ should be able to play the game and easily figure out the baisc movement of pac-man
    (Hard to test, out of devlopers’ responsibility)

  • Code for the actual Pac-Man game need to be well documented and clear enough
    (Not valuable for customer)

  • Program must always load “properly”
    (If related to quality, be more specific)

  • Add a timer to the previous functionality that decreases per round
    (Violet independent)

WHAT vs. HOW

  • Ask users what they need, not how to do that
  • Customer: I need a PacMan game
  • Developer: classes…functions…

Lecture 4

Use case Diagrams

Use case: **put the **title of one requirement inside.

Use cases capture requirements.

Actor –put the name of an actor at the bottom side.

An actor specifies a role played by an external entity

who? -> actor

  1. pacman = player
  2. Ghost = enemy = system = AI

Each oval is a requirements

Each person is an actor

LECTURE 5

Use case diagram is most important, sequence and state diagram is used to help on details

Activities

  • what is an activity: steps, actions in particular conditions, loops
  • what is the difference between activity and requirement?

Activity is not equal to requirement.

Activity diagram represents Algorithm

requirements are comprised of steps/actions

if requirement is dish, activity is elements inside dish.

**State diagram: every lines has text on it, has no diamonds **

Activity diagram has diamonds, not neccessary has text above line

  • States, represents as box. the information in the box is value for something

  • Event is a line, to exhibit some predictable from of behavior

    state diagram and state machine diagram are the same

Lecture 6

  • Object-oriented analysis is a method of analysis that examines requirements from the persepective of the classes and objects

    • (Inheritance, composition, association)
  • Object-oriented design is a method of implementation

Inheritance: The arrow point to B, so B is parent

Composition / aggregation: Black diamond is composition, white diamond is aggregation. white diamond, optional. Black diamond, something that must hav

Association: has arrow a —-> b means a calls b’s method

——–x means static

~ means protected

Lecture 7 Objected Oriented II

**Class diagrams **

  • modifiers

  • attributes

  • methods

    (+ - )

Relationships

  • Association / Dependency (Use)
  • Aggregation / composition (has)
  • Generalization / specialization/ realization ( Inhertence: is)

Represent Class a is using Class b

  • Solid line bewteen them (Association)
  • No arrows means a is using b, and b is using a
  • Usually we place an arrowhead, a point to b means a is using b.

Association

  • Use relationship, it can be two direction or single direction, depends on whether it has arrow. With arrow, only one direction, Student -> book means student uses book.

Aggregation / Composition

  • White diamond is aggregation (optional)
  • Black diamond is composition (necessary)
  • Diamond point to the Owner, i.e. Car have engine, black diamond point to Car
  • If I new Object, that is a black diamond.

Generalization / Realization/ Specialization

Generalization **represent **Inheritance : Tiger is a animal, a solid line, traingle point to person means Student is a person,

Realization: The relationship between class and interface, represent class is the realization of features of the inteface. Dash line with traingle arrow head

We can use inheritance between two interfaces, using solid line, and keywords “extends”

Q/A: Inheritance from parent to child interface No

Lecture 8 Objected Oriented III

inheritance / implement difference?

  • Inheritance uses extends

  • implement uses inteface

Super calling constructor of parent class

Lecture 9