An Introduction To Software Development - Software Development Midterm Review

38
An Introduction To Software Development Using Python Spring Semester, 2015 Midterm Review

Transcript of An Introduction To Software Development - Software Development Midterm Review

An Introduction To Software Development Using Python

Spring Semester, 2015

Midterm Review

Software EngineeringRequirements

Analysis

SpecificationDevelopment

SoftwareDesign

Test &Verification

Maintenance

Image Credit: http://www.tipsforphotographers.com/waterfall-photography-take-stunning-shots-of-waterfalls

What Is A Computer?

Image Credit: ota_photos, Alex Lomix, yum9me, Kevin Wu

CPU(Microprocessor)

Memory(RAM: Random

Access Memory)

Hard Drive(Disk Drive)

Keyboard(Input)

Display(Output)

A computer is an electronic device that stores and processes data.

A computer includes both hardware and software. In general, hardware comprises the visible, physical elements of the computer, and software provides the invisible instructions that control the hardware and make it perform specific tasks.

The Binary Numbering System

• In mathematics and digital electronics, a binary number is a number expressed in the binary numeral system, or base-2 numeral system, which represents numeric values using two different symbols: typically 0 (zero) and 1 (one).

• Because of its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by almost all modern computers and computer-based devices such as mobile phones.

• Each digit is referred to as a bit.

Binary Math Time!

• 1

• 23

• 65

• 128

• 1,003

29 28 27 26 25 24 23 22 21 20

512 256 128 64 32 16 8 4 2 1

1

1 1 1 10

1111111111

1

10 0 0 0 0

0 0 0 0 0 0 0

1

1 1 1 1 1 0 1 0 1 1

512+256+128+64+32+16+8+4+2+1= 1023

2 Main Concerns Of Any Software Project

• How much will it cost?• How long will it take?

Note: there is often a due date for the software!

Image Credit: Richard Smith

Why Doesn’t The Big Bang Work?

• You did do a lot of work

• However, you didn’t show your customer your work until you were done

• You thought that you were building what the customer wanted with no feedback

• Now you will have to do rework

Image Credit: John Thurm

What Makes A Good Requirement?

• Written from the customer’s perspective documenting what the software is going to do for the customer.– If a customer does not understand a requirement, then consider that to be a

red flag.

• Write requirements in the customer’s language. Consider them to be “user stories”: a story that tells how users would interact with the software that you are creating.

Image Credit: www.clipartsfree.net, Christchurch City Libraries

What Are “User Stories”?

• Good User Stories:– Describe ONE THING That your software should do for your

customer– Should be written in a language the your customer will

understand– Should be written by the customer – not you!– Should be short. Consider 3 sentences to be the

limit in length.

• Good User Stories Are NOT:– A long essay that nobody will ever read.– Filled with technical terms that your customer does not

understand.– Talk about specific technologies that nobody knows about.

A User Story is written from the customer’s perspective. Both you and yourcustomer should understand what the story is trying to tell you.

How We’ll Pick An Estimate That’s Accurate

0 100

This gap worries us:What’s missing?What user story was misunderstood?What is someone unsure of?

Rules About Assumptions

• A complete development cycle should take roughly one month – 20 development days.

• Rule of thumb: estimates that are longer than 15 days are less likely to be accurate then estimates that are shorter than 15 days. – Break your stories in to smaller stories– Go back and talk with your customer again

Image Credit: www.canstockphoto.com

When Estimating, Assumptions Are Bad!

• When creating estimates, no assumption is a good assumption.

• Assume that assumptions are wrong until clarified by the customer.

• Sometimes you end up having to live with an assumption because your customer doesn’t know:– Write it down as a risk for a given user story.– You may delay implementing a given user story that has a number of

risks associated with it.

You cannot always get rid of all of your assumptions. Your goal during estimation needs to be to eliminate as many assumptions as possible by clarifying those assumptions with your customer. Any assumptions that survive this process then become risks.

Image Credit: www.fotosearch.com

Problem: Too Much To Do• What should you do if you have 100 days of effort

and your customer wants the software in 30 days?

• Cut out functionality – remove user stories that are not absolutely critical!

• Keep your development momentum up by shipping a milestone build as soon as possible

• Focus on delivering just a working version of the software, nothing else.

