gw sdab dev tools 2012
Post on 15-Jan-2015
106 Views
Preview:
DESCRIPTION
TRANSCRIPT
1
GW SDAB | DEV TOOLSHervé Vũ RousselSeptember, 12th 2012
Point of views
Ask as they come to you!
Questions?
4
Agenda
SVN ANT JUnit Ticketing system
ABOUT ME (VISUAL APPROXIMATION)
5
France
Vietnam
Unusual name
Hervé Vũ Roussel
Career choice
Brain surgeon
Engineer
Astronaut
B.S.,GWU
Honors Scholarship
Gelman Library
CS department
Civil Engineering department
Weekends
Web dev at French consulate
M. Eng., Cornell University
Going to classes
Siemens Medical Solutions, 3.5k emp.
ME
CA (Computer Associates), 15k emp.
ME
Unstoppable
Day 0 | Linked Senior
Day 1 | Linked Senior
Day 2 | Linked Senior
Day 3 | Linked Senior
Day 4 | Linked Senior
Day 5 | Linked Senior
Day 6 | Linked Senior
Day 7 | Linked Senior
Day 8: Happy seniors | Linked Senior
Day 9: More happy seniors | Linked Senior
Today | Linked Senior
Office | Linked Senior
Team | Linked Senior
ME
More team | Linked Senior
Amazing adventure | Linked Senior
TEAM WORK
40
School VS Real world
Team size
Team location
Project life
Complexity
Customers
47
48
SUBVERSION (SCM)
49
Where will you store your SD code?
To: hroussel@gmail.comAttachment:
2003-02-01-post-simha-pres.zip
Storage
Concurrent access
Version tracking
History
54
Architecture
55
Hands on | Project
Project: ZooZooPet Educational game for kids Web & Android version API team
Company
56
Hands on 1 /3
Development stage Teams
Team #1: Make the Lion speak Team #2: Make the Tiger speak
Goal: 1.0 release
57
Initial download: svn checkout
Code
59
Submit code: svn commit
60
Submit code: svn commit
61
Submit code commit
History view on repo
svn log
63
svn log [path]
com/linkedsenior
games
tic-tac-toe
sudoku
word-search
video audio
svn diff
svn diff
What was I working on?
67
Synchronize: svn update
68
69
2-way merge
70
2-way merge GUI
71
72
SVN | Workflow
Synchronize• svn checkout• svn update
Work• svn add• svn mkdir• svn del
Review changes• svn diff• svn status• svn revert
Resolve (optional)• svn resolve• svn merge
Publish• svn commit
73
Hands on 1/3 | Outcome
74
ZooZooPet | Best game ever
1.0 released (1 billion download) Thinking about 2.0 features
More animals Team#2 assigned
Bug found in public release of 1.0!
75
Hands on 2/3
1.0 released Bug #1 filed Bug fix on 1.0, release 1.1 2.0 release
Release management
Fix version 1.0 in the wild
Tagging
Tagging 1.0
svn switch [rev] [path]
Creeped up bug
Time to switch revision
20 sec.
Time to clean re-build app
30 sec.
Time to find if bug exists
5 min.
Wiping sweat
2 sec.
Num of rev between v1.0 and v1.8
<-- 150 rev. -->
Calculating…
(20+30+5*60) *
log2(150)
Time to find guilty rev
42 min 6 sec
Branching
90
Hands on 2/3 | Outcome
91
svn copy
Taggingsvn copy -r {rev} http://.../trunk http://.../branches/1.x
Branchingsvn copy -r {rev} http://.../trunk http://.../tags/1.0
92
svn copy
ZooZooPet
trunk tags
1.0
branches
1.x
93
Problem with evolution of code
94
SVN: 3-way merge
95
Best practices
What to version control? When to commit? What to say? Trunk policy
96
97
SUBVERSION (SCM)
98
ANT (BUILD TOOL)
Runnable
Deliverable
Release early, release often
Versatile build
Complex builds
104
Overview
Scripting language XML based Written in Java
105
Hands on 3/3
Write a build file for our application Follow instructions on SetupAnt wiki
page Follow instructions on HandsOn3 wiki
page
106
Sample build file
107
Target (order)
<target name="init">…<target name="compile" depends="init“…
<target name="dist" depends="compile“…
108
Target (function body)
<target name="compile" depends="init" description="compile the source
" ><javac srcdir="${src}"
destdir="${build}"/></target>
109
Some built-in ANT tasks (API)
<mkdir dir="${dist}/lib"/><delete dir="${dist}"/>
<javac srcdir="${src}" destdir="${build}"/>
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
110
Variables
<property name=“compile.debug" value=“true"/>
<javac srcdir="src" destdir="build" debug="${compile.debug}" />
111
Running
Advanced ANT
113
ANT (BUILD TOOL)
114
JUNIT (TESTING FRAMEWORK)
YAY!!
WHY? | TESTING
WHY? | TESTING
118
What is it?| Test
Initial stateScenarioVerification
What’s JUnit?
120
JUnit sample code
@Test public void simpleAdd() {
Money m12CHF= new Money(12, "CHF"); Money m14CHF= new Money(14, "CHF");
Money expected= new Money(26, "CHF"); Money result= m12CHF.add(m14CHF);
assertTrue(expected.equals(result));
}
JUnit | Running
JUnit | Reporting
123
Test driven development
1. Create a new test
2. Run test
3. Code
4. Repeat steps 2 & 3 until test
pass.
124
TDD example #1
TicTacToe t = new TicTacToe();
t.makeMove(Position.TOP_LEFT);t.makeMove(Position.TOP_RIGHT);t.makeMove(Position.MIDDLE_LEFT);t.makeMove(Position.MIDDLE_RIGHT);
t.makeMove(Position.BOTTOM_LEFT);
assertTrue(t.getWinnerId(), 1);
125
TDD example #2
TicTacToe t = new TicTacToe("John", "Jim");
t.set(Token.X, 0, 0); t.set(Token.Y, 2, 0); t.set(Token.X, 0, 1); t.set(Token.Y, 2, 1);
t.set(Token.X, 0, 2);
assertEquals(t.getWinner(), "John");
Test as living documentation
127
Bust or Budget
Bust or Budget
Bust or Budget
Bust or Budget
Bust or Budget
Bust or Budget
Bust or Budget
Bust or Budget
Bust or Budget
Bust or Budget
138
Bust or Budget game rule
class BustOrBudgetGameTest { @Test void itShouldEndWhenThereIsOnlyOnePlayingTeam() {
// Given ... bobGameDriver.startGame(team1, team2); // ... // When ... bobGameDriver.endTurn(team2, true); assert bobGameDriver.teamInPlay.size == 1; // Thenassert bobGameDriver.matchOver == true;
} }
139
Poll: When to run tests?
1. Before a major deadline2. After major code change3. When Prof. Simha looks over your
shoulder4. When Prof. Parmer looks over
your shoulder5. All of the above6. None of the above
Fixing a bug
Finding the culprit
7 stages of debugging
StageI: Denial
println “Hello world :)”
Stage II: Acceptance
println “Before call”println “After call”
Stage III: Depression
println “test”println “bla”println “here”
Stage IV: Acceptance
println “1”println “2”
Stage V: Fatigue
println “a”println “aa”println “aaa”
Stage VI: Anger
println “!)(@&#$!!!”
Stage VII: Despair
println “why”println “god”println “oh”println “why”
Deliverance
The bottleneck
When to test?
Rethinking testing
Build tools | Continuous integration
155
Build tools | CI Report
156
JUNIT (TESTING FRAMEWORK)
157
TICKETING SYSTEM
Bug submission
Bug lifecycle
Bug search
Organization tool
Collaboration tool
Context | Ticket
Velocity
165
TICKETING SYSTEM
166
HROUSSEL@LINKEDSENIOR.COM
LINKEDIN.COM / IN / HROUSSEL
top related