Professional Documents
Culture Documents
5:52 PM
Command
Meaning
man {cmd}
cd
cd ..
pstree -p
pgrep {name_pattern}
Shortcuts
pkill {name_pattern}
locate {name_pattern}
{cmd} &
jobs, bg
ps
kill {pid}
fg
ls -l
head -n={k} {file_list}
Input/Ouput Redirection
less/more {file}
ln -s
ln
chown
chmod
Git
Tuesday, October 25, 2016
10:55 AM
Command
Meaning
git init
git add *
Delete branch
git log --graph --oneline --decorate --all Visual history by ASCII art tree
git clone {url}
git pull
Github Flow
- Fork:
Copy a repository, allow you to freely experiment with changes
without affecting original repository
Can be used as:
- Merge
* NOTE: Update fork repository
upstream: Name of remote original repository which is forked
origin: Remote storage of your project (forked from upstream
previously)
git fetch upstream
11:50 AM
Test sys
Maintain sys
Name
Illustration
Pros
Cons
- Easy to kick-start
Missing/Unmatched requirements
- Unpredictable dev proc
Over schedule, over budget
Waterfall
- Dev proc: More predictable, easy to monitor - Requirement revision is difficult: The cost
(time, human) of changing requirements is
expensive
- Enforce standards:
Documentation (requirements,
implementations) required
Approval required before proceeding
to next steps
Prototyping
- Accommodate good features of Waterfall & - More appropriate for internal dev than
Prototyping:
external contract dev: Lot of dev-client
comm required to get things "right" soon
Waterfall: Enforce discipline
(documentation)
Prototyping: Early feedback
- Emphasize RISK:
Agile Development
Agile Practices
Individual & interaction over processes & tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Response to change over following to plan
Principle:
1. Highest prio: Satisfy customers through early & continuous
delivery of valuable software
- Standup meeting
1. SCRUM
Advantages:
- Low criticality (suitable for developing sys which is not
mission-critical, not require extremely precise engineering)
NOT for rocket control software,
- Suitable for small team of senior devs
Lean analytics
Requirements
Thursday, October 27, 2016
12:33 AM
Requirement validation
Requirement Overview
- Purpose:
Help software dev recall goals, details
Means of comm between clients & dev team: Help clarify user expectation & reality
- Type:
User requirement
System requirement
- Describe:
- Def:
Statement of what should be built by developers
- Describe:
Non-functional requiremet
Describe:
Sys representation
Sys models: Visualize rel between sys components & external env
Sys evolution:
What are assumptions where sys based on?
In future, what are potential sys changes due to hardware,
changing user needs?
Appendix
Index
1. Natural language:
- Sentences + Supplement diagrams
User Story
- Problems;
Lack of clarify: Precision Difficult to read document
Confusion:
Mix up func & non-func requirements
Mix up different requirements into single one
-
- Guideline:
Use standard format throughout documents
Be consistent
SHALL = Mandatory
SHOULD = Desirable
Highlight text Identify key parts
Avoid computer jargons
- Def: 3C:
Card: Written on a cue card
Conversation:
always, never,
Explain uncompleted list (etc, so on) clearly
2. Structured language:
- Writen requirements in standardized format
Valuable
Estimatable
Small (size appropriately)
Testable
UML
Modeling
11:42 AM
- Beneftis:
Describe reality in succinct way
UML
- Type:
Static modeling: Static, code-lvl rel within sys
Class, Components, Package diagram,
Behavioral modeling: Dynamic exec of sys
Use case, Collaboration, State Diagram,
- OO Modeling steps:
Requirement: Construct problem domain
- Object:
- Physical/abstract thing having boundary
- Class:
Def: Group of Object having common in: semantics, state,
behavior, relationship:
Template for creating object
Provide abstraction for collection of individual objects
- Multiplicity:
Restriction on number of ojects of a class that may related to an
object of another class
Association A
Object of class C1 can related to x objects of class C2
c x d c = MinCard(C1, A)
d = MaxCard(C1, A)
Object of class C2 can related to y objects of class C1
a y b a = MinCard(C2, A)
b = MaxCard(C2, A)
Special symbols:
OO Concepts: Generalization
a *: MaxCard =
*: MinCard = 0, MaxCard =
1: MinCard = MaxCard = 1
Simplify modification
Promote reusability
- Coverage:
Overlapping
Disjoint
Complete
Incomplete
Class Diagram
Wednesday, October 26, 2016
9:00 PM
UML Symbols
Name
Symbol
Meaning
Generalization
A subclass B
= A inherit B
Realization
Dependency
Association
Aggregation
Composition
Class
Constraint
Constraint
Dynamic Modeling
(For modeling programs)
Static Modeling
Use-Case Diagram
Tuesday, October 25, 2016
3:13 PM
Purpose
UML Symbols
Name
Actor
User case
Symbol
Meaning
How to identify
- Represent something
outside sys
- Provide input/Receive
output from sys
- Init by actor
Assocation
Sequence diagram
Tuesday, October 25, 2016
3:22 PM
UML Symbol
Best practices
Name
Boundary class
Symbol
Meaning
- Interact with:
- Represent concepts:
Individual, real-life object, real-life
event,
3:36 PM
Overview
Design Patterns
Wednesday, October 26, 2016
10:47 PM
Architecture Pattern
Name
Illustration
ModelViewController
(MVC)
Explaination
Benefits
- Model:
Manage sys data
Associate operations
on data
- View: Define & Manage
how data presented to
user
- Controller:
Manage user
interaction
Pass user interaction
to View & Model
Layered
ClientServer
Repository
- Repository: Maintain
shared data, can be
accessed by sub sys
- Sub sys:
Maintain own data
Pipe-and-
Functional transformation
Pipe-andFilter
Functional transformation
process input, produce
output
Object-Oriented Pattern
Thursday, October 27, 2016
11:47 AM
OO Patterns
Principles:
1. Encapsulation:
Identify the aspects of application that vary
Separate them from what stays the same
2. Program to an interface, not an implementation
3. Favor composition over inheritance (HAS-A can be better than IS-A)
Name
Illustration
Algorithm
Observer
Explaination
Benefits
- Encapsulate each
- Principle 1:
Mediator
Object reusability:
Mediator
- Easy maintenance:
Centralize control logic
- Use when:
- Many-to-many interaction
1-to-many
Adapter
Decorator
- Component: Abstract
Beverage
- ConcreteComponent:
Inherit Component
Dynamically add new
behaviors
HouseBlend, DarkRoast,
Expresso, Decaf
- Decorator:
Abstract class: Provide
foundation for decorator
subclasses
Inherit Component, as need
to be able to wrap around
Component-inheriting
classes
CondimentDecorator
- ConcreteDecorator:
Inherit Decorator
Has instance variable for
thing it decorates (wraps)
Extend existing methods by
combining results returned
by them with some new
computation
public abstract class Beverage {
String description = "Unknown Beverage";
Mocha.getDescription()
Mocha.getCost()
Mocha.getCost()
public String getDescription() {
return description;
}
public abstract double cost();
Factory
Refactoring
Tuesday, December 13, 2016
11:53 PM
Refactoring Category
Techniques
Compose Methods
- Extract/Inline method
- Replace temp with Query
Overview
- When to refactor:
New feature added
- Substitute Algorithm
Code review
- Hide Delegate
Deadline close
- Encapsulate Field/Collection
- Rename/Parameterize/Hide Method
- Add/Remove Paramter
- Seprate Query from Modifier
- Replace Parameter with Explicit Methods
- Preserve Whole Object
- Replace Parameter with Method
- Introduce Parameter Object
- Remove Setting Method
- Replace Constructor with Factory Method
- Replace Error Code with Exception
11:22 PM
Debugging
Tip
What to do
- Unit testing
- Regression testing: Run test whenever code changes
Hard bug:
Explain bug to friend
Rebuild system from scratch, reboot
- Techniques:
- Use Exception
- In case of bug:
Return neutral (harmless) value
Testing
5:52 PM
- Principle
Identify sets of inputs with same behavior
Overview of Testing
Destructive activity
{-3, -2, -1}: Can also reveal error, but not best: Not minimal
- Discovery of input sets:
Require perfect knowledge
Can approx cheaply through heuristics, based on:
Program-dependent info: Actual code
Program-independent info
Requirement spec, data structure,
Regression Testing
White-box Testing
Sunday, December 11, 2016
11:35 PM
Overview
Sample program
Choose subdomains to ensure that we execute all:
- Independent paths, at least 1 Basic Path Testing
1
2
3
4
5
6
7
8
9
10
Step
Example
= No of region
= No of edges - No of nodes + 2
= No of simple predicate nodes
+1
Region:
- Areas bounded by nodes,
edges
- Area outside graph
V(G) provides upper bound on
no of paths need testing
V(G) = 5
3
Test case
1 2 3 4a 5 6 7 8 9 10
Enrollment is open
1 2 3 4a 4b 5 6 7 8 9 10 Enrollment is open
Student doesn't have exclusions
1 2 3 4a 4b 7 8 9 10
Enrollment is open
Student doesn't have exclusions
1 2 3 8 9 10
1 2 9 10
Enrollment is open
Student has exclusions
Enrollment is closed
Condition Testing
Loop Testing
- Source of error:
Simple condition: a rel-op b
rep-op {<, , =, , , >}, also NOT
Compound condition: a AND b, a OR b
Types of Loop
Simple (n
iterations)
Illustration
How to test
- 0, 1, 2 passes
- m passes (m < n)
- (n - 1), n, (n + 1) passes
NOT A
Nested
- Branch testing:
For compound condition C, test T & F branch of C
and every simple conditions of C
Concatenated
a > b: T & F
C < d: T & F
- Domain testing:
For expression E1 rel-op E2, use values that makes
Unstructured
Refactor code!
Black-box Testing
Sunday, December 11, 2016
Boundary Testing
11:55 PM
Input type
Range
Input
Range [a, b]
- a, b
- Values just above/below a, b
Set of
discrete
values
- T, F
- 1 non-boolean value
Data
structure
with
boundaries
- Boundary values
- Value just above/below them
Boolean
Testing Strategy
Sunday, December 11, 2016
Phase
11:57 PM
Purpose
Issues
- White box
- Black box
Integration Verify
testing
components
interact
correctly
- Black box
Bottom up testing
Sandwich
How
Pros
- Parallel testing
Illustratio
n
- No stubs needed
Cons
Verify system
functions
correctly as a
whole
Integration/System
tester
Black box
Client, User
Black box
Use cases
Domain model for database
Performance
For each requirement: Construct evaluation scenario Demonstrate requirementis met
Automatic Testing
Sunday, December 11, 2016
11:58 PM
Symbolic testing
- Principle:
Execute program symbolically
- Main types:
- Definitions:
- Algorithms behind:
Sample program
int foo(int a, int b) {
int x = 0, y = 0, z = 0;
if (a) { x = -2; }
if (b < 5) {
if (!a && c) {
y = -1;
}
z = 2;
}
assert(x + y + z != 3)
- Do 2 things simultaneously:
Given concrete inputs, execute program concretely
Also consider inputs as symbols, collect symbolic
conditions along the concrete execution path
Concrete
Concolic
Symbolic
- Simple program
- Scalable
- Not scalable
- Scalable (lesser)
Need to negate a lot of nodes
- Less coverage
- High coverage
- High coverage
- No false positives
- No false positives
- False positive
Loop programs (we don't know how
many times loop will run)
Joel Testing
Sunday, December 11, 2016
11:58 PM
No
Question
Benefits
- Enable roll-back
2
- Save time
- Ship new software version faster
Single script:
Full checkout from scratch
Need to record:
How to reproduce bug
Expected & actual behavior
Responsible party, status, priority
5
- Prevent feature creep: Dont take on anything without checking schedule first
7
10
11
12