120
Software development in the Real World™ (in about fifty minutes) lecture 5 / comp314, rice university daniel sandler 23-jan-2007 version 1.1, 29-jan-07

Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Software developmentin the Real World™

(in about fifty minutes)

lecture 5 / comp314, rice universitydaniel sandler 23-jan-2007

version 1.1, 29-jan-07

Page 2: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)
Page 3: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

So, you’ve decided to write software for a

living.

Page 4: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

So, you’ve decided to write software for a

living.

Good for you!

Page 5: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

This is definitely the right path for you if:

Page 6: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

This is definitely the right path for you if:

you are clever and industrious

Page 7: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

This is definitely the right path for you if:

you are clever and industrious

you like the idea of making neat things that other people use

Page 8: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

This is definitely the right path for you if:

you are clever and industrious

you like the idea of making neat things that other people use

you are a pretty good programmer

Page 9: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

This is definitely the right path for you if:

you are clever and industrious

you like the idea of making neat things that other people use

you are a pretty good programmer

you hate people and want to hide behind a computer

Page 10: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

This is definitely the right path for you if:

you are clever and industrious

you like the idea of making neat things that other people use

you are a pretty good programmer

you hate people and want to hide behind a computer

you want a predictable job with low stress and plenty of time off

Page 11: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

(the previous slide contains two errors)

Page 12: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

you are clever and industrious

you like the idea of making neat things that other people use

you are a pretty good programmer

you hate people and want to hide behind a computer

you want a predictable job with low stress and plenty of time off

This is definitely the right path for you if:

Page 13: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

you are clever and industrious

you like the idea of making neat things that other people use

you are a pretty good programmer

you hate people and want to hide behind a computer

you want a predictable job with low stress and plenty of time off

you are clever and industrious

you like the idea of making neat things that other people use

you are a pretty good programmer

you hate people and want to hide behind a computer

you want a predictable job with low stress and plenty of time off

This is definitely the right path for you if:

Page 14: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

But…I really hate people!

Page 15: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

But…I really hate people!

(That’s why I got into CS in the first place!)

Page 16: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

But…I really hate people!

(That’s why I got into CS in the first place!)

TOUGH SH*T

Page 17: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Building software is all about people.

✽ You will spend as much time dealing with your colleagues as with your compilerPlanning new projects

Designing systems to solve problems

Arguing for your proposed solution (and the necessary time/people to get it done)

Explaining your system to others who will need to understand it deeply

Listening to your manager, peers, marketing department, testing team, users, …

Pushing back on all those parties when necessary

Page 18: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

Page 19: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Page 20: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOUYour team

Page 21: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

Page 22: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

His director

Page 23: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

Other teams

His director

Page 24: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

QA/TestOther teams

His director

Page 25: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

Sales/Marketing

QA/TestOther teams

His director

Page 26: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

Sales/Marketing

Users

QA/TestOther teams

His director

Page 27: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

Sales/Marketing

Users

QA/TestOther teams

His director

Clients

Page 28: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

Sales/Marketing

Users

QA/TestOther teams

His director

PartnersClients

Page 29: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Players

YOU

Your manager

Your team

Sales/Marketing

Users

QA/TestOther teams

His director

Partners

The CEO

Clients

Page 30: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)
Page 31: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Lesson:Learn to communicate.

Page 32: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Lesson:Learn to communicate.

Corollary:Play well with others.

Page 33: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

What else should you know?

The following comes from:My experience

My friends’ experienceThe Internets

Your mileage will varybut a lot of this stuff is the same everywhere

Page 34: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

The Release Cycle

Page 35: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

“We’ll ship it when it’s done.”

Page 36: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

“We’ll ship it when it’s done.”

Page 37: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

“We’ll ship it when it’s done.”

Page 38: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)
Page 39: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Development

Page 40: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Development

Release

Page 41: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Development

Release

Party!

Page 42: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Design

Development

Test

Release

Party!

Page 43: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Design

Development

Test

Release

Party!

Page 44: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Redesign

Design

Development

Test

Release

Party!

Page 45: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Redesign

Bugs

Design

Development

Test

Release

Party!

Page 46: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Redesign

Bugs

Design

Development

Test

Release

Party!

Bug Fixes Only

Page 47: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Redesign

Bugs

Design

Development

Test

Release

Party!

Bug Fixes Only

CODE FREEZE

(stabilization)

Page 48: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Really bad bugs

Redesign

Bugs

Design

Development

Test

Release

Party!

Bug Fixes Only

CODE FREEZE

(stabilization)

Page 49: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Really bad bugs

FeatureWishlist

Redesign

Bugs

Design

Development

Test

Release

Party!

Bug Fixes Only

CODE FREEZE

(stabilization)

Page 50: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Really bad bugs

FeatureWishlist

Redesign

Bugs

Design

Development

Test

Release

Party!

Bug Fixes Only

CODE FREEZE

(stabilization)Party?

Page 51: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tools

Page 52: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Source Control

Page 53: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Source Control

✽ We’ve talked about this before

(Remember the bacon?)

✽ As projects grow, coordinating source becomes more complex

