ee422c software design and implementation ii vallath nandakumar fall 2015

52
EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

Upload: brook-arleen-alexander

Post on 18-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

EE422CSoftware Design and Implementation II

Vallath Nandakumar

Fall 2015

Page 2: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

2

Lecture 1 Announcements

Read syllabus before next classTopics for today

• Introductions• course/syllabus overview• Java

Page 3: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

3

Websites

Canvas: courses.utexas.eduMy Home Page: ece.users.utexas.edu/~vallathn

Course web-page: accessible from my home pageSlides: will be postedHandouts: Programming Assignments: Subversion repository...

Page 4: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

4

The teaching team

Instructor• Vallath Nandakumar (

[email protected])• Office hours: Th 12:30-1:00pm (first week)

• TBD for later weeks• First time teaching this class, and first time in EE• PhD in EECS from UC Berkeley• Several years in Tektronix, AMD in chip design

Graduate TA• Jocelyn Egner ([email protected])• Office hours: TBD

Undergraduate TA• Xavier Salazar ([email protected])• Office hours: See web page

Page 5: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

Contacting the teaching staff

• Post on Piazza if the question might be of general interest.

• Email the instructor or instructors.• Go to office hours.• Emailing through Canvas is not encouraged,

unless it is a response to something the instructor has sent, or a comment that the instructor has made on Canvas.

5

Page 6: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

Piazza

• Used to make some instructor announcements• Students may ask follow-on questions or make

comments.• Important for students to read these instructor

announcements in a timely manner.• Students may post notes, discussions, or ask

questions.• Students may share allowed assignment-related

material.• May use Piazza to find partner for group

assignments.

6

Page 7: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

iClicker

• Register your iClicker remote at iClicker.com• Bring your iClicker to every lecture.• Answer at least 3/4 of the questions to get credit

for that day.• If you have questions, email me with your iClicker

remote ID and your UT EID.

7

Page 8: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

Discussion Section s

• Will be conducted by the TA’s• Might have graded quizzes• Arrive on time, and leave only at the end• Come prepared with questions for TA’s about the

assignments etc.

8

Page 9: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

9

EE422C in Context

softwaredesign and

implementationII

(in java)

software engineering

systemssoftware

other nonECE areas

other ECE areas

introductoryprogrammingin C

embedded systems

Page 10: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

10

goals for this class (1)

how to create appropriate abstractions (e.g., procedural and data) to solve complex programming problems

a practical understanding of a variety of common data structures• when and where they are applicable, and how to

use themknowledge of the advanced constructs of a high level

programming language (java)

Page 11: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

11

goals for this class (2)

a good understanding of basic software engineering principles and practices• how to analyze a problem?• how to design a system?• how to write good code (conforming to style

standards)?• how to design and test for correctness?• how to analyze program performance?

prepare you to use this knowledge in future courses that require you to develop software/hardware systems

Page 12: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

12

high points of syllabus

prerequisite, EE312C programming• if no prereq or doesn't seem prereq met, see

meyou are responsible for all materials presented in

classes, whether you attend or not• material presented in class is in addition to the

book.the purpose of the lecture notes is to help you listen

in class ONLYtextbook: data structures and problem solving using

java, 4th edition by mark allen weiss, ISBN 0321541405.

Page 13: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

13

schedule highlights

• today is our first formal lecture• there will be two in-class exams, and a final exam• programming assignments (6-7) will come out

throughout the semester

Page 14: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

14

java programming

our first topic of study is java; what’s different from C (or C++)

we will be doing all programming assignments in the java programming language

computer resources available• you can also get a Java compiler and do

assignments at home; but your code must compile/execute on ENS machines

Page 15: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

15

assignments and grading (1)

assignments will be 6-7 programs • programs to be completed independently

unless i state otherwise• we might do some pair and/or team

programmingTwo in-class exams during the semester

• may have pop quizzes any timegrades made up of:

• 65% exams/quizzes• 35% assignments/exercises, iClicker

Page 16: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

16

assignments and grading (2)

exam grades may be curved if warrantedassignments turned in late will NOT be acceptedyour program must compile and run successfully on

the ENS lab configuration when graded assignments are normally graded on a 35 point

scale• each assignment may have different criteria• partial credit may be given• correctness, style, performance, etc. will be

scored

Page 17: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

17

syllabus

all the remaining details of the course policies, rules, grading criteria, and procedures are in the syllabus document on the class blackboard page - read it for next week and be prepared to ask questions

Page 18: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

18

questions about course administration?

Page 19: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

iClicker question

The purpose of iClicker is to:

A.Wake you upB.Make sure you understand just-taught conceptsC.Encourage attendanceD.All of the above

19

Page 20: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

what is software engineering?

SWE is to CS as ChemE is to chemistrySWEs use a disciplined approach to the

development of software-driven systemsSWE ! = programmer; SE is a relatively new field of

study that applies to all types of systems that are developed as usable products

there are many different jobs that SWEs doit is a challenging career because of the inherent

problems of software - as well as the rate of change in computing technologies, and the ever broadening range of applications

Page 21: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

21

software is complex

malleableintangibleabstractsolves complex problemsinteracts with other software and hardware

consequently, often software is buggy

Page 22: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

22

what is a bug?

etymology [wikipedia]• perhaps first use of term in hardware

engineering to describe mechanical failures, e.g.,It has been just so in all of my inventions. The first step is an intuition, and comes with a burst, then difficulties arise—this thing gives out and [it is] then that "Bugs"—as such little faults and difficulties are called—show themselves and months of intense watching, study and labor are requisite before commercial success or failure is certainly reached.

