fall 2015cisc/cmpe320 - prof. mcleod1 cisc/cmpe320 project wikis are private again. assignment 3 is...

27
Fall 2015 CISC/CMPE320 - Prof. McLeod 1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place by Nov. 9. Today: “Crunch Time”! Leftover stuff from before “presentation week” – Overloading ( ) and inline functions. Repositories. If we have time – the SDD and start Software Analysis.

Upload: janel-moore

Post on 19-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 1

CISC/CMPE320

• Project Wikis are private again.• Assignment 3 is posted. Due Nov. 6.• SDD framework must be in place by Nov. 9.

• Today:– “Crunch Time”!– Leftover stuff from before “presentation week” –

Overloading ( ) and inline functions.– Repositories.– If we have time – the SDD and start Software Analysis.

Page 2: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Crunch Time!• Focus on a do-able proof of concept first. Test

this before you go on to adding features.• Make sure your libraries do what you want them

to do. Can all team members install and use the libraries?

• Start testing asap – so, you need something to test!

• If you are splitting into sub-teams, create a plan that allows integration testing of the results.

• Assign a team member to be responsible for system testing and assigning bugs/additional work (“feature request”).

Fall 2015 CISC/CMPE320 - Prof. McLeod 2

Page 3: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

The Crunch, Cont.

• Figure out an organization for your repository before it gets out of hand.

• Everyone has to use the repository.• Leverage issues.• Redmine will track document changes – tracks

everything, in fact.• If something does not go into Redmine, then it

doesn’t exist!!!• Keep your diaries current.

Fall 2015 CISC/CMPE320 - Prof. McLeod 3

Page 4: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 4

Overloading the Function Call Operator: ( )

• Allows an object to behave as if it is a function.• Called a function object. • The only operator where the number of

arguments is not fixed or limited to one or two.

• See the RandomInt class.

• Used in the STL.

Page 5: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 5

Aside - inline Functions• Used in the RandomInt class.• Used when the function body is short:

– ≤ 3 assignment statements.– one conditional.– one return.

• An inline function is not placed on the activation record stack, but is expanded in place and so is executed faster.

• Must be in declaration file.• The downside is that a copy is made every time

the function is invoked – so it should be short.

Page 6: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 6

Repositories

• What if two or more people want to edit the same file at the same time?

• Option 1: make them take turns – But then only one person can be working at any time – And how do you enforce the rule?

• Option 2: patch up differences afterwards – Requires a lot of re-working – Stuff always gets lost

Page 7: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 7

Repositories, Cont.

Page 8: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 8

Repositories, Cont.

• Keep the master copy of the file in a central repository.

• Each author edits a working copy.• When they're ready to share their changes, they

commit them to the repository.• Other people can then do an update to get those

changes.

• Even one coder can take advantage of this system if he works on multiple machines.

Page 9: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 9

Version Control

• You might find that your work has gone completely in the wrong direction or you find that the errors are piling up – you might need to throw away some work and return to an earlier version of the software.

• Or you might just need to know the author of the latest changes to a file.

Page 10: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 10

Version Control, Cont.

• The repository can store previous versions and keep track of who commits what and when:

Page 11: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 11

Repositories in Use

• Commercial ($$): Perforce: http://www.perforce.com

• Older: CVS: http://www.cvshome.org

• Replaced CVS: Subversion (or “SVN”): http://subversion.apache.org/

• CVS: “Concurrent Versions System”• SVN: “Apache Subversion” or just “Subversion”

Page 12: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Best? - Git

• Stands for “Git”.• Originally designed by Linus Torvalds starting in

2005 (what else did he design?).• Built for Linux kernel development.• Every git working directory is a full blown

repository.• Much faster and smaller footprint than SVN or

CVS.Fall 2015 CISC/CMPE320 - Prof. McLeod 12

Page 13: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Git Structure

• (Image from Wikipedia)• You can (and are

encouraged to) create many local branches of all or just part of the repository for your work.

• Very easy to create, merge and/or delete these branches.

Fall 2015 CISC/CMPE320 - Prof. McLeod 13

Page 14: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 14

Repositories in Use, Cont.

• You need a server (we have prajna).• And local client software.