✽ If you interview with a company that doesn’t use source control:

KEEP WALKING

Page 54: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

time flows to the right

Page 55: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the right

Page 56: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the right

Page 57: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the righttag: “version 0.1”

Page 58: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the right

“branch”

tag: “version 0.1”

Page 59: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the right

“branch”

tag: “version 0.1”

Page 60: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the right

“branch”

tag: “version 0.1”

Page 61: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the right

“branch”

tag: “version 0.1”

Page 62: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Tags & Branches

“the trunk”

time flows to the right

“branch”

tag: “version 0.1”

Page 63: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

integration

Tags & Branches

“the trunk”

time flows to the right

“branch”

tag: “version 0.1”

Page 64: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

integration

Tags & Branches

“the trunk”

time flows to the right

“branch”

tag: “version 0.1”

Page 65: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

BeOS branch structure

main

Page 66: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

BeOS branch structure

main

rel

Page 67: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

BeOS branch structure

exp

main

rel

Page 68: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

BeOS branch structure

exp

main

rel

Page 69: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

BeOS branch structure

exp

main

rel

2.0b1

Page 70: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

BeOS branch structure

exp

main

rel

2.0b1 2.0b2

Page 71: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

BeOS branch structure

exp

main

rel

2.0b1 2.0 final2.0b2

Page 72: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

PalmOS branch structure

Page 73: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

PalmOS branch structure

Not shown:~10 sub-branches of appservices, coretech

Page 74: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Code

Page 75: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Reading Code

✽ Analogues: Cryptography, archaeology, Talmud interpretation†

✽ The original author is not always available

✽ Best performed in pairs

† http://www.joelonsoftware.com/articles/fog0000000053.html

Page 76: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Some code to read

Page 77: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #1:StrEndsWith(char * str, char * suffix)

Page 78: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #1:StrEndsWith(char * str, char * suffix)

Boolean StrEndsWith(CharPtr string, CharPtr endString){ CharPtr p1; CharPtr p2; p1 = string; p2 = endString; if (!p1 || !p2) return false;

p1 = p1 + StrLen(p1) - StrLen(p2);

return false;}

Page 79: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done?

