Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC309 Lecture 10

CSC309 Lecture 10

Software Engineering II
Pair Programming II
(202302)

Javier Gonzalez-Sanchez
PRO

January 31, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSC 309
    Software Engineering II
    Lecture 10:
    Pair Programming II
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  2. jgs
    Previously …

    View Slide

  3. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 3
    • Consistent communication
    • Switch roles
    • Pair up carefully (select your pair).
    • A familiar development environment
    • Work at a pace that fits both developers.
    So, best practices

    View Slide

  4. jgs
    A well-defined task

    View Slide

  5. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 5
    1. Read a File and Split the lines
    2. For each line read character by character
    3. Concatenate characters, creating the largest STRING possible. Stop
    when a delimiter, white space, operator, or quotation mark is found. If
    there are more characters in the line, go to step 2.
    4. Bonus points: for each STRING report its TYPE as correspond. E.g., class
    is a keyword, { is a delimiter, hello is a name (identifier), Student is a name
    (identifier), + is an operator, extends is a keyword, etc.
    Part 1

    View Slide

  6. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 6
    public class Parser {
    private static Vector tokens;
    private static int currentToken;
    public static void rule_class () {}
    public static void rule_body () {}
    public static void rule_global_variable () {}
    public static void rule_method () {}
    public static void rule_instruction () {}
    public static void rule_local_variable () {}
    public static void rule_call_method () {}
    public static void rule_assignment () {}
    public static void rule_operation () {} // ignore precedence
    public static void rule_operand() {}
    }
    Part 2

    View Slide

  7. jgs
    Test Cases

    View Slide

  8. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 8
    class Student{}
    Case 1
    Input:
    You have 1 class.
    Classes:
    * Student
    Methods:
    Relationships:
    Output:

    View Slide

  9. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 9
    class Student {
    Hello world;
    }
    Case 2
    Input:
    You have 2 class.
    Classes:
    * Student
    * Hello
    Methods:
    Relationships:
    * Student has a Hello
    Output:

    View Slide

  10. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 10
    class Student extends Person{
    Hello world;
    }
    Case 3
    Input:
    You have 3 classes.
    Classes:
    * Student
    * Person
    * Hello
    Methods:
    Relationships:
    * Student has a Hello
    * Student is a Person
    Output:

    View Slide

  11. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 11
    class Student extends Person{
    Hello world() {
    }
    }
    Case 4
    Input:
    You have 2 classes.
    Classes:
    * Student
    * Person
    Methods:
    * world
    Relationships:
    * Student is a Person
    Output:

    View Slide

  12. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 12
    Let’s Work

    View Slide

  13. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 13
    Questions

    View Slide

  14. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 14
    Office Hours
    Tuesday and Thursday 3 - 5 pm
    But an appointment required
    Sent me an email – [email protected]

    View Slide

  15. jgs

    View Slide

  16. jgs
    CSC 309
    Software Engineering II
    Lab 10:
    Pair Programming
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View Slide

  17. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 17
    Think about this
    1. Select your pair
    2. Understand the task
    (described before)
    3. Chose and set up your
    environment
    4. Be ready to work

    View Slide

  18. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 18
    § Interface declaration
    § Class declaration
    § Inheritance (from 1 class)
    § Realization (implements) from multiple interfaces
    § Variables global
    § Variables global (that are not null)
    § Methods
    § Variables Local
    § Call methods (using an abject or class name)
    Task
    Assume a good user that never never never make mistakes. Thus,
    it is not going to extends from an interface or implements from
    a class

    View Slide

  19. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 19
    Let’s Work

    View Slide

  20. jgs
    CSC 309 Software Engineering II
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Winter 2023
    Copyright. These slides can only be used as study material for the class CSC308 at Cal Poly.
    They cannot be distributed or used for another purpose.

    View Slide