1 of 21

cs156-w24-week00-c

CMPSC 156 W24, Lecture, 1/11/2024

  1. Announcements (5 minutes)

  • Intro to jpa00 and jpa01�
  • Time to work on jpa00, jpa01 H00

2 of 21

Discussion Seating

Please sit with your team

The four colors show roughly where your�four teams of six people should assemble.

Team to table assignment is�first come / first served.

So if your team prefers the cool round tables,�make sure one of your team members gets to�discussion section early.��If there's a "tie", be nice: use rock/paper/scissors,�flip a coin or something.

3 of 21

Remote participation via zoom

When team members are participating via zoom

Feeling ill? �For some other reason unable to participate in person?�Please still try to participate synchronously via zoom:

  1. Let your team know on your slack channel.�(not necessarily to contact instructor separately)�
  2. Zoom link is on Slack #announcements channel or Canvas

For the folks that are in person:

  • Please join the zoom channel using the PC at your team table�(you'll need the meeting id / password posted on zoom and pinned on slack)
  • Please also join with one or more of your laptops.
  • Please do your best to include the remote team members in team activities.

4 of 21

Reminder:�You'll need two different ssh keys: one for CSIL, one for your laptop

The ssh key on CSIL (you made one in p00) is needed for:

  • Connecting to github repos (pull, push) directly from CSIL�(as you may have done in other courses, e.g. CS16, 24, 32)
  • Issuing commands to the dokku servers (new for this class; more later!)

The ssh key on your laptop is needed for:

  • Connecting to github repos (pull, push) directly from your laptop�e.g. if you are doing your work on your laptop, by passing CSIL completely.�

Most of the coding work we'll do in this class will NOT be done directly on CSIL

  • Building and testing full-stack web apps is typically much easier on your own machine
  • But we will need CSIL access for "developer operations" (devops) to deploy the apps

5 of 21

Assignments due by next week

  • jpa00 - due before Wednesday discussion next week (1/17)
  • jpa01 - due before Thursday discussion next week (1/18)
  • H00 - due before Tuesday lecture next week (1/16)

6 of 21

jpa00: a simple Hello World� but with a twist...

It uses Maven and �a pom.xml for compilation

You'll get the full 100 points by just powering through�the instructions, which involve a simple change to the�code above.

But if you want to really learn from this, �you are encouraged to dig in a bit to these articles, �and the pom.xml file:

https://ucsb-cs156.github.io/topics/maven/

https://ucsb-cs156.github.io/topics/maven/maven_hello_world.html

7 of 21

jpa01: Introduction to testing

  • There should be content here for Java beginners and adepts alike.
  • Note that you are permitted (though not required) to work in pairs; if you do, please choose a pair partner from your same team.

8 of 21

jpa01: 3 types of testing

  • Unit testing, for testing the code
  • Test Coverage, for testing the tests
  • Mutation Testing, also for testing the tests

9 of 21

jpa01: Test coverage

  • Verify that tests actually run all of your code:

10 of 21

jpa01: Mutation tests

  • Verify that tests catch changes in code:
  • Mutant is killed if any test fails

  • Mutant is alive if no test fails

11 of 21

jpa01: Mutation tests

  • Consider the following implementation:

12 of 21

jpa01: Mutation tests

  • You write a go-right test:

13 of 21

jpa01: Mutation tests

  • But that test doesn’t kill all mutants:

14 of 21

jpa01: Mutation tests

  • Here’s the original code:

15 of 21

jpa01: Mutation tests

  • Here’s the mutated code:

!

16 of 21

jpa01: Mutation tests

  • Verify that tests catch changes in code:
  • Mutant is killed if any test fails

  • Mutant is alive if no test fails

17 of 21

jpa01: Mutation tests

  • The solution is to add tests that fail on the mutants!

18 of 21

Assignments due by next week

  • jpa00 - due before Wednesday discussion next week (1/17)
  • jpa01 - due before Thursday discussion next week (1/18)
  • H00 - due before Tuesday lecture next week (1/16)

19 of 21

H00: Completing the file you started in P04

Find the assignment H00 on Canvas: �or on the course website: https://ucsb-cs156.github.io/w24/hwk/h00/�and follow the instructions.

When done: submit to H00 (a link to your individual file on Canvas)

The URL you enter should be the URL that links directly to your page, one of the files:

  • sect4.1.md, sect4.2.md, sect4.3.md, sect4.4.md, sect4.5.md, or sect4.6.md

For example: if you are on team m23-9am-3 and assigned to section 4.4, �your link would look like this:

  • https://github.com/ucsb-cs156-w24/w24-5pm-3-NOTES/blob/main/p04/sect4.4.md

The link should take you directly to the page where you entered your answers.

20 of 21

P04: Dividing up the LTD paper sections in your NOTES repo

Find the assignment P04:

on Canvas: https://ucsb.instructure.com/courses/14657/assignments/165164

or the course website: https://ucsb-cs156.github.io/f23/hwk/p04/

Follow the instructions!

When done: one person submits for the group

  • Submit the URL for your NOTES repo, e.g. �https://github.com/ucsb-cs156-f23/f23-5pm-3-NOTES
  • Submit it for the P04 assignment on Canvas

When done:

  • If you haven't finished P00 or P02, please do them before you leave today
  • Work on:
    • jpa00 (as individuals, but helping each other is allowed)
    • H00 (might as well get it done!)

21 of 21

Next week... first webapps

First we need the ssh keys in place (from P04).

And a little bit of material on:

Front End

Back End

Language

Javascript

Java

Build System

nvm / npm / node

mvn (Maven)

Framework

React

Spring Boot

Test Framework

jest

JUnit

Additional Testing Tools

coverage�StrykerJS

Jacoco�Pitest