project product - university of torontomashiyat/csc309/lectures/project-product.pdf ·...

51
Project Product 1 Thanks to Nilesh Bansal for material in these slides

Upload: dokhue

Post on 01-Apr-2018

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Project  Product  

1  Thanks  to  Nilesh  Bansal  for  material  in  these  slides  

Page 2: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

REAL  WORLD  

2  

Page 3: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Core  Difference  

•  Project  –  You  define  the  problem  statement  

3  

Page 4: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Core  Difference  

•  Project  –  You  define  the  problem  statement  –  You  are  the  primary  user  

INPUT  DATE:    03  /  06  /  2010  

4  

Page 5: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Core  Difference  

•  Project  –  You  define  the  problem  statement  –  You  are  the  primary  user  –  OJen  technically  challenging  and  novel  

5  

Page 6: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Core  Difference  

•  Project  –  You  define  the  problem  statement  –  You  are  the  primary  user  –  OJen  technically  challenging  and  novel  

•  Product  –  Solving  someone  else’s  problem  –  Someone  else  is  using  the  product  –  OJen  simple  solu:ons  to  complex  problems  

6  

Page 7: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Overview  

•  Usability  

•  Security  

•  Reliability  

•  Performance    

7  

Page 8: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

USABILITY  

8  

Page 9: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Usability  

•  Most  important,  but  oIen  overlooked  –  Very  difficult  task    

9  

Page 10: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Usability  

•  Most  important,  but  oIen  overlooked  –  Very  difficult  task  –  Silently  observe  user      

Make  common  easy,  and  uncommon  possible  

10  

Page 11: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Google  Search  

11  

Page 12: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Google  Search  

12  

Make  common  easy,  uncommon  possible  

Page 13: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Google  Search  

13  

Make  common  easy,  uncommon  possible  

Page 14: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Reasonable  Defaults  

14  

•  Customizable  interface  –  But  90%  users  do  not  customize  –  They  use  what  system  provides  by  default    

Page 15: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Features  vs  Solu:ons  

•  People  are  inherently  lazy  –  They  do  not  want  to  use  your  product  

•  But  people  have  real  life  problems  –  And  they  want  the  easiest  way  to  solve  the  problem  

•  If  a  “feature”  is  not  easy  to  use,  it  does  not  exist    

15  

Page 16: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Google+  

16  

Page 17: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Facebook  always  had  lists  

17  

Page 18: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Affordance:  Knobs  are  for  turning  

18  

A  quality  of  an  object  that  allows  an  individual  to  perform  an  acZon  

Page 19: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

BuVons  for  pressing  

19  

Page 20: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Is  This  Really  Necessary?  

20  

Page 21: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Affordance  

21  

Page 22: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Affordance  

22  

Page 23: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Affordance  

23  

Page 24: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Typography  and  Content  Display  

•  More  important  informa:on  in  bigger  font  –  Progressively  move  down  –  Use  bold  /  yellow  backgrounds  to  highlight  

24  

Page 25: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Layout  

•  Toronto  Weather  

25  

Page 26: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Layout  

•  Toronto  Weather  

26  

Page 27: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Typography  /  Text  

27  

Name:  Marshall  Mathers  User  Id:  eminem  LocaZon:  Detroit  Bio:  I  am  not  afraid  Url:  h]p://twi]er.com/eminem  Picture:    

Page 28: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Typography  /  Text  

28  

Name:  Marshall  Mathers  User  Id:  eminem  LocaZon:  Detroit  Bio:  I  am  not  afraid  Url:  h]p://twi]er.com/eminem  Picture:    

Page 29: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Consistency  

•  Consistent  terminology  –  Login  or  Sign  In?  Pick  one.  –  Do  not  mix  Logout  and  Sign  Out.    

•  Different  terminology                        User  Se`ngs                                                                                        User  Preferences              Account  Se`ngs                                                                            Account  SeZngs  

 

29  

Page 30: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Example:  Delete  /  Undo  

30  

•  Confirma:on  boxes  are  intrusive  

Page 31: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Example:  Delete  /  Undo  

31  

•  Provide  an  Undo  op:on  

Page 32: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Aesthe:cs  

•  Beauty  maVers.  

•  Direct  correla:on  to  sales  –  Clients  will  buy  a  sleeker  looking  soJware  over  one  with  more  features  

32  

Page 33: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Please,  do  not  design  like  this  

33  

Page 34: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

SECURITY  

34  

Page 35: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

ALWAYS  think  about  security  

•  Sony  Playsta:on  Network  –  Personal  data  of  77  million  users  stolen  

•  Lots  of  bad  guys  out  there  –  IBM  monitors  150,000  security  events  per  second  – Mostly  automated,  exploit  common  flaws  – Want  to  use  your  server  as  a  bot  

•  Anonymous,  LulzSec  and  others  