• Such as: TortoiseSVN (available from http://tortoisesvn.net/).

• TortoiseSVN adds itself to Windows Explorer. The first time you try an update or a commit you will need to add the URL for the server and use your password (have your password ready to be pasted.) Easy!

• Try it yourself! Experiment!

Page 15: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Getting Git - Sites

• Start here:

Git home: http://git-scm.com/

• Client side tools (install git first):

SmartGit: http://www.syntevo.com/index.html

GitHub download: http://windows.github.com/

• One of many cloud repositories:

GitHub Repository: https://github.com/

Fall 2015 CISC/CMPE320 - Prof. McLeod 15

Page 16: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 16

Resolving Conflicts

• How to prevent?• Option 1: only allow one person to have a

writeable copy at any time (lock the file). – This is called pessimistic concurrency or lock, modify,

unlock.– Used in Microsoft Visual SourceSafe.

• Option 2: let people edit, and resolve conflicts afterward by merging files.– Called optimistic concurrency or copy, modify, merge.– “It's easier to get forgiveness than permission”.– Most modern systems (including Subversion) do this.

Page 17: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 17

Resolving Conflicts, Cont.

• What happens when two people commit the same file?

Page 18: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Resolving Conflicts, Cont.• Using Git “terminology”:

• Hermione attempts a push, but Ron has done a push after Hermione has fetched (or cloned).

• Hermione’s push will be rejected, even if she has not changed the same files that Ron has changed.

• Hermione must do a fetch and merge to get Ron’s changes before she can push.

• Ron’s changes will be applied and then Hermione’s changes will be re-applied.

Fall 2015 CISC/CMPE320 - Prof. McLeod 18

Page 19: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 19

Resolving Conflicts, Cont.

• It may be that changes do not overlap, so SVN can merge the files, but if there is a conflict:

• The resolution process allows one person to view a merged file, with the differences marked. This person decides which revisions to keep/discard.

• Only works for text files, not binary files.

• If more than two people submit the same file – then the project needs better management…

Page 20: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Subversion, Cont.

• SVN still supports locking files, but the copy, modify, merge scheme is the default.

• Note that not only are file changes tracked and recorded but directory structure changes are also monitored.

Fall 2015 CISC/CMPE320 - Prof. McLeod 20

Page 21: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 21

Subsystem Decomposition

System Design Object Model

Analysis Object Model

Non-functional requirements

Requirements Elicitation

Problem Statement

Functional Model

Analysis

Dynamic Model

System Design

Design Goals

Use Case Diagram

Class Diagram

Statechart Diagram

Sequence Diagram

RAD

SDD

Page 22: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 22

Deliverable System

Object Design Model

Object Design

Implementation

Source Code

Testing

Class Diagram

• This is not a flowchart. The stages are not necessarily carried out in this order.

• No iteration or feedback is shown.

Page 23: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

SDD

• The RAD is usually a one-shot deal, viewed and approved of by the client.

• “Software Design Document”• The SDD is for the development team only – it is

not shown to the client. It is technical – more diagrams than words.

• It should be a dynamic document or just a framework that evolves or fills in as the design of your project changes. Well suited to the Wiki environment because it is dynamic and everyone can view and contribute.

Fall 2015 CISC/CMPE320 - Prof. McLeod 23

Page 24: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

SDD as a Deliverable

• Looking for the SDD framework in place (in your Wiki) by the end of next week – Sunday, Nov. 9th.

• You do not have to use all categories, but need to have put what analysis results you have in the right places.

• The SDD will keep changing – even after the 9th!

Fall 2015 CISC/CMPE320 - Prof. McLeod 24

Page 25: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 25

SDD Contents

• Create something like this table of contents in your Wiki as a framework to hold your design information:

1. Introduction1. Purpose of system

2. Design goals

3. Definition, acronyms and abbreviations

4. References

5. Overview

2. Current software architecture (not needed for us)

Page 26: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Fall 2015 CISC/CMPE320 - Prof. McLeod 26

SDD Contents, Cont.

3. Proposed software architecture1. Overview

2. Subsystem decomposition

3. Hardware/software mapping

4. Persistent data management

5. Access control and security

6. Global flow control

7. Boundary conditions

4. Subsystem services

5. Glossary

Page 27: Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place

Software Analysis

• Analysis provides the fodder for the SDD.

• The SDD provides a framework, so you know where to store the results as they evolve.

Fall 2015 CISC/CMPE320 - Prof. McLeod 27