Thomas Edison, 1878

Page 23: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

23

first actual case of bug being found

harvard mark II

Page 24: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

ariane-5, 1996crashed–went off-course 37 sec into flight sequence

24

Photos: ESA/CNES

Page 25: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

mars polar lander, 1999crashed–premature shut down at 40 meters altitude

25

Photos: JPL/NASA

Page 26: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

26

USS yorktown, 1997“dead in the water” for 3 hours

Photo: navsource.org

Page 27: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

What is the Heartbleed bug?

• Exploits a vulnerability in OpenSSL software library, used to implement the Transport Layer Security protocol used in web, instant messaging etc.

• Exposes user’s passwords, cookies and other data to the attacker.

• Not a virus.• One small bug in Open-Source software that

made millions of computers vulnerable.

Page 28: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015
Page 29: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

Buffer over-read bug

The extra data that is sent back is fetched from the server’s memory, due to the bug. It could include passwords and private keys.

Like if someone you had called in to fix your plumbing were to look through your closets for information.

Page 30: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

When was this bug introduced discovered, and fixed?Introduced in Dec. 2011, by one of the authors

(Seggelmann) of the (open-source) software team.

Discovered on April 1, by Neel Mehta of Google, and Codenomicon.

Fixed right away, but servers have to use the new software.

Page 31: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

khurshid: assertion-driven error recovery 31

warranties–two decades ago

ACM SIGSOFT Software Engineering Notes, Vol. 12, No. 3, July 87

Page 32: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

khurshid: assertion-driven error recovery 32

warranties–two decades ago (2)

ACM SIGSOFT Software Engineering Notes, Vol. 12, No. 3, July 87

Page 33: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

khurshid: assertion-driven error recovery 33

warranties–today

apple• “Apple warrants the media on which the Apple Software is

recorded and delivered by Apple to be free from defects in materials and

workmanship under normal use for a period of ninety (90) days from the date of original retail purchase.”

• “... THE APPLE SOFTWARE IS PROVIDED "AS IS", WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND ...”

google• “... is provided "as is," with no warranties whatsoever.”

microsoft• “... the Software will perform substantially in accordance with

the accompanying materials for a period of ninety (90) days ...”

Page 34: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

34

economic impact

“The Economic Impact of Inadequate Infrastructure for Software Testing” NIST Report, May 2002

$59.5B annual cost of inadequate software testing infrastructure

$22.2B annual potential cost reduction from feasible infrastructure improvements

Page 35: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

35

do you know of any correct program? :-)

Page 36: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

36

what’s in a name?

anomalybugcrashdefecterror, exceptionfailure, fault, flaw, freezeglitchholeissue...

Page 37: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

37

correctness

common (partial) properties• segfaults, uncaught exceptions• resource leaks• data races, deadlocks

specific properties• requirements• specification

Page 38: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

38

traditional waterfall model

requirementsanalysis

designchecking

implementationunit testing

integrationsystem testing

maintenanceverification

Page 39: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

39

phases (1)

requirements• specify what the software should do• analysis: eliminate/reduce ambiguities,

inconsistencies, and incompletenessdesign

• specify how the software should work• split software into modules, write specifications• checking: check conformance to requirements

Page 40: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

40

phases (2)

implementation• specify how the modules work• unit testing: test each module in isolation

integration• specify how the modules interact• integration testing: test module interactions• system testing: test entire system

maintenance• evolve software as requirements change• regression testing: test changes

Page 41: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

41

testing effort

reported to be >50% of development cost [eg. Beizer’90]

microsoft: 75% time spent testing• 50% testers who spend all time testing• 50% developers who spend half time testing

Page 42: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

42

when to test

the later a bug is found, the higher the cost• orders of magnitude increase in later phases• also the smaller chance of a proper fix

old saying: test often, test earlynew methodology: test-driven development

• write tests before code

Page 43: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

43

software still buggy

folklore: 1-10 (residual) bugs per 1000 nbnc lines of code (after testing)

consensus: total correctness impossible to achieve for complex software• risk-driven finding/elimination of bugs• focus on specific correctness properties

Page 44: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

44

approaches for detecting bugs

software testingmodel checking(static) program analysis

Page 45: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

45

software testing

dynamic approach• run code for some inputs, check outputs

checks correctness for some executionsmain questions

• test-input generation• test-suite adequacy (coverage criteria)• test oracles

Page 46: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

46

model checking

typically hybrid dynamic/static approachchecks correctness for all executionssome techniques

• explicit-state model checking• symbolic model checking• abstraction-based model checking

Page 47: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

47

static analysis

static approachchecks correctness for all executionssome techniques

• abstract interpretation• dataflow analysis• verification-condition generation

Page 48: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

48

current status

testing remains the most widely used approach for bug finding• validation: are we building the right system?• verification: are we building the system right?

a lot of recent progress (say last 7-8 years) on model checking and static analysis• model checking: from hardware to software• static analysis: from sound to practical

vibrant research in the areagap between research and practice

Page 49: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

iClicker question

Model-checking and static analysis of programs is hard because of “state-space explosion”. If there is a 1-Mbit memory, the number of states to consider is:

A.1 millionB.2^(1 million)C.Other

49

Page 50: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

iClicker question

After 1 clock cycle where a memory write can happen, the number of states to explore is:

A.2 millionB.2^(2 million)C.2^(1 million) * 2D.Other

50

Page 51: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

51

next time

basics of java and eclipsehands-on experience with small programs

Page 52: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015

52

?/!