35  

Page 36: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

XSS:  Cross  Site  Scrip:ng  

•  AVacker  injects  a  script  into  web  page  

Contents  of  index.php:  <input  value=“<?  echo  $_GET[‘name’]  >”  />    Request:  index.php?name=“/><script  …    •  Escape  HTML  from  all  dynamic  content  before  displaying  –  Java  has  StringEscapeUZls.escapeHtml(…)  

 

36  

Page 37: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

SQL  Injec:on  

SELECT  login_id,  full_name  FROM  table    WHERE  email  =  'x'  AND  1=(SELECT  COUNT(*)  FROM  table);';      

•  Always  escape  strings  –  Use  PreparedStatement  (in  Java)  

37  

Page 38: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Other  Security  Issues  

•  Always  store  passwords  using  one-­‐way  encryp:on  –  Can  not  be  decrypted  

•  Check  for  user  privileges  –  Specially  when  including  or  redirecZng  to  other  files  

•  Keep  base  system  secure  –  Stop  unnecessary  services  –  Update  regularly  for  security  patches  –  Use  firewalls  

 

38  

Page 39: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

RELIABILITY  

39  

Page 40: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Up:me  

•  Near-­‐100%  availability  is  important  –  System  is  always  operaZonal    

•  No  data  loss  –  Backups  and  disaster  recovery  

•  Remember  –  Failures  are  correlated  –  Human  errors  are  common  cause  

40  

Page 41: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Redundancy  

•  Hot  Failover  –  AutomaZc  switch  from  failed  to  available  system  

•  Hardware  Redundancy  –  RAID  10  –  mirror  all  data  –  Two  network  switches,  two  Ethernet  cards,  two  power  supplies,  two  HBA  (host  bus  adapter)  controllers  etc..  

•  Redundant  Infrastructure    

41  

Page 42: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Simplified  Infrastructure  Example  

42  

Apache  HTTPD  Use  of  virtual  IP  to  make  sure  the  user  is  always  directed  to  the  server  that  is  available.  Apache  acts  as  front-­‐end  proxy  to  redirect  the  request  to  backend  Tomcat.  

ApplicaZon  Server  Tomcat  is  commonly  used  Java  app  server.  Most  code  runs  on  this  machine.  Apache  HTTPD  Load  Balancer  and  Proxy  Pass  module  are  used  to  provide  failover  and  redundancy.  

Databases  Master  –  Slave  replicated  database  servers.  ApplicaZon  server  maintains  the  sate  of  each  server  to  provide  reliability.  All  writes  must  happen  on  master.  

Page 43: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Monitoring  

•  Open  Source  –  CacZ  –  Nagios  

•  Custom  –  Internal  System  Check  module  

•  Paid  Hosted  –  Site  24x7  

43  

Page 44: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

PERFORMANCE  

44  

Page 45: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Performance  and  Scalability  

•  Don't  op:mize  un:l  you  need  to  – Make  code  readable  –  Use  Profiler  (for  Java,  Netbeans  is  great  and  free)  

•  Common  tricks  –  Cache  –  Pre-­‐compute  –  Sample  –  Parallelize  

•  Using  mulZ-­‐core  •  To  different  machines  

 45  

Page 46: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Scalability,  Consistency,  Reliability  

•  You  can  only  easily  have  two  of  the  three  –  Consistency:  among  mulZple  replica  of  data  –  Reliability:  conZnuous  operaZonal  –  Scalability:  growing  with  increase  in  number  of  users  

46  

reliability  

consistency   scalability  

Page 47: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Caching  and  Pre-­‐compu:ng  

•  User  queries  are  correlated  –  Caching  is  most  common  opZmizaZon  – Must  be  willing  to  sacrifice  some  consistency  

•  Fully  or  par:ally  pre-­‐compute  –  Every  night,  create  useful  staZsZcs  (e.g.,  a  staZsZcal  histogram  of  word  frequencies  in  search  services)  

•  Sample  –  Approximate  results  are  fine  

47  

Page 48: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

CPU  Op:miza:ons  

•  Mul:-­‐thread  –  Java  has  package  to  manage  Executors  –  Pay  a]enZon  to  thread  safety  

•  Use  op:mized  collec:ons  –  CERN  Colt,  GNU  Trove  to  save  memory  

•  Use  a  Profiler  

48  

Page 49: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Code  Quality  vs  Performance  

•  KISS  –  Keep  It  Simple  Stupid  

•  KIWI  –  Kill  It  With  Iron  –  Upgrade  your  hardware  (more  disks,  more  memory,  etc.)  

49  

Page 50: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

CONCLUSION  

50  

Page 51: Project Product - University of Torontomashiyat/csc309/Lectures/project-product.pdf · CoreDifference • Project% – You(define(the(problem(statement – You(are(the(primary(user(–

Ques:ons?  

51