![Page 1: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/1.jpg)
EE422CSoftware Design and Implementation II
Vallath Nandakumar
Fall 2015
![Page 2: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/5.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/11.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/13.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/14.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/15.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/16.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/18.jpg)
18
questions about course administration?
![Page 19: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/19.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/20.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/21.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/22.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/23.jpg)
23
first actual case of bug being found
harvard mark II
![Page 24: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/24.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/25.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/26.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/27.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/28.jpg)
![Page 29: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/29.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/30.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/31.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/32.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/33.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/34.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/35.jpg)
35
do you know of any correct program? :-)
![Page 36: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/36.jpg)
36
what’s in a name?
anomalybugcrashdefecterror, exceptionfailure, fault, flaw, freezeglitchholeissue...
![Page 37: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/37.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/38.jpg)
38
traditional waterfall model
requirementsanalysis
designchecking
implementationunit testing
integrationsystem testing
maintenanceverification
![Page 39: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/39.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/40.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/41.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/42.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/43.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/44.jpg)
44
approaches for detecting bugs
software testingmodel checking(static) program analysis
![Page 45: EE422C Software Design and Implementation II Vallath Nandakumar Fall 2015](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/45.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/46.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/47.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/48.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/49.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/50.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/51.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081504/5697bfc61a28abf838ca763e/html5/thumbnails/52.jpg)
52
?/!