CSCE 606 Software Engineering: Hank Walker
CSCE 606 Software Engineering: Hank Walker
Software Engineering
Hank Walker
3
Projects for Non-Profits
Teams of ~6 students build projects for non-
technical customers from nearby nonprofit
organizations, e.g.,
Humane Society Pet Matchmaker
Student Dormitory Package Notifier
Minority VC firm Customer Relationship
Manager (tracks startup proposals)
Children’s Hospital Nurse Vacation Scheduler
Teams meet weekly with TA; start forming
this week!
4
Children’s Hospital
Screencast of Spring 2012 UCB CS169
project Nurse Scheduler
https://vimeo.com/44837891
Interview with Nurse Managers
https://vimeo.com/46770083
Your team will record a video interview and
screencast for your project
5
Results/Observations
Non-technical customer feedback
90% of teams reported customers “happy” or “thrilled”
50% of customers tried to hire students to continue work
67% of students intend to maintain app after semester
Students engaged in process
Later iteration stories more uniform in complexity & size
Projects varied in code quantity but rarely quality
7
Course Organization
Grading
20% assignments
15% quizzes
15% midterm
50% project
Bonus points based on Participation and Altruism (e.g.,
answering Piazza questions)
Schedule
TR: lecture 5:30-6:45pm, HRBB 124
Teams meet TA (and me) by appointment
Use Piazza (and eCampus)
8
Prereqs & Course Format
Prereqs
Official: CSCE 431 or approval of instructor
Practical: Know object-oriented programming language
Format
Before lecture: do reading
In lecture: put reading in context
After lecture: assignments, for hands-on practice
Required “2-pizza team” (~6 students) project
Design, develop, deploy to “production ISP” (Heroku)
Outsiders invited to final project poster session
9
Programming Homework
Programming homework done on your own
Late policy (without good excuse)
¾ credit if 1 day late, ½ credit if 2 days late, 0 if later
Assignments and project will be deployed using cloud
computing and evaluated there
AWS Cloud9 development environment – sign up for free
account, must give them your CC
https://aws.amazon.com/cloud9
http://www.saasbook.info/bookware-vm-instructions
GitHub: Get a Free Micro Account for Students for use in
this class (not TAMU GitHub)
http://education.github.com
We will use many other free open source tools
10
Honor Code
The Aggie Honor Code:
“An Aggie does not lie, cheat, or steal or
tolerate those who do.”
If you wouldn’t want fellow students, parents,
or professors to know about it, then stop it!
Your instructors join you in pledging to
adhere to this code
11
Textbook
http://saasbook.info
1st edition (v1.2.2)
Available from Amazon
Ebook ($10)
Kindle format
Kept up-to-date
Live links
Print book ($38)
12
Teaching Assistant
Vihang Patel
[email protected]
Once project starts, hold weekly meetings
with him to discuss project status, problems
13
Online Resources
http://www.saasbook.info/students
Online “get started” tutorials on Ruby in
case you want to start on Ruby now
Pointers to online HTML/CSS tutorials in
case you want start on Rails now
Tutorials on other tools (GitHub, c9, etc.)
14
YOUR BRAIN ON COMPUTERS; Hooked on
Gadgets, and Paying a Mental Price
NY Times, June 7, 2010, by Matt Richtel This is your brain on computers.
SAN FRANCISCO -- When one of the most important e- Scientists say juggling e-mail, phone calls and other incoming
mail messages of his life landed in his in-box a few years information can change how people think and behave. They say
ago, Kord Campbell overlooked it. our ability to focus is being undermined by bursts of information.
Not just for a day or two, but 12 days. He finally saw it These play to a primitive impulse to respond to
while sifting through old messages: a big company
wanted to buy his Internet start-up. immediate opportunities and threats. The
''I stood up from my desk and said, 'Oh my God, oh my stimulation provokes excitement -- a dopamine
God, oh my God,' '' Mr. Campbell said. ''It's kind of hard squirt -- that researchers say can be addictive.
to miss an e-mail like that, but I did.''
In its absence, people feel bored.
The message had slipped by him amid an electronic
The resulting distractions can have deadly consequences, as
flood: two computer screens alive with e-mail, instant
when cellphone-wielding drivers and train engineers cause
messages, online chats, a Web browser and the
wrecks. And for millions of people like Mr. Campbell, these
computer code he was writing.
urges can inflict nicks and cuts on creativity and deep thought,
While he managed to salvage the $1.3 million deal after interrupting work and family life.
apologizing to his suitor, Mr. Campbell continues to
While many people say multitasking makes them more
struggle with the effects of the deluge of data. Even after
he unplugs, he craves the stimulation he gets from his Heavy
productive, research shows otherwise.
electronic gadgets. He forgets things like dinner plans, multitaskers actually have more trouble focusing
and he has trouble focusing on his family. His wife,
and shutting out irrelevant information, scientists
Brenda, complains, ''It
seems like he can no
say, and they experience more stress.
longer be fully in the moment.''
And scientists are discovering that even after
the multitasking ends, fractured thinking and
lack of focus persist. In other words, this is also
your brain off computers. 15
The Rules
(and I really mean it!)
16
05/17/2020
Peer Instruction Questions
Increase real-time learning in lecture,
test understanding of concepts vs.
details
As complete a “segment”
ask multiple choice question
<1 minute: decide yourself, vote
<2 minutes: discuss in pairs,
then team vote; flash card to pick answer
Try to convince partner; learn by teaching
☐ What is GitHub?
18
Which is True About CSCE 606
Schedule?
☐ I can leave for Thanksgiving early since
we won’t have a lecture the week before
☐ I can leave for Christmas early since the
project poster/demo session is optional
21
Ranking Top 200 Jobs (2012)
23
How Can You Avoid Infamy?
Lessons from 60 years of SW development
This class will review many approaches in
lecture, listing pros and cons
Will get hands on experience with one
approach good for Software as a Service
24
END
25
Software as a Service
26
Software Targets
Traditional SW: binary code installed and
runs wholly on client device, which users
must upgrade repeatedly
Must work with many versions of hardware, OS
New versions must go through extensive
release cycle to ensure compatibility
Alternative: develop SW that only needs to
work on one HW & OS platform?
Quicker release cycle, no user upgrades?
27
Software as a Service: SaaS
SaaS delivers SW & data as service over
Internet via thin program (e.g., browser)
running on client device
Search, social networking, video
Now also SaaS version of traditional SW
E.g., Microsoft Office 365, TurboTax Online
Instructors think SaaS is revolutionary, the
future of virtually all software
28
6 Reasons for SaaS
1. No install worries about HW, OS
2. No worries about data loss (data is remote)
3. Easy for groups to interact with same data
4. If data is large or changes frequently,
simpler to keep 1 copy at central site
5. 1 copy of SW, single HW/OS environment
=> no compatibility hassles for developers
=> beta test new features on 1% of users
6. 1 copy => simplifies upgrades for
developers and 29
SaaS Loves Rails
Many frameworks/languages for SaaS
Django/Python, Zend/PHP, Spring/Java
We use Ruby on Rails (“Rails”)
Rails popular programming framework that
uses Ruby – e.g., Twitter
30
Why Take Time for Ruby/Rails?
14 weeks to learn:
SaaS, Agile, Pair Programming, Behavior
Driven Design, LoFi UI, Storyboards, User
Stories, Test Driven Development, Enhance
Legacy Code, Scrum, Velocity, JavaScript,
Design Patterns, UML, Deployment, Security
You only work part-time on this class
Only hope is highly productive language,
tools, framework: Rails currently the best
See “Crossing the Software Education Chasm,”
A. Fox, D. Patterson, Comm. ACM
31
END
32
Which is WEAKEST Argument for a
Google App’s Popularity as SaaS?
33
END
34
Service Oriented Architecture
(SOA)
35
Software Architecture
Can you design software so that you can
recombine independent modules to offer
many different apps without a lot of
programming?
36
Service Oriented Architecture
SOA: SW architecture where all
components are designed to be services
Apps composed of interoperable services
Easy to tailor new version for subset of users
Also easier to recover from mistake in design
Contrast to “SW silo” without internal APIs
37
CEO: Amazon shall use SOA!
1. “All teams will henceforth expose their data and
functionality through service interfaces.”
2. “Teams must communicate with each other
through these interfaces.”
3. “
38
CEO: Amazon shall use SOA!
4. “It doesn't matter what [API protocol] technology
you use.”
5. “Service interfaces, without exception, must be
designed from the ground up to be
externalizable. That is to say, the team must plan
and design to be able to expose the interface to
developers in the outside world. No exceptions.”
6. “Anyone who doesn't do this will be fired.”
7. “Thank you; have a nice day!
39
Bookstore: Silo
Internal subsystems
can share data directly reviews users orders
single API
(“Bookstore”) Bookstore Service
Review
Service
accesses User Bookstore Service
Profile API
Can recombine to
Favorite Books
make new service Service
users
(“Favorite Books”)
Social
(Figure 1.7, Engineering Software as a Network
Service by Armando Fox and David Service
Patterson, 1st edition, 2014.)
41
END
42
Which is NOT True About SOA?
45
What is Ideal HW for SaaS?
Amazon, Google, Microsoft … developed
hardware systems to run SaaS
What did they use: Mainframes?
Supercomputers?
How can independent SW developers build
SaaS apps and compete without similar HW
investments to Amazon, Google, Microsoft?
46
SaaS Infrastructure?
SaaS’s 3 demands on infrastructure:
1. Communication
Allow customers to interact with service
2. Scalability
Fluctuations in demand during day + new
services to add users rapidly
3. Dependability
47
Services on Clusters
Clusters: Commodity computers connected
by commodity Ethernet switches
1. More scalable than conventional servers
2. Much cheaper than conventional servers
20X for equivalent vs. largest servers
3. Dependability via extensive redundancy
4. Few operators for 1000s servers
Careful selection of identical HW/SW
Virtual Machine Monitors simplify operation
48
Warehouse Scale Computers
Clusters grew from 1000 servers to 100k
based on customer demand for SaaS apps
Economies of scale pushed down cost of
largest data center by factors 3X to 8X
Purchase, house, operate 100K v. 1K computers
Traditional data centers utilized 10% - 20%
Earn $ offering pay-as-you-go use at less
than customer’s costs for as many
computers as customer needs
49
Utility Computing /
Public Cloud Computing
Offers computing, storage, communication
at pennies/hour
No premium to scale:
1000 computers @ 1 hour
= 1 computer @ 1000 hours
Illusion of infinite scalability to cloud user
As many computers as you can afford
50
2013 AWS Instances & Prices
Instance Type $ Per $ Ratio Virtual Compute Memory Storage (GB)
Hour to small Cores Units (GB)
m1.small 0.06 1.0 1 1.0 1.7 1 x 160
m1.medium 0.12 2.0 1 2.0 3.8 1 x 410
m1.large 0.24 4.0 2 4.0 7.5 2 x 420
m1.xlarge 0.48 8.0 4 8.0 15.0 4 x 420
m3.xlarge 0.50 8.3 4 13.0 15.0 EBS
m3.2xlarge 1.00 16.7 8 26.0 30.0 EBS
c1.medium 0.15 2.5 2 5.0 1.7 1 x 350
c1.xlarge 0.58 9.7 8 20.0 7.0 4 x 420
cc2.8xlarge 2.40 40.0 32 88.0 60.5 4 x 840
m2.xlarge 0.41 6.8 2 6.5 17.1 1 x 420
m2.2xlarge 0.82 13.7 4 13.0 34.2 1 x 850
m2.4xlarge 1.64 27.3 8 26.0 68.4 2 x 840
cr1.8xlarge 3.50 58.3 32 88.0 244.0 2 x 120 SSD
hi1.4xlarge 3.10 51.7 16 35.0 60.5 2 x 1024 SSD 51
Supercomputer for Hire
Top 500 supercomputer competition in 2012
532 8xlarge (@ $2.40/hour), 17000 cores =
240 TeraFLOPS
72nd/500 supercomputer @ ~$1300 per hour
Credit card => can use 1000s computers
FarmVille on AWS
Prior biggest online game 5M users
What if startup had to build data center?
4 days =1M; 2 months = 10M; 9 months = 75M
52
IBM Watson for Hire?
Jeopardy Champion IBM Watson
Hardware: 90 IBM Power 750 servers
3.5 GHz 32 cores/server
360 @~$2.40/hour = ~$800/hour?
Cost of top human attorney or accountant
For what tasks could AI be as good as
highly trained person @ $800/hour?
And rapidly falling cost
53
END
54
Which is NOT True About SaaS,
SOA, and Cloud Computing?
Clusters are collections of commodity
☐
servers connected by LAN switches
The Internet supplies the
☐
communication for SaaS apps
Cloud computing uses HW clusters + SW
☐
layer using redundancy for dependability
Private data centers could match cost of
☐ Warehouse Scale Computers if they just
used same type of HW and SW
55
END
56
Legacy SW vs. Beautiful SW
57
Programming Aesthetics
Do I care what others think of my code?
If it works, does it matter what code looks like?
58
Legacy SW vs. Beautiful SW
Legacy code: old SW that continues to
meet customers' needs, but difficult to
evolve due to design inelegance or
antiquated technology
___% SW maintenance costs adding new
functionality to legacy SW
___% for fixing bugs
Contrasts with beautiful code: meets
customers' needs and easy to evolve
59
Legacy SW vs. Beautiful SW
Legacy code: old SW that continues to
meet customers' needs, but difficult to
evolve due to design inelegance or
antiquated technology
60% SW maintenance costs adding new
functionality to legacy SW
17% for fixing bugs
Contrasts with beautiful code: meets
customers' needs and easy to evolve
60
Legacy Code: Vital but Ignored
Missing from traditional SWE courses and
textbooks
#1 request from industry experts we asked:
What should be in new SWE course?
Save work by reusing existing code (e.g., open
source)
Will have legacy lectures and programming
assignments later in course
61
END
62
Which Type of SW is Considered an
Epic Failure?
☐ Beautiful code
☐ Legacy code
63
END
64
Quality Assurance &Testing
65
Software Quality
What is software quality, and how to we
assure it? (QA)
V&V: What is the difference (if any) between
Verification and Validation?
66
Software Quality
Product quality (in general): “fitness for use”
Business value for customer and manufacturer
Quality Assurance : processes/standards
=> high quality products & to improve quality
Software quality:
1. Satisfies customers’ needs - easy to use, gets
correct answers, does not crash, …
2. Be easy for developer to debug and enhance
Software QA: ensure quality and improve
processes in SW organization
67
Assurance
Verification: Did you build the thing right?
Did you meet the specification?
Validation: Did you build the right thing?
Is this what the customer wants?
Is the specification correct?
Hardware focus generally Verification
Software focus generally Validation
Testing to Assure Software Quality
69
Testing
Exhaustive testing infeasible
Divide and conquer: perform different tests
at different phases of SW development
Upper level doesn’
System or acceptance test: integrated program meets
its specifications
Integration test: interfaces between units have
consistent assumptions, communicate correctly
Module or functional test: across individual units
Unit test: single method does what was expected 70
More Testing
Black box vs. White Box testing
Testing based on specs vs. on implementation
Test Coverage: % of code paths tested
Regression testing: automatically rerun old
tests to check that changes don’t break
what used to work
Continuous Integration (CI) testing:
continuous regression testing on each code
check-in vs. later testing phase
71
END
72
Which is NOT True About Testing?
75
Productivity
50 years of Moore’s Law => 2X /1.5 years
HW designs get bigger
Faster processors and bigger memories
SW designs get bigger
Had to improve SW productivity
4 techniques
1. Clarity via conciseness
2. Synthesis
3. Reuse
4. Automation and Tools
76
1. Syntax: shorter and easier to read
assert_greater_than_or_equal_to(a,7)
vs. ________________
77
1. Syntax: shorter and easier to read
assert_greater_than_or_equal_to(a,7)
vs. a.should be ≥ 7
2. Raise the level of abstraction:
HLL programming languages vs. assembler
Automatic memory management (Java vs. C)
Scripting languages: reflection,
metaprogramming
78
Synthesis
Software synthesis
BitBlt: generate code to fit situation & remove
conditional test
Research Stage: Programming by example
79
Reuse
Reuse old code vs. write new code
Techniques in historical order:
1. Procedures and functions
2. Standardized libraries (reuse single task)
3. Object oriented programming: reuse and
manage collections of tasks
4. Design patterns: reuse a general strategy
even if implementation varies
80
Automation and Tools
Replace tedious manual tasks with
automation to save time, improve accuracy
New tool can make lives better (e.g., make)
Concerns with new tools: Dependability,
UI quality, picking which one from several
Good software developer must repeatedly
learn how to use new tools: lifetime learning
Lots of chances in this course:
Cucumber, RSpec, Pivotal Tracker, …
81
END
82
Which is TRUE About Productivity?