Page 80: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done?Boolean IMAP4getMailBodyInt(ULong uid, mailMessage*msg,callbackFn callback, CharPtr file,CharPtr boundary,int encoded, Boolean binaryAttach,Boolean isRead,Boolean multiPartAlternative, Long aType){ VoidHand bufHand=0; CharPtr bufPtr=0; CharPtr p1 = 0; CharPtr p2 = 0; CharPtr receivePtr = 0; int bytesRead=0; int bytesSoFar=0; Boolean completed = false; Boolean cancel = false; Boolean retVal = false;

Boolean truncated = false; int msgNum = 0; CharPtr file2=0; CharPtr boundary2=0; Boolean omittedAttachment=false; Boolean done=false; Boolean readable=isRead; int isEncoded = encoded; VoidHand curHand =0; Boolean Done=false; Long progressBytesSoFar=0;#ifdef OLDWAY Boolean oldIMAP=false; #endif Boolean stop=false; [...]

Page 81: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done?Boolean IMAP4getMailBodyInt(ULong uid, mailMessage*msg,callbackFn callback, CharPtr file,CharPtr boundary,int encoded, Boolean binaryAttach,Boolean isRead,Boolean multiPartAlternative, Long aType){ VoidHand bufHand=0; CharPtr bufPtr=0; CharPtr p1 = 0; CharPtr p2 = 0; CharPtr receivePtr = 0; int bytesRead=0; int bytesSoFar=0; Boolean completed = false; Boolean cancel = false; Boolean retVal = false;

Boolean truncated = false; int msgNum = 0; CharPtr file2=0; CharPtr boundary2=0; Boolean omittedAttachment=false; Boolean done=false; Boolean readable=isRead; int isEncoded = encoded; VoidHand curHand =0; Boolean Done=false; Long progressBytesSoFar=0;#ifdef OLDWAY Boolean oldIMAP=false; #endif Boolean stop=false; [...]

(~350 more lines)

Page 82: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done?

Page 83: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done? Boolean completed = false; Boolean cancel = false; Boolean retVal = false; Boolean done=false; Boolean Done=false; Boolean stop=false;

Page 84: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done? Boolean completed = false; Boolean cancel = false; Boolean retVal = false; Boolean done=false; Boolean Done=false; Boolean stop=false;

Done = ... ... while (!Done) { ... }

Page 85: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done? Boolean completed = false; Boolean cancel = false; Boolean retVal = false; Boolean done=false; Boolean Done=false; Boolean stop=false;

Done = ... ... if (!done) { ... } while (!Done) { ... }

Page 86: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done? Boolean completed = false; Boolean cancel = false; Boolean retVal = false; Boolean done=false; Boolean Done=false; Boolean stop=false;

Done = ... ... if (!done) { ... } while (!Done) { ... if (stop) break; }

Page 87: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Example #2: How done is done? Boolean completed = false; Boolean cancel = false; Boolean retVal = false; Boolean done=false; Boolean Done=false; Boolean stop=false;

Done = ... ... if (!done) { ... } while (!Done) { ... if (stop) break; ... stop=true; cancel=true; done=true; }

Page 88: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

How do you keep code like this out of your program in the

first place?

Page 89: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Code Reviews

✽ Also known as: “the Spanish Inquisition”

✽ Learn to love them—the best software shops swear by them

✽ An opportunity for you to stop others’ broken code before it hits the system

✽ An opportunity for others to stop your broken code before it hits the system

Page 90: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Hidden featuresof code reviews

✽ Someone else has seen your code!

✽ This means you have help when something breaks

✽ (Also: your teammates aren’t screwed if you flake)

Page 91: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Automatic Builds

✽ Build server: tireless, dauntless, indefatigable

✽ Every hour, or every N checkins, or whatever:

✽ Check everything out

✽ Compile it all

✽ Run a subset of unit tests, viz. “sniff tests”

✽ ELEC majors can explain this terminology

✽ If it doesn’t compile, or doesn’t pass the tests…

Page 92: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

YOU BROKE

IT!

Page 93: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

YOU BROKE

IT!

(now fix it, genius)

Page 94: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Here’s a bad idea

Page 95: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Here’s a bad idea

✽ 4:45 PM:

Page 96: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Here’s a bad idea

✽ 4:45 PM:

✽ check in a bunch of shiny new code

Page 97: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Here’s a bad idea

✽ 4:45 PM:

✽ check in a bunch of shiny new code

✽ 5:00 PM:

Page 98: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Here’s a bad idea

✽ 4:45 PM:

✽ check in a bunch of shiny new code

✽ 5:00 PM:

✽ go home

Page 99: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Here’s a bad idea

✽ 4:45 PM:

✽ check in a bunch of shiny new code

✽ 5:00 PM:

✽ go home

Page 100: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Here’s a bad idea

✽ 4:45 PM:

✽ check in a bunch of shiny new code

✽ 5:00 PM:

✽ go home

✽ (applies in this course as well)

Page 101: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

You WILL get the build hat.

Page 102: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

You WILL get the build hat.You WILL get the build hate

Page 103: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Testing

Page 104: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Who are QA*?

✽ The front line in the War On Bugs

✽ Professional program-crashers

✽ You may be one of these people!

✽ Some people are incredibly gifted at breaking things (this usually takes a fair bit of coding experience)

✽ They will bring your code to its (metaphorical) knees

✽ What are they looking for?

* “Quality Assurance”

Page 105: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bugs

Page 106: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Sources of bugs

✽ Misunderstanding

✽ Lousy code

✽ Unforeseen consequences

✽ Sleep deprivation

Page 107: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Dan’s bug stories

✽ The Case of the Christmas Lights

✽ The Case of the Time-Bomb MP3 Stream

Page 108: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bug Tracking

Page 109: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bug Tracking

✽ An essential part of keeping track of all the broken, half-implemented, flaky bits of your code

Page 110: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bug Tracking

✽ An essential part of keeping track of all the broken, half-implemented, flaky bits of your code

✽ A glorified “to-do” list

Page 111: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bug Tracking

✽ An essential part of keeping track of all the broken, half-implemented, flaky bits of your code

✽ A glorified “to-do” list

✽ Bugs have assignees, attachments, running comments

Page 112: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bug Tracking

✽ An essential part of keeping track of all the broken, half-implemented, flaky bits of your code

✽ A glorified “to-do” list

✽ Bugs have assignees, attachments, running comments

✽ Bugs have states: “open”, “fixed”, “unreproducible”, etc.

Page 113: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bug Tracking

✽ An essential part of keeping track of all the broken, half-implemented, flaky bits of your code

✽ A glorified “to-do” list

✽ Bugs have assignees, attachments, running comments

✽ Bugs have states: “open”, “fixed”, “unreproducible”, etc.

✽ Each one is like an email or BB thread

Page 114: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bug Tracking

✽ An essential part of keeping track of all the broken, half-implemented, flaky bits of your code

✽ A glorified “to-do” list

✽ Bugs have assignees, attachments, running comments

✽ Bugs have states: “open”, “fixed”, “unreproducible”, etc.

✽ Each one is like an email or BB thread

✽ It will become your homepage

Page 115: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Bugzilla

Page 116: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

FogBugz

Page 117: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Roundup

Page 118: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Schedules

✽ Estimation is hard

✽ Nobody has solved this

✽ Tips:

✽ Make a schedule

✽ Break things up into small tasks (between 1hr and 1day)

✽ Track how well you did!

✽ This is the only way to improve your estimating skills

Page 119: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

Wrap-up

✽ A look inside the sausage software factory

✽ No “best practices” in software, yet

✽ Just “common practices”

✽ These examples come from my experience; yours will be different in many ways

✽ “How to make software” reading list

✽ Posted on the course website as the semester goes on

Page 120: Software development in the Real World™sys.cs.rice.edu/course/comp314/10/lectures/5-real-world-software.pdf · Software development in the Real World™ (in about fifty minutes)

FIN

https://sys.cs.rice.edu/course/comp314/07/