In this module we introduce the basic concepts behind networking. We use Java's networking libraries to design simple programs that interact with web pages as well as write simple client-server programs.

We conclude this module with an introduction to Mocking and Mockito. We show how to use mocking of objects in your tests in order to simulate the behavior of dependent code, and assist with unit tests.

  1. Given a URL, identify each component.
  2. Explain the difference between a server socket and a normal socket.
  3. Write a program that reads the contents of a public web page by using the Java HttpURLConnection class.
  4. Write a server-client program that uses Java sockets to exchange data.
  5. Given a Java application, use Maven to introduce a new library dependency.
  6. Given a Java class with dependencies, mock all dependency calls in a JUnit test by using the Mockito library.

  • DUE DATE: TBD

SUMMARY OF ASSIGNMENT

Problem Points
Problem 1 3
Problem 2 25
Problem 3 9
Problem 4 5
GRAND TOTAL: 42

Problem 1

Item Points
Math formula written in comments or Racket 1
Correct answers for numbers 10 and 15 2
TOTAL POSSIBLE POINTS 3

Problem 2

Item Points
Math formula written in comments or Racket 2
Correct answers 1
Correct values inside the table 6
Correct values for updated table 7
Math formula written in comments or Racket 2
Math formula written in comments or Racket 3
Correct values for 30, 60, 90 and 120 days 1
TOTAL POSSIBLE POINTS 25

Problem 3

Item Points
Correct answer for 2, 5, and 10 hours of work 3
Math formula written in comments or Racket 3
Correct answers for 100, 132, and 141 hours 3
TOTAL POSSIBLE POINTS 9

Problem 4

Item Points
Racket function 2
Correct answer for each conversion 3
TOTAL POSSIBLE POINTS 5