CSE110 day12

Embed Size (px)

Citation preview

  • 8/10/2019 CSE110 day12

    1/24

    A Fistful of Ideas

    1

  • 8/10/2019 CSE110 day12

    2/24

    Quiz set-up Hats off/backwards (brims and hoods)

    Technology and notes put away

    On your desk Single piece of standard-sized paper pen/pencil

    eraser if you like, but faster to scratch out

    About your paper Name and student ID on paper

    Eyes on your own paper

    Protect your paper

    Please write neatly

    Turn over after done checking your answer

    Question? Raise your hand and well come over

    Remember Partial credit do your best

    We grade gently2

  • 8/10/2019 CSE110 day12

    3/24

    Quiz1. Apply the Strategy Pattern to the code below so that customers can

    also use MasterCard, AmEx, etc. credit cards to make purchases.

    class VisaCard { boolean validateCSC(int csc) {} }

    class CustomerAcct{private VisaCard card;CustomerAcct (VisaCard card) { this.card = card; }boolean acceptCSC(int csc) {return card.validateCSC(csc);

    }

    2. Draw class diagrams for the above code and your Strategy solution.

    3. Using my ten-cent OOD method, provide a class design (classes,fields, and method in te r faces) for the given BDD scenario:

    Givena wizard named HarryAnd a wizard named HermioneWhen the wizards meetThen a spark occurs

    You can use either UML or code, but no method bodies, please. 3

    CSC = Card Security CodeOOD = Object-Oriented Design

  • 8/10/2019 CSE110 day12

    4/24

    Discussion1. Apply the Strategy Pattern to the code below so that customers can

    also use MasterCard, AmEx, etc. credit cards to make purchases.

    interface CardType { boolean validateCSC(int csc); }

    class VisaCard implements CardType { boolean validateCSC(int csc) {} }

    class MasterCard implements CardType { }

    class CustomerAcct{private CardType card;CustomerAcct (CardType card) { this.card = card; }boolean acceptCSC(int csc) {return card.validateCSC(csc);

    }

    4

  • 8/10/2019 CSE110 day12

    5/24

    Discussion2. Draw class diagrams for the above code and your Strategy solution.

    5

    _____CreditCard_____b oo l va lid a teC SC (in t )

    ______VisaCard______bool validateCSC(int)

    ____MasterCard_____bool validateCSC(int)

    ____CustomerAcct____

    - CardType card______bool acceptCSC(int)

    (a fte r c a se o nly )

    (Rec a ll tha t Powe rPo int do e sn t ha ve the op en a rrow ,

    so he re Im using a c lo sed a rrow fo r sub c la ss, a nd a

    swoo p ed a rrow fo r c om p oses)

  • 8/10/2019 CSE110 day12

    6/24

    Quiz3. Using my ten-cent OOD method, provide a class design (classes,

    fields, and method in te r faces) for the given BDD scenario:Givena wizard named HarryAnd a wizard named HermioneWhen the wizards meet

    Then a spark occurs

    You can use either UML or code, but no method bodies, please.

    w iza rd

    sparkwizards

    class Wizard {private String name;

    Wizard(String name);String getName();}

    class Wizards {

    List wizards;

    } 6

    CSC = Card Security CodeOOD = Object-Oriented Design

    WizardTracker {private Wizards wizards;boolean meet(Wizard a, b); // might make/trigger spark

    }

    class Spark {void occurs();

    }

  • 8/10/2019 CSE110 day12

    7/24

    Remember

    Yes, its hard too hard for most people to t ry

    thats why youre in college

    youre the top of the top 10%

    thats why the pay is high and the jobs easy to get

    If I didnt have you learn it, Id be cheating you

    Well keep at it until you master it

    stakes are low in quizzes: 2% and we drop one

    graded gently

    I only curve your grade up, never down

    well get you ready for final

    7

  • 8/10/2019 CSE110 day12

    8/24

    Your Resume, Today

    8

  • 8/10/2019 CSE110 day12

    9/24

    Things you can put on your resume now

    Technologies

    Java, Android, Google App Engine

    Tools

    Eclipse, JUnit, JIRA, GIT, Android ADT

    Techniques

    Agile Software Process, BDD

    Basic OOD, Design Patterns

    Mobile software development

    Course

    Software Engineering (CSE 110)

  • 8/10/2019 CSE110 day12

    10/24

    Keep Change - Start

    96 responses

    10

  • 8/10/2019 CSE110 day12

    11/24

    Keep Change Start

    Keep

    Clicker questions, Labs, Reading quizzes, Piazza

    Change

    Adaptive reading quizzes (need more time)

    Clicker questions take too long (e.g., ask for answers) In-class quizzes are too difficult

    Start

    Better labs: error-free, clearer

    Discuss Android development in class

    11

  • 8/10/2019 CSE110 day12

    12/24

    Keep Change Start

    Adaptive reading quizzes (need more time) The adaptive quiz gave 4 minutes/question

    Required about 15 clicks I encourage you to do reading and understand it before

    starting quiz

    Each quiz is worth 0.3% of grade; drop 2 lowest

    Clicker Qs take too long (e.g., ask for answers) Ive been speeding up, I hope you noticed

    I havent asked for answers in over two weeks (day 7)

    Generally only ask for answers on tradeoff questions

    In-class quizzes are too difficult

    (Already discussed)

    12

  • 8/10/2019 CSE110 day12

    13/24

    Keep Change Start

    Better labs: error-free, clearer Yes, Im sorry, were trying really hard

    Google is a real problem

    Only one lab left!

    How some of you could help: read the lab, dont just cut-and-paste as fast as you can

    Discuss Android development in class Covered in Discussion and Lab

    Do need to teach software engineering, too

    Android also here! We did Android Listener, integrate with GoogleMap

    Callbacks and Observer pattern central to Android

    Strategy pattern is central to LocationProvider (e.g.)

    The preference for Interfaces over subclassing

    Want more Android? The web is full of tutorials (video, too)13

  • 8/10/2019 CSE110 day12

    14/24

    Always Runnable

    Slow and steady wins the race

    14

  • 8/10/2019 CSE110 day12

    15/24

    Agile and A lw a ys Runna b le

    If your app is running, you can confidentlydevelop, test, debug, and demo

    If it doesnt run after adding new story, no fear Roll back, debug new code, etc.

    Failed tests, new bugs are due to new storyNarrows search, code still familiar

    Can demo your new story right away Self, teammates, customer

    15

  • 8/10/2019 CSE110 day12

    16/24

    A lw a ys Runna b le: How

    User story is a new thing the user can do with app So it should be demo-able, system testable, etc.

    Keep stories small But tendency is to make them too big

    Implement story in runnable order dont do all the logic, then all the UI, etc.

    do enough of each to get essence of it running

    then add on the remainder bit by bit, always runnable

    Test as you go Dont check-in code until system tests run

    If the system tests dont pass, then it doesnt run

    Debug immediately, while fresh on your mind16

  • 8/10/2019 CSE110 day12

    17/24

    Lets do this

    17

  • 8/10/2019 CSE110 day12

    18/24

    The sum is greater than its parts

    Respect

    Planning

    Language

    Negotiation

    18

    Ind iv id ua l c omm itm ent to a g ro up e f fo rt tha t is

    w ha t m a kes a tea m w o rk, a c om p a ny w o rk, a

    so c ie ty w o rk, a c iviliza t io n w o rk.

    - Vince Lombardi

  • 8/10/2019 CSE110 day12

    19/24

    Respect

    All human beings are deserving of respect including the ones on your team ;)

    polite, friendly, considerate on time, etc.

    Embrace diversity different people have different skills or preferences

    makes the team more capable, versatile, energetic

    Dont rush to judgment unique people face unique challenges

    your compassion should earn respect

    Dont abuse your teams goodwill Put in the effort

    Und e r p rom ise a nd o ve r d e live r

    19

  • 8/10/2019 CSE110 day12

    20/24

    Planning

    Not like hacking with your best friend

    Teams of size six wont naturally coordinate Plan your stand-ups

    Plan your coding sessions

    Plan your testing

    Plan your delivery session

    Respect can be planned, too

    Frank but respectful discussion at stand-ups Take meals together, do something fun together

    Will go a long way towards the respect thing

    Rotate pairs on tasks so that everyone works witheveryone

    20

  • 8/10/2019 CSE110 day12

    21/24

    Language and Body Postures

    Listen more than you talk Respond to what you hear, dont change subject

    Ask questions

    Avoid talking over, interrupting

    Avoid: ultimatums, confrontational language

    Anti-team language:

    No, w ro ng , d o n t , neve r Answer with But

    Pro-team language:

    Ye s, I se e , I (d o n t ) und e rsta nd , Ca n you exp la in?, I se ew here yo u re c om ing from

    Answer with And

    Avoid: crossed arms, leaning back, frowning, shaking head

    Try: uncrossed arms, leaning forward, smiling, nodding21

  • 8/10/2019 CSE110 day12

    22/24

    Negotiation

    Respect and planning arent enough

    True conflicts arise

    I want to learn the Android map control you want easy tasks and are expert at it

    Who will get to code it?

    Negotiate it Take turns!

    Pair program together!

    Horse trade

    Is something else easy for you, too? Something else you could trade for?

    A very creative process

    Beware long-term trades: Yo u d o the f irst p ha se a nd I lld o the sec ond p ha se Any error in planning will mean you do the second phase, too

    22

  • 8/10/2019 CSE110 day12

    23/24

    Trouble-shooting the dysfunctional team

    People being mean to each other

    Re sp e c t p ro b lem how can we rebuild it?

    Some one is moody and sulking

    Re sp e c t p ro b lem ? Talk about it.

    Not g e t ting w ha t he w a nts from p ro je c t? Negotiate!

    A pair never contributes b/c they alwayshave an exam to study for?

    1. Rotate pair-programming teams

    2. Negotiate

    3. Suggest a meeting with me

    23

  • 8/10/2019 CSE110 day12

    24/24

    Take-Aways

    Planning

    Effort

    and Respect

    Are an unbeatable combination

    24