Image Credit: free-pictograms.com

Adding More People• Every new person has to come up to speed on your

project

• They need to understand the software

• They need to understand the technical decisions

• They need to understand how everything fits together.

• They will NOT be 100% productive

Image Credit: www.clker.com

Prioritize Example

Title: Show Current DealsEstimate:

Title: Book PackagesEstimate: 15 , Priority: ?

Title: Arrange TravelEstimate: 5 , Priority: ?

Title: Book A RoomEstimate: 10 , Priority: ?

Title: Book a Boat TourEstimate: 5 , Priority: ?

Title: Pay with Visa/MC/PaypalEstimate: 10, Priority: ?

Title: Order Trip DVDEstimate: 5

Title: Review StayEstimate: 10

Title: Order Room ServiceEstimate: 20 , Priority: ?

Title: Choose ViewEstimate: 15 , Priority: ?

Title: Support 3,000 concurrent usersEstimate: 20 , Priority: ?

Image Credit: Sebastien Wiertz

Which ones would you implement to meetthe customer’s schedule?

Iteration ExampleIteration #1

Total Days: Divided by 2 developers:

Iteration #2

Total Days: Divided by 2 developers:

Iteration #3

Total Days: Divided by 2 developers:

What Is Velocity?

• Velocity is a percentage.

• Velocity is how much of your time is being spent doing productive work.

• Start with a velocity of 0.7 (your team works 7 out of 10 days)

• You’ll adjust your velocity at the end of each iteration – short iterations allow you to do this quicker!

Image Credit: www.clker.com

How Do You Use Velocity?

• You apply your velocity to the amount of work that you have to do in order to get a realistic estimate of how long it is going to take you.

Days Of Work

VelocityDays required to get work done=

30 calendar days →20 working days → 15 actual days of real work

You can be confident in this numberImage Credit: www.clker.com

Deal With Velocity BEFORE You Create Your Iterations!

2 x 20 x 0.7 = 28# developers

Working days inan iteration

Team’svelocity

Number of person daysyour team can do in oneiteration

28 x 3 = 84# of iterationsin Milestone 1

Amount of work in days that you and your team can do before Milestone 1 is shipped

Image Credit: www.clipartpanda.com

How Are We Going To Mange Our Software Development Project?

• We’ll use a Software Development Dashboard to track where our project is currently at.

• We want to track 3 things:– What work is in the pipeline– What’s in being worked on– What has been completed

• Ideally, the board would be out in a public place where everyone could see it all the time

Image Credit: vector-images.com

What Does The Dashboard Look Like?

User Stories Burn Down

Next

Completed

WorkLeft

Days Left

88

80 60 40 20Pay with Visa / MC / Paypal

Support 3,000 concurrent users

10

20

Estimates

User stories for iteration 1

The Burn Down ChartTotal developmenttime left for team in days

Ideal task burn down rate

Your team’s work is plotted against the line. Above the linemeans that you are running behind…

… below the line means youare ahead

Days left in this iteration

Break User Story Into Tasks

• Task descriptions should have just enough information to describe what the work is

• Tasks must cover ALL of the User Story’s functionality

• Each task has its own estimate

Pay with Visa / MC / Paypal

10

Pay with Visa Pay with

MC

Pay with Paypal

33

5Estimates

The ProblemnumEggs = 2amountOfFlour = 2oil = 0.5water = 2createFrostingpurchaseCandleswhile (amountOfingredients > 0)

combine(eggs, flour, oil, water)mixBatterplaceInOvenfor timer in range(1,31):

cooktakeOutOfOven

applyFrostinginsertCandles

Both Bob andJane are makingchanges to thesame section ofcode…

… just exactly how are

they going to go about

doing that?

What’s The Solution?Version Control!

• Keeping track of source code (or any kind of files for that matter)across a project is tricky.

• You have lots of people working on files—sometimes the same ones, sometimes different.

• Any serious software project needs version control, which is also often called configuration management, or CM for short.

• Version control is a tool (usually a piece of software) that will keeptrack of changes to your files and help you coordinate differentdevelopers working on different parts of your system at the sametime.

Image Credit: pinstake.com

Version Control System:The Details

Image Credit: ClipArt Best

1. Create a repository 2. Import code intothe repository

3. Check out codefrom the repository

4. Make changes to the code

3. Check code intothe repository

The CM Software Will Detect And Attempt To Manage Conflict

• If the changes to the same piece of code don’t conflict with each other, then the code will be merged.

• If the code can’t be merged, then the CM will reject the second commit and issue a conflict

• You need to make changes to resolve the conflict and then resubmit the commit

Image Credit: facs.phillipmartin.info

Say Hello To The “Trunk”

• By default, your version control softwaregives you code from the trunk.

• When you check out the code from your version control system, you’re checking it out from the trunk.

• That’s the latest code by default and (assuming people are committing their changes on a regular basis) has all of the latest bugs features.

Trunk

Image Credit: www.clker.com

Branches!

• A branch is a place where you’re working on code that isn’t in the main development tree of the code.

• We’ve tagged the 1.0 code, made fixes in a new branch, and still have current development happening in the trunk.

Trunk

Version 1

V2.0

Image Credit: www.clker.com

Version Control Summary

What Version Control Does• Lets you create a repository to keep your code

in a single place to ease backup and recovery.

• Lets multiple people check out copies of the code and work efficiently as a team.

• Lets multiple people check changes back into the repository and distribute them to the rest of the team.

• Keeps track of who changes what, when, and why.

• Branches and tags code so you can find and change versions of code from way back when.

• Rolls back changes that never should have happened in the first place.

What Version Control Doesn’t Do

• Makes sure your code compiles.

• Tests code.

• Thinks for you.

• Makes sure your code is readable and well-written.

Image Credit: www.123rf.com

Say Hello To “Build Scripts”

• In order to run a software project, more than just compiling of code must be done.

• The project must be “built”.

• Building a project involves the following steps:– Compiling source files into binary files– Finding dependencies– Packaging up the project– Etc.

Image Credit: www.easyvectors.com

Projects, Properties, Targets, and Tasks

• Projects: Everything in your build file is part of a single project:<project name=“Homework 1” default =“dist”>

• Properties: Ant properties are like constants for the script. They let you refer to values in the script; however, you can change those values in a single place.<property name=“version” value=“1.0” />

• Targets: A target is just a set of work. You can group different actions into a target. Example: You might have an init target for setting up your project’s directory structure and a compile target for compiling all of your code. A target has a name and, optionally, a list of targets that must be run before it.<target name=“compile” depends=“init” description=“Compiles code”>

• Tasks: A task in Ant generally maps to a specific command<mkdir dir=“/homework_1” >

No matter what language you are using, a good build tool gives youa way to manage projects, constants, and specific tasks.

Image Credit: www.clipartpanda.com

3 Different Ways To Look At Your Software

Your software doesn’t work

It won’t get used

You won’t get paid

Image Credit: www.neoclipart.com, www.flickr.com, www.clipartbest.com

Users

Testers

Developers

Different people will lookat your software differently…

When you test your code, youneed to consider all views.

Black-Box Testing

• Users are located outside of your system

• They will only see what they put into your system and then what comes back out

• Functionality– #1 most important type

of black box testing– Does your software do

what the user story says that it should do?

– How the data is being stored does not matter.

– Data gets in, story results get out

Image Credit: www.neoclipart.com, www.homedigitals.tk

Gray-Box Testing

• Required if you can’t get results out of the system without looking inside – at least a bit.

• Good example: web apps that move data around in a database

• You need to check the database and the web code

• Verifying Auditing and Logging:– Required when money is

involved– Not available via the

user interface– Use log viewing tool or

auditing report– May have to query the

database

Image Credit: www.flickr.com, www.automationlearn.com

White-Box Testing

• You know what’s going on in the code and you try to break it

• Generate problem situations that will cause errors and crashes

• Know the code that you’ll be testing

• Testing All Of The Different Branches Of The Code– Look at ALL of the code– What data do you need

to provide to get it to take every path?

Image Credit: www.clipartbest.com, www.automationlearn.com

3 Different Types Of Testing

• Unit Testing– Performed by developers– Goal is to ensure that their code works correctly

• System Testing– Performed by professional testers– Goal is to ensure that the parts work together

• User Testing– Performed by professional testers– Goal is to ensure that the expected functions work

Image Credit www.fotosearch.com

You Are Now A Software Developer!