1/131
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Software Engineering
application of a systematic disciplined quantifiable approach to the development, operation, and maintenance of software
Analysis
Investigation of the requirements
Design
Conceptual solution that fulfills the requirements, rather than its implementation
Object Oriented Analysis
Emphasis on concepts (real world things that pertain to what is required of the software)
Object Oriented Design
emphasis on software objects and how they collaborate to meet requirements
Scrum
(Agile Process) 2-4 week sprints
Agile Process
Breaking projects into little user styories and delivering them in 2 to 4 week sprints
User Story
As a (role) I want (feature) so that I can (accomplish)
Product backlog
Requirements (items in backlog)
Agile Process Stages
Continuous Analysis, Design, Code, Test
Software Design Principle (SDP)
Our plan to build software for customer’s specification
Waterfal
sequential design process
Gantt Diagrams
Boxed waterfall into iterations
Unified Process Stages
Inception, Elaboration, Construction, Transition
Inception Stage of UP
identifying scope and architecture and getting budget (1-2 weeks)
Elaboration Stage of UP
prove we have the right architecture (4-6 weeks)
Construction Stage of UP
build software incrementally requirements as a priority queue (time who knows?)
Transition Stage of UP
Validate system and move to production
Use Case
Textual Story between actors focuses on how system will fulfill a goal (captures requirements)
Requyirement
necessary attribute or constraint of system
SRS
Software Requirements Specification
Virtual Method
any method not private final or static is virtual =meaning it can be overriden by subclasses
Hash Code & Equals
Is a logical comparison rather than a memory location comparison
concept
abstract idea of entity in domain (real world) used during analysis to capture domain knowledge.
class
software construct that defines attributes methods and relationships
Concepts are extracted with
Noun analysis and categorical lists
List (ordered)
has duplicates accessible by index (ArrayList, Linked List)
Set (Unordered)
Collection of unique elements (Hashset, Linked Hashset, Treeset)
Collections are used to
store, retrieve, manipulate, and communicate aggregate data
Op Contract Parts
Name, Cross References, Preconditions, Postconditions
Synchronous Arrow
Caller waits for Callee
Types of Interaction Diagrams
Communication Diagram, Sequence Diagram
Asynchronous Arrow
Sender does not wait
Domain Model
conceptual “analysis” model that reflects real world entities their attributes and relationships
Design Class Model
Concrete implementation-oriented model that shows classes their methods data structures and design patterns etc.
Java primitive types
byte, short, int, long, float, double, char, boolean
Finally block
runs no matter what
Compiler steps
program → asm → result
Interpreter Steps
Program → result
Java compilation steps
java program → compiler →bytecode then to either
Java interpreter for Linux
For windows
For linux
.java -(compilation)→ .class -(interpretation)→ machine code
JRE
Java Runtime Environment
Java Garbage collection
Keeps track of what’s alive, reclaims what isn’t
no explicit deletion and no memory given back to OS.
Wrappers
Short, Integer Double, …
Class based types
String, Date, Calendar
parameters
list of variables in method DECLARATION
arguments
actual values passed into method
Primitives are passed by
value
Objects are passed by
value
GRASP
General Responsibility Assignment Software Patterns
Object Design
Identify classes and objects
what methods belong where
how these objects interact
Responsibilties:
Doing: doing something itself, initiating action in other objects controlling or coordinating activities in other objects
Knowing: Knowing about private encapsulated data ab out related objects about things it can derive/ calculate
Responsibilities are assigned to classes during
object design
Methods and responsibilities
are not the same, methods implemented to fulfill responsibilities.
Patterns
Principles to guide choices when assigning responsibilities.
A pattern is a named description of a problem with a solution applicable to new contexts.
Controller
who should be responsible for handing an input system event.
Assigns the responsibility
Facade Controller
has few system operations
Use case handler
when there are many system operations among distinct processes or facade controllers would be bloated
Role controller
person like objects instead of delegates
Benefits of controllers
increase potential for reuse
keep external event sources and internal event handlers independent of each other’s type and behavior
Creator
Who should be rsbl for creating a new instc of some class?
Assn class B the rsbl to create an instc of class A if one or more of the following
B agg A objs
B contains A objs
B records ints of A objs
B has init data to pass to A when created
Information Expert
What is the general principle of assn rsbls to objs?
Assn a rsbl to the info expert the class that has the info to fulfill the rsbl
Implies many partia experts who will collaborate in the task
Coupling
measure of how strongly one element is connected to has knowledge of, or relies on other elements
High coupling
highly dependent on many others
harder to understand in isolation
harder to reuse with presence of other classes
Cohesion
measure of how strongly related and focused the rsbls of an element are
Low cohesion
Unrelated/Unfocused
hard to understand
hard to reuse
hard to maintain
delicate to change
What kind of coupling and cohesion is desirable?
low coupling & high cohesion
4 kinds of objects (coupling & cohesion)
coupling & cohesion:
low & low: Destructive Decoupling
high & low: Poorly selected boundaries
high & high: God object
low & high: Ideal
Polymorphism
A property of Object Oriented software by which an abstract operation may be performed in different classes (different ways)
Exist when several classes which each implement the operation either have a common superclass or implement an interface that contains the operation
Polymorphism gets its power from
dynamic binding
Dynamic binding
The process of binding a call to a particular method, this is performed dynamically at run-time due to the presence of polymorphism.
Is needed when compiler determines that there are multiple possible methods that could be executed by a call.
Types of java Event handling
Event sources (buttons, mouse event)
event listener: interfaces to handle events
event object: data obj passed to listeners ActionEvent e
Method overloading
The process of redefining a method with the same name with different parameters
3 methods to override when creating a class
toString
hashCode
equals
shortest phase in UP
Inception
SSD
System Sequence Diagram just between actor and black box system
SD
Sequence Diagram, involves what happens on the system side
Can you instantiate an abstract class?
No
Can you implement as many interfaces as you want?
Yes
How to make a button in Java
JButton button = new JButton(“Click”);
What is the top level container in Java Swing called?
JFrame
Coupling
degree of interdependence among modules
Pure Fabrication
When both A and B should have some responsiblity for x, create a fabrication class C for x
SOLID
S - Single Responsibility Principle
O - Open Closed Principle
L - Liskov Substitution Principle
I - Interface Segregation Rule
D - Dependency Inversion Principle
DRY
DONT REPEAT YOURSELF
KISS
Keep it Simple Stupid!
Single Responsibility Principle:
A class should only have a single responsiblity only oen reason to change
Open-Closed Principle
software should be open for extension but closed for modification
Liskov Substitution Principle
Objects should be replaceable wwith subtypes while still being correct
Interface Segregation Rule
Many client specific interfaces are better than one general purpose interface.
Dependency Inversion Principle
One should depend on abstractions not concretions
Indirection
Don’t access directly
Law of Demeter
Don’t talk to strangers (avoid knowing structure of others)
Fault Detection (methods)
Testing, Debugging, Monitoring, Verify/Validate, Unit Testing
Verify vs Validate
Types of Testing
Grey, White Box, Black box testing
Unchecked Exceptions
Log errors caused by programmers runtime error
Checked exception
must be caught or declared (try catch block throws)
Logging levels
Finest, Fine, Config, Info, Warning, Severe
Logger.setLevel(level.warning)
Thread interference
Multiple threads acting on the same data, causes interleaving, sequence of steps overlap