Final Prep Flashcards
When did Agile really start taking off
about 13 years ago (2005)
before, we used waterfall
Uncle Bob Video:
smaller iterations and constant feedback (like a RD in writing)
don’t let yourself get blocked by anything
delay decisions with good architecture. make business rules early and defer everything else
no grand redesigns. just clean up a little each time
say no to things. choose good code over meeting deadlines
When did Test-Driven Development (TDD) really start taking off?
8 years ago
you don’t want to be good at debugging
tests bring enthusiasm and sense of accomplishment
continuous stream of quality documentation
cost and risk of making changes goes way down. code is sensitive on the one-bit level. other things in life aren’t like this
– TDD is like double-entry bookkeeping in accountancy
tests must be automated
“decoupled code”
testable code
INVEST - [ I ]
User Stories.
Independent
not always possible but good thing to seek
INVEST - [ N ]
User Stories.
Negotiable
conversation to be had
INVEST - [ V ]
User Stories.
Valuable
to the user
INVEST - [ E ]
User Stories.
Estimable
should be small/discrete enough that a decent timeframe can be given
INVEST - [ S ]
User Stories.
Small
big = not estimable
INVEST - [ T ]
User Stories.
Testable
able to create definition of done
acceptance criteria established
Three components of a user story
CARDS (physical medium)
CONVERSATION (discussion surrounding)
CONFIRMATION (tests to verify)
SMART - [ S ]
Tasks.
Specific
Everyone knows what’s involved. Tasks don’t overlap. Can determine whether it fits within the bigger plan.
SMART - [ M ]
Tasks.
Measurable
Do you know when it’s done
SMART - [ A ]
Tasks.
Achievable
No person should have a task too difficult for them to complete. And everyone should be able to ask for help if it’s not doable.
SMART - [ R ]
Tasks.
Relevant
Fits into the bigger story. Stories are broken up for the sake of developers. Should be able to explain to a customer why a task is relevant though.
SMART - [ T ]
Tasks.
Time-Boxed
doesn’t have to be a formal, strict estimate, but there should be expectations so that people know when they need to seek help/split up a task
Core Design Principles of Java
platform independent
- JVM is an abstraction and programs do not access the OS directly
- high portability
object-oriented
- except primitive data types, all elements are objects
strongly-typed
- variables are pre-defined and conversion is relatively strict
interpreted and compiled
- source code is transferred into bytecode format
- these instructions are interpreted by the JVM
A Few More Basics of Java
- syntax heavily influenced by C++
- statically typed
- imperative language
- criticized for being verbose
- most-used language according to GitHub
- owned by Oracle
- visibility (scope) is the same as in C++
A few predefined classes in Java
String, Vector, Stack, Hashtable, and many others
A Stack is a subclass of Vector which is a subclass of Object. All classes in Java are subclasses of the class Object.
Java “field”
= variable
Java “method”
= function
methods can be overloaded with one name referring to multiple methods (params/return val/etc different)
abstract methods (from polymorphic abstract object) have to be overwritten/cannot have an implementation public interface Driveable { }
Git
Distributed version control system
“upstream” is your teams repository after forking
rebase = alternative to git merge master (produces cleaner history)
TDDs’ three rules
Write a failing test before writing any production code
don’t write more of a test than is sufficient to fail/fail to compile
don’t write more production code than is sufficient to make the currently failing test pass
The TDD cycle
RED (fail test)
GREEN (production code)
REFACTOR
Why TDD?
Design and documentation more than it is verification
close feedback loops
clear starting points
throw away less code
worry about I/O less
more confidence
non-functional requirements
SLA’s (Service Level Agreement)
quantitative
functional requirements
what it needs to do
system behavior when interacted with
User Story basics
plain english
As a ____, I want ____ so that ______
3x5 index
stick to wall/whiteboard
have conversation with product owner
confirmation written on back of the card
functional decomposition
programs (like C) are decomposed into functions, that operate on common data structures
as opposed to OO-decomposition
object oriented decomposition
A system is decomposed according to the objects a
system is supposed to manipulate (like Java)
Objects communicate through well defined
interfaces
as opposed to functional decomposition
Encapsulation
Group together data (variables) and methods
(functions) in one unit
all variables should be hidden (private) and
only accessible by the methods in the class
Inheritance
Also known as subclassing or subtyping
Classes inherit fields and methods with the extends keyword
Java only supports single inheritance (you can only
extend from one class)
– all roots trace back to the Object class
Polymorphism
subclass can always be used instead of parent class
SOLID - [ S ]
Object-Oriented Design.
Single Responsibility Principle (SRP)
class has only one responsibility/reason to change
class should only know about one thing; it should only act like one logical object
SOLID - [ O ]
Object-Oriented Design.
Open-Closed Principle (OCP)
classes should be closed for modification, open for extension
when new requirements, add code instead of changing code
examples: chrome extensions, IDE plugins, OS drivers
SOLID - [ L ]
Object-Oriented Design.
Liskov Substitution Principle (LSP)
subclass has contract with parent to do everything it does
SOLID - [ I ]
Object-Oriented Design.
Interface Segregation Principle (ISP)
only use classes you need
SOLID - [ D ]
Object-Oriented Design.
Dependency Inversion Principle (DIP)
depend on abstractions not concretions
“Message” from “text message” and “email message”
“Ship